gpt4 book ai didi

ruby-on-rails - 乘客/mod_rails在启动Apache时无法在Fedora 12中初始化

转载 作者:行者123 更新时间:2023-12-04 03:00:01 27 4
gpt4 key购买 nike

我正在设置一个服务器,以使用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_rails start -e production触发mongrel来运行应用程序,则会看到以下内容:
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帮助上过程的特定示例- checkout 。

    关于ruby-on-rails - 乘客/mod_rails在启动Apache时无法在Fedora 12中初始化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2054554/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com