乘客403错误

时间:2015-02-22 09:50:51

标签: ruby-on-rails passenger

我正在尝试为我的rails app安装乘客,但我不知道问题出在哪里。

暂停文件:

的httpd.conf

LoadModule passenger_module /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.53/buildout/apache2/mod_passenger.so
   <IfModule mod_passenger.c>
     PassengerRoot /usr/local/lib/ruby/gems/2.1.0/gems/passenger-4.0.53
     PassengerDefaultRuby /usr/local/bin/ruby
   </IfModule>


<VirtualHost *:80>
   ServerName www.yourhost.com
   # !!! Be sure to point DocumentRoot to 'public'!
   DocumentRoot /home/vagrant/shitatta/public 
   <Directory /home/vagrant/shitatta/public>
      # This relaxes Apache security settings.
      AllowOverride all
      # MultiViews must be turned off.
      Options -MultiViews
      # Uncomment this if you're on Apache >= 2.4:
      Require all granted
   </Directory>
</VirtualHost>

error_log中:

[Sun Feb 22 09:49:20 2015] [error] [client 192.168.33.1] (13)Permission denied: access to / denied
[Sun Feb 22 09:49:20 2015] [error] [client 192.168.33.1] (13)Permission denied: access to /favicon.ico denied

1 个答案:

答案 0 :(得分:0)

执行乘客和网络服务器的用户无权访问

  

/家庭/流浪/ shitatta /公共

我认为您应该做出一些改变:

  • 使用您的用户登录(流浪汉)
  • 创建目录/ opt / web /
  • 在/ opt / web / shitatta
  • 中复制项目
  • 转到/ opt / web
  • 更改身份验证访问权限:chmod 755 shitatta/*
  • 更改所有者:chown -R vagrant:vagrant shitatta
  • 使用新路径更改您的apache conf
  • 将您的用户添加到www-data adduser vagrant www-data或将使用Apache的任何其他用户

如果在运行命令时拒绝了权限,请在每个命令之前添加sudo。在我看来,将您的网站存储在您的主文件夹中是一个错误。

你应该读一下rails: