【发布时间】:2016-06-06 21:10:10
【问题描述】:
我在将 passenger_module 加载到 Apache 时遇到问题。
# /usr/local/apache/conf.d/passenger.conf
LoadModule passenger_module modules/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby/1.8/phusion_passenger/locations.ini
PassengerRuby /usr/bin/ruby
PassengerInstanceRegistryDir /var/run/passenger-instreg
</IfModule>
由于我找不到相对于上述配置文件的modules/mod_passenger.so,我指定了我在其他地方找到的mod_passenger 文件,它位于/usr/lib64/httpd/modules/mod_passenger.so。所以新的配置是:
LoadModule passenger_module /usr/lib64/httpd/modules/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby/1.8/phusion_passenger/locations.ini
PassengerRuby /usr/bin/ruby
PassengerInstanceRegistryDir /var/run/passenger-instreg
</IfModule>
运行 service httpd restart 给我这个错误:
httpd: Syntax error on line 28 of /usr/local/apache/conf/httpd.conf: Syntax error on line 1 of /usr/local/apache/conf/includes/pre_main_global.conf:
Syntax error on line 3 of /usr/local/apache/conf.d/passenger.conf: Cannot load /usr/lib64/httpd/modules/mod_passenger.so into server: /usr/lib64/httpd/modules/mod_passenger.so: undefined symbol: ap_escape_html
它实际上是在 apache 配置的顶部加载的。
顺便说一句,如果我这样做:
/usr/bin/passenger-config validate-install
我会得到:
You are about to validate Passenger against the following
Apache installation:
Apache 2.4.16
apxs2 : /usr/bin/apxs
Executable: /usr/local/apache/bin/httpd
However, 1 other Apache installation(s) have been found on your system:
Apache 2.4.16
apxs2 : /usr/local/apache/bin/apxs
Executable: /usr/local/apache/bin/httpd
如果我选择了y,我会得到:
* Checking whether this Passenger install is in PATH... ✓
* Checking whether there are no other Passenger installations... ✓
* Checking whether Apache is installed... ✓
* Checking whether the Passenger module is correctly configured in Apache... ✓
如果你们能就这个问题分享一些信息,那就太好了。如果需要,请随时询问更多信息。提前致谢。
我正在使用centos-release-6-8.el6.centos.12.3.x86_64
【问题讨论】:
标签: apache ruby-on-rails-3 passenger