简体   繁体   English

乘客无法开始投注

[英]Passenger unable to start phusion

On Cent OS 6.0 with SELinux running, I get an error "Passenger could not be initialized because of this error: Unable to start the Phusion Passenger watchdog" 在运行SELinux的Cent OS 6.0上,我收到错误“由于此错误导致乘客无法初始化:无法启动Phusion Passenger看门狗”

This thread discusses the problem. 这个主题讨论了这个问题。 https://groups.google.com/forum/?fromgroups#!topic/phusion-passenger/qaVUIq2HceE https://groups.google.com/forum/?fromgroups#!topic/phusion-passenger/qaVUIq2HceE

Is there any way to resolve this without disabling SELinux. 有没有办法解决这个问题而不禁用SELinux。 Seems like it doesn't something important, and should be configured instead of disabled. 看起来它不重要,应该配置而不是禁用。

Because SELinux is wary of Apache, you can try allowing Apache access to passenger files and directories. 由于SELinux对Apache很谨慎,因此您可以尝试允许Apache访问乘客文件和目录。 Try the following, but YMMV! 尝试以下,但是YMMV! If you've installed Phusion Passenger via a gem, then run this command to determine Phusion Passenger's root folder: 如果您通过gem安装了Phusion Passenger,则运行此命令以确定Phusion Passenger的根文件夹:

passenger-config --root

Then do 然后做

chcon -R -h -t httpd_sys_content_t /path-to-passenger-root

If you installed Passenger from a tarball of some kind, try this instead: 如果您从某种tarball安装Passenger,请尝试以下方法:

chcon -R -h -t httpd_sys_content_t /path/to/passenger/folder

In either case restart Apache. 在任何一种情况下重启Apache。

You might also need to satisfy SELinux's *httpd_sys_content_t* security context for access to your rails app. 您可能还需要满足SELinux的* httpd_sys_content_t *安全上下文才能访问您的rails应用程序。 You may also need to do the following: 您可能还需要执行以下操作:

chcon -R -h -t httpd_sys_content_t /path/to/your/rails/app

Maybe this will work for you. 也许这对你有用。

Using chcon only works temporarily. 使用chcon只能暂时使用。 The next time the machine does a reboot and SELinux does a relabel, the configuration will be lost. 下次机器重新启动并且SELinux执行重新标记时,配置将丢失。 The files will be relabeled to whatever context is right for where they are in the filesystem. 这些文件将被重新标记为适合它们在文件系统中的任何上下文。

If you put the rails app under /var/www/html then SELinux will maintain the contexts at relabel time, because SELinux policy says that's where web content should be. 如果您将rails应用程序放在/ var / www / html下,则SELinux将在重新标记时保持上下文,因为SELinux策略表明Web内容应该在哪里。 Initially you'd do restorecon -R /var/ww/html/path/to/app to set the contexts. 最初你会执行restorecon -R /var/ww/html/path/to/app来设置上下文。

I've found though, that Passenger does lots of stuff that SELinux wants to deny so just a relabel isn't enough. 我发现,乘客做了许多SELinux想要否认的东西,所以只是重新开始是不够的。 It's easy to create policy to allow that, but I see it as a security risk. 创建策略很容易,但我认为这是一个安全风险。 Too bad the Rails community doesn't make it easier to deploy on a normal server (ie not an Ruby stack). 太糟糕了,Rails社区不会让它更容易在普通服务器上部署(即不是Ruby堆栈)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM