我在centos7上安装了带apache的乘客。
安装成功后,我把这个乘客配置放在apache的httpd.conf中,然后我再次重启apache,我仍然得到如下错误,
Jan 25 04:11:14 ip-10-0-0-201 systemd[1]: Starting The Apache HTTP Server...
Jan 25 04:11:14 ip-10-0-0-201 httpd[26168]: httpd: Syntax error on line 351 of /etc/httpd/conf/httpd.conf: Cannot load /home/centos/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/passenger-5.1.12/buildout/apache2...
Jan 25 04:11:14 ip-10-0-0-201 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jan 25 04:11:14 ip-10-0-0-201 kill[26170]: kill: cannot find process ""
Jan 25 04:11:14 ip-10-0-0-201 systemd[1]: httpd.service: control process exited, code=exited status=1
Jan 25 04:11:14 ip-10-0-0-201 systemd[1]: Failed to start The Apache HTTP Server.
Jan 25 04:11:14 ip-10-0-0-201 systemd[1]: Unit httpd.service entered failed state.
Jan 25 04:11:14 ip-10-0-0-201 systemd[1]: httpd.service failed.
这是我的httpd.conf
#EnableMMAP off
EnableSendfile on
LoadModule passenger_module /home/centos/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/passenger-5.1.12/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/centos/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/passenger-5.1.12
PassengerDefaultRuby /home/centos/.rbenv/versions/2.5.0/bin/ruby
</IfModule>
# Supplemental configuration
#
# Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf
如果我从httpd.conf
删除上面的代码,我仍然可以成功重启apache。
非常感谢任何建议。