我尝试在 CentOS 6 上安装 Phusion Passenger。按照以下安装说明进行操作https://www.phusionpassenger.com/library/install/apache/install/oss/el6/
最后一步是重新启动 Apache,然后我得到了..
$ sudo service httpd restart Stopping httpd: [FAILED] Starting httpd: httpd: Syntax error on line 229 of /etc/httpd/conf/httpd.conf: Cannot load /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.1.1/buildout/apache2/mod_passenger.so into server: /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.1.1/buildout/apache2/mod_passenger.so: undefined symbol: ap_log_error_ [FAILED]
我验证后发现,mod_passenger.so 在错误消息中的目录中是存在的。然后我尝试使用以下命令进行验证,得到了如下结果。
Final autodetection results
* Found Apache 2.2.15!
Information:
apxs2 : /usr/bin/apxs
Main executable: /usr/sbin/httpd
Control command: /usr/sbin/apachectl
Config file : /etc/httpd/conf/httpd.conf
Error log file : unknown
To install Phusion Passenger against this specific Apache version:
/usr/local/rvm/gems/ruby-2.2.2/wrappers/ruby /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.1.1/bin/passenger-install-apache2-module --apxs2-path='/usr/bin/apxs'
To start, stop or restart this specific Apache version:
/usr/sbin/apachectl start
/usr/sbin/apachectl stop
/usr/sbin/apachectl restart
* Found Apache 2.2.15!
Information:
apxs2 : /usr/sbin/apxs
Main executable: /usr/sbin/httpd
Control command: /usr/sbin/apachectl
Config file : /etc/httpd/conf/httpd.conf
Error log file : unknown
To install Phusion Passenger against this specific Apache version:
/usr/local/rvm/gems/ruby-2.2.2/wrappers/ruby /usr/local/rvm/gems/ruby-2.2.2/gems/passenger-5.1.1/bin/passenger-install-apache2-module --apxs2-path='/usr/sbin/apxs'
To start, stop or restart this specific Apache version:
/usr/sbin/apachectl start
/usr/sbin/apachectl stop
/usr/sbin/apachectl restart
WARNING: You have multiple Apache installations on your system!
You are strongly recommended to read this section of the documentation:
https://www.phusionpassenger.com/install/apache/multiple_apache_installs.html
根据建议的链接中的信息,我似乎遇到了有关 Apache 多个版本的问题,我可能应该通过运行命令“passenger-install-apache2-module”并指定 APXS2 位置来强制构建。
但上面的消息显示Apache 2.2.15有重复的版本。
请问我应该怎么做才能解决这个问题?您有什么建议吗?
更新 我最终卸载了 Apache 和 Phusion Passenger,然后重新安装它们。现在运行良好。