简体   繁体   中英

403 forbidden access with rails/apache/passenger

I have apache installed on debian squeeze. I've installed ruby 1.9.3 by rvm and rails + passenger via 'gem install'. My setup is an rails application in '/var/rails/rails_app' and i configured a subdomain 'rails-app.mydomain.com' that redirects to that application folder which is chmodded 755 with www-data:www-data.

I've followed the Ruby On Rails installation on this site -> http://xyzpub.com/en/ruby-on-rails/3.2/rails3-install-debian.html and the passenger one one with subdomain setup on this -> http://www.asconix.com/howtos/debian/multiple-ruby-rails-apache-passenger-rvm-debian-howto

Now when I enter my website through that subdomain it shows a "403 forbidden access" error! Before i removed it, it showed up the Ruby On Rails "Welcome abroad"-Message.

When I start Passenger Standalone in the application dir via 'passenger start' the app works like it should on port 3000.

Can you tell me what's the problem?

apache error log shows me this [Sat Nov 10 07:38:09 2012] [error] [client XXX.XXX.XXX.XXX] client denied by server configuration: /var/rails/rails_app/public/

I think you are trying to access your application through http on port 80. And you have not configured apache to point to your application using post 80.

First of all please check if the passenger mod is install on your server Secondly please verify your apache configuration to be something like

<VirtualHost *:80>
      ServerName <server name>
      # !!! Be sure to point DocumentRoot to 'public'!
      DocumentRoot <path to public folder of your application>
      RailsEnv production
      <Directory <path to public folder of your application> >
         # This relaxes Apache security settings.
         AllowOverride all
         # MultiViews must be turned off.
         Options FollowSymLinks
      </Directory
   </VirtualHost>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM