I decided just recently to implement my RoR project in a production experimental environment. The problem I'm experiencing is when trying to view my main app page, apache would show the content of public directory instead.
Important notes:
- I have deleted the index.html file from public (before, apache would show the rails welcome page)
I have a map root route in my route.rb - that used to perfectly work in my dev envronment.
map.root :controller => 'home'
I'm using the virtual host file that was automatically created by capistrano deployment under /etc/apache2/sites-available/appname
its Content:
NameVirtualHost specific.ip.address:80
ServerName specific.ip.address
DocumentRoot /var/www/appname/current/public
Dev environment (in which everything works fine):
Ruby and Rails installed on my macbook pro using the default mongrel configuration
Experimental production environment (where I'm experiencing the problem):
- Ubuntu 9.04 32 bit
Rails, Ruby, Apache, git (local), passenger and capistrano were installed and configured following the instructions in : http://hackd.thrivesmarthq.com/how-to-setup-a-linux-server-for-ruby-on-rails-with-github-and-phusion-passenger
all steps went fine including the capistrano deployment which successfully deployed my app under: /var/www/appname/current/
as detailed above, when trying to view my main app page - apache would show the content of my public dir (even though I don't have index.html and I have a map root route that worked in de开发者_如何学JAVAv)
Regards, Jason
add
Options -Indexes
to a directory configuration settings in your virtualhost. Either in
<Directory />
Options -Indexes
</Directory>
or in your document root
<Directory /var/www/appname/current/public>
Options -Indexes
</Directory>
精彩评论