我正在使用Passenger设置服务器以在Fedora 12上运行Ruby on Rails应用程序.
我正处于安装Passenger的阶段,按规定进行设置,但在重新启动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尝试初始化时存在权限问题:
[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中创建一个文件:
d-ws--x--x. 2 root root 4096 2010-01-13 16:04 passenger.26117
如果我通过直接启动mongrel运行应用程序mongrel_rails start -e production
,我看到以下内容:
ActiveRecord::StatementInvalid (Mysql::Error: Can't create/write to file '/tmp/#sql_5d3_0.MYI' (Errcode: 13): SHOW FIELDS FROM `users`):
同样,错误指向/ tmp目录的权限问题.
我不知道解决方案是什么.我不确定它是否与简单的目录权限或Fedora的SELinux安全性有关.
任何帮助,将不胜感激.谢谢.
我和Fred做了同样的事情,不过一次只做一次错误:
通过运行进入许可模式 setenforce 0
重启apache,点击你的网站并正常使用它一段时间
跑 grep httpd /var/log/audit/audit.log | audit2allow -M passenger
semodule -i passenger.pp
通过运行返回执行模式 setenforce 1
重启apache并测试你的网站 - 希望它一切都像以前一样工作!
请注意,这基本上是Centos SELinux帮助程序的一个具体示例- 请查看它.