乘客/mod_rails在启动Apache时无法在Fedora 12中初始化 [英] Passenger/mod_rails fails to initialize in Fedora 12 when starting Apache

查看:87
本文介绍了乘客/mod_rails在启动Apache时无法在Fedora 12中初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设置一个服务器,以使用乘客"在Fedora 12上运行Ruby on Rails应用程序.

I am in the process of setting up a server to run a Ruby on Rails application on Fedora 12, using Passenger.

我正在安装Passenger的阶段,按照规定进行设置,但是在重新启动Apache时出现以下错误:

I am at the stage where I've installed Passenger, set it up as prescribed, but get the following errors when I restart Apache:

[Wed Jan 13 15:41:38 2010] [notice] caught SIGTERM, shutting down
[Wed Jan 13 15:41:40 2010] [notice] SELinux policy enabled; httpd running as context unconfined_u:system_r:httpd_t:s0
[Wed Jan 13 15:41:40 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Jan 13 15:41:40 2010] [error] *** Passenger could not be initialized because of this error: Cannot create FIFO file /tmp/passenger.25235/.guard: Permission denied (13)
[Wed Jan 13 15:41:40 2010] [notice] Digest: generating secret for digest authentication ...
[Wed Jan 13 15:41:40 2010] [notice] Digest: done
[Wed Jan 13 15:41:40 2010] [error] *** Passenger could not be initialized because of this error: Cannot create FIFO file /tmp/passenger.25235/.guard: Permission denied (13)
[Wed Jan 13 15:41:40 2010] [error] python_init: Python version mismatch, expected '2.6', found '2.6.2'.
[Wed Jan 13 15:41:40 2010] [error] python_init: Python executable found '/usr/bin/python'.
[Wed Jan 13 15:41:40 2010] [error] python_init: Python path being used '/usr/lib/python26.zip:/usr/lib/python2.6/:/usr/lib/python2.6/plat-linux2:/usr/lib/python2.6/lib-tk:/usr/lib/python2.6/lib-old:/usr/lib/python2.6/lib-dynload'.
[Wed Jan 13 15:41:40 2010] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Wed Jan 13 15:41:40 2010] [notice] mod_python: using mutex_directory /tmp 
[Wed Jan 13 15:41:40 2010] [notice] Apache/2.2.14 (Unix) DAV/2 Phusion_Passenger/2.2.9 PHP/5.3.0 mod_python/3.3.1 Python/2.6.2 mod_ssl/2.2.14 OpenSSL/1.0.0-fips-beta3 mod_perl/2.0.4 Perl/v5.10.0 configured -- resuming normal operations

如您所见,Passenger尝试初始化时存在权限问题:

As you can see, there is a permissions problem when Passenger is trying to initialize:

[Wed Jan 13 15:41:40 2010] [error] *** Passenger could not be initialized because of this error: Cannot create FIFO file /tmp/passenger.25235/.guard: Permission denied (13)

启动Apache时,它确实在/tmp中创建了一个文件:

When Apache is starts, it does create a file in /tmp:

d-ws--x--x. 2 root  root  4096 2010-01-13 16:04 passenger.26117

如果相反,我直接通过mongrel_rails start -e production启动 mongrel 来运行应用程序,则会看到以下内容:

If instead I run the app by firing up mongrel directly with mongrel_rails start -e production, I see the following:

ActiveRecord::StatementInvalid (Mysql::Error: Can't create/write to file '/tmp/#sql_5d3_0.MYI' (Errcode: 13): SHOW FIELDS FROM `users`):

再次错误提示/tmp 目录的权限问题.

Again the error points to permission issues with the /tmp directory.

我对解决方案不知所措.我不确定它是否仅与目录权限或Fedora的SELinux安全性有关.

I am at a loss as to what the solution is. I'm not sure if it is related to simply directory permissions or Fedora's SELinux security.

任何帮助将不胜感激.谢谢.

Any help would be appreciated. Thanks.

推荐答案

我所做的工作与Fred相同,只是一次没有犯一个错误:

I did the same as Fred, except that instead of doing it one error at a time:

  1. 通过运行setenforce 0
  2. 进入宽松模式
  3. 重新启动apache,然后访问您的网站并正常使用一段时间
  4. 运行grep httpd /var/log/audit/audit.log | audit2allow -M passenger
  5. semodule -i passenger.pp
  6. 通过运行setenforce 1
  7. 返回强制模式
  8. 重新启动apache并测试您的网站-希望它应该能像以前一样正常工作!
  1. Go into permissive mode by running setenforce 0
  2. Restart apache, and hit your site and use it for a while as normal
  3. Run grep httpd /var/log/audit/audit.log | audit2allow -M passenger
  4. semodule -i passenger.pp
  5. Go back to enforcing mode by running setenforce 1
  6. Restart apache and test your site - hopefully it should all be working as before!

请注意,这基本上是 Centos SELinux 帮助-查看.

Note that this is basically a specific example of the procedure on the Centos SELinux help - check it out.

这篇关于乘客/mod_rails在启动Apache时无法在Fedora 12中初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆