dongxie45083 2013-12-02 02:31
浏览 44
已采纳

非Ruby / Rack网站抛出乘客错误#2

I have Rails and non-rails sites mixed together on a slice at Rackspace. It's running CentOS 6.3 and packages are managed with yum.

A php site is running under a user account (/home/chad) different than most of the sites running on the server (which are coming from /var/www). Sites in /var/www render fine. The error is:

Passenger error #2

An error occurred while trying to access '/home/chad/sdb/config.ru': Cannot stat '/home/chad/sdb/config.ru': Permission denied (errno=13)
Apache doesn't have read permissions to that file. Please fix the relevant file permissions.

This should not be intercepted nor served via Passenger at all. Following the solution in this thread (Ruby error on non-ruby site) I end up with the Apache Server Test Page instead of the Passenger Error.

The httpd.conf entry for this virtual host:

<VirtualHost *:80>
  ServerName stardustbakery.com
  ServerAlias www.stardustbakery.com
  ServerAdmin ****@******.***
  DocumentRoot "/home/chad/sdb/public_html"
  CustomLog /var/log/httpd/stardustbakery.com-access_log combined
  ErrorLog /var/log/httpd/stardustbakery.com-error_log
  PassengerEnabled off
</VirtualHost>

I've also tried manually setting the IP for all virtual hosts and I've upgraded Passenger from 4.0.14 to 4.0.26.

Apache is version 2.2.15. PHP is 5.3.3. Ruby is 1.9.3

  • 写回答

1条回答 默认 最新

  • dongrou839975 2013-12-03 17:15
    关注

    For what it's worth, the issue appeared to be the perms on /home/chad. Adding chad and apache to the same group and then giving the group permissions on /home/chad worked.

    Likewise, we could have put the sites in a folder that was owned by that group outside of /home/chad as well, but that would have caused more logistical problems.

    If there's a better solution, I'd love to hear it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法