简体   繁体   English

403使用rails / apache / passenger禁止访问

[英]403 forbidden access with rails/apache/passenger

I have apache installed on debian squeeze. 我在debian squeeze上安装了apache。 I've installed ruby 1.9.3 by rvm and rails + passenger via 'gem install'. 我已经通过rvm和rails + passenger通过'gem install'安装了ruby 1.9.3。 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. 我的设置是'/ var / rails / rails_app'中的rails应用程序,我配置了一个子域'rails-app.mydomain.com',重定向到该应用程序文件夹,该文件夹使用www-data:www-data chmodded 755。

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 我已经关注了这个网站上的Ruby On Rails安装 - > http://xyzpub.com/en/ruby-on-rails/3.2/rails3-install-debian.html和乘客一个子域设置 - > 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! 现在当我通过该子域进入我的网站时,它显示“403禁止访问”错误! Before i removed it, it showed up the Ruby On Rails "Welcome abroad"-Message. 在我删除它之前,它出现了Ruby On Rails“欢迎海外” - 消息。

When I start Passenger Standalone in the application dir via 'passenger start' the app works like it should on port 3000. 当我通过'passenger start'在应用程序目录中启动Passenger Standalone时,应用程序就像它应该在端口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/ apache错误日志显示我[2012年11月10日07:38:09] [错误] [客户端XXX.XXX.XXX.XXX]客户端被服务器配置拒绝:/ 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. 我认为您正在尝试通过端口80上的http访问您的应用程序。并且您尚未使用post 80将apache配置为指向您的应用程序。

First of all please check if the passenger mod is install on your server Secondly please verify your apache configuration to be something like 首先请检查您的服务器上是否安装了乘客mod。其次请验证您的apache配置是否类似

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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