开发者

apache shows the content of my public dir - rails + apache + passenger + local git + capistrano + ubuntu

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:

  1. I have deleted the index.html file from public (before, apache would show the rails welcome page)
  2. I have a map root route in my route.rb - that used to perfectly work in my dev envronment.

    map.root :controller => 'home'

  3. 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):

  1. Ubuntu 9.04 32 bit
  2. 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

  3. all steps went fine including the capistrano deployment which successfully deployed my app under: /var/www/appname/current/

  4. 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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜