为什么 mod_passenger.so 会出现此权限错误? [英] Why is this permissions error occurring with mod_passenger.so?
问题描述
我正在使用 RVM 和 Passenger 设置生产 RHEL 6 服务器.我已经安装了 RVM(到我的主目录),安装了Passenger,并将所需的行添加到httpd.conf
:
LoadModulepassenger_module/home/em/.rvm/gems/ruby-1.9.2-p290@rails_3_production/gems/passenger-3.0.11/ext/apache2/mod_passenger.soPassengerRoot/home/em/.rvm/gems/ruby-1.9.2-p290@rails_3_production/gems/passenger-3.0.11乘客Ruby/home/em/.rvm/wrappers/ruby-1.9.2-p290@rails_3_production/ruby
但是当我重新启动 Apache 时出现此错误...
$ sudo/sbin/service httpd restart停止 httpd:[失败]启动 httpd:httpd:/etc/httpd/conf/httpd.conf 的第 218 行语法错误:无法加载/home/em/.rvm/gems/ruby-1.9.2-p290@rails_3_production/gems/passenger-3.0.11/ext/apache2/mod_passenger.so 进入服务器:/home/em/.rvm/gems/ruby-1.9.2-p290@rails_3_production/gems/passenger-3.0.11/ext/apache2/mod_passenger.so:无法打开共享对象文件:权限被拒绝[失败的]
在实验中,我将从 ~/.rvm/...
开始的整个路径设置为 777,但我仍然遇到同样的错误.
有什么想法吗?
原来与 SELinux 有关.
Passenger 文档对此进行了讨论 安装Passenger后,找到Passenger根目录... 然后运行这个... I'm setting up a production RHEL 6 server with RVM and Passenger. I've gotten through installing RVM (to my home dir), installing Passenger, and adding the required lines to But when I restart Apache I get this error... Experimentally, I set the whole path starting at Any thoughts? It turned out to have to do with SELinux. The Passenger docs discuss it here. After you install Passenger, find the Passenger root... Then run this...
这篇关于为什么 mod_passenger.so 会出现此权限错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!passenger-config --root
chcon -R -h -t httpd_sys_content_t/path-to-passenger-root
httpd.conf
:LoadModule passenger_module /home/em/.rvm/gems/ruby-1.9.2-p290@rails_3_production/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /home/em/.rvm/gems/ruby-1.9.2-p290@rails_3_production/gems/passenger-3.0.11
PassengerRuby /home/em/.rvm/wrappers/ruby-1.9.2-p290@rails_3_production/ruby
$ sudo /sbin/service httpd restart
Stopping httpd: [FAILED]
Starting httpd: httpd: Syntax error on line 218 of /etc/httpd/conf/httpd.conf: Cannot load /home/em/.rvm/gems/ruby-1.9.2-p290@rails_3_production/gems/passenger-3.0.11/ext/apache2/mod_passenger.so into server: /home/em/.rvm/gems/ruby-1.9.2-p290@rails_3_production/gems/passenger-3.0.11/ext/apache2/mod_passenger.so: cannot open shared object file: Permission denied
[FAILED]
~/.rvm/...
to 777, but I'm still getting that same error.passenger-config --root
chcon -R -h -t httpd_sys_content_t /path-to-passenger-root