使用service httpd start 启动Apache时出现下列问题。请问该怎么解决?急求。

[root@localhost httpd-2.4.20]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 三 2016-06-15 18:37:33 CST; 53s ago
Process: 4258 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 4258 (code=exited, status=1/FAILURE)

6月 15 18:37:32 localhost.localdomain systemd[1]: Starting The Apache HTTP S...
6月 15 18:37:33 localhost.localdomain httpd[4258]: httpd: Syntax error on li...
6月 15 18:37:33 localhost.localdomain systemd[1]: httpd.service: Main proces...
6月 15 18:37:33 localhost.localdomain systemd[1]: Failed to start The Apache...
6月 15 18:37:33 localhost.localdomain systemd[1]: httpd.service: Unit entere...
6月 15 18:37:33 localhost.localdomain systemd[1]: httpd.service: Failed with...
Hint: Some lines were ellipsized, use -l to show in full.
[root@localhost httpd-2.4.20]# /usr/sbin/httpd $OPTIONS -DFOREGROUND
httpd: Syntax error on line 353 of /etc/httpd/conf/httpd.conf: Syntax error on line 137 of /etc/httpd/conf.d/system-config-httpd.conf: /etc/httpd/conf.d/system-config-httpd.conf:143: <Directory> was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:141: <Directory> was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:139: <Directory> was not closed.\n/etc/httpd/conf.d/system-config-httpd.conf:137: <Directory> was not closed.

Syntax error on line 137 of /etc/httpd/conf.d/system-config-httpd.conf。修改下配置文件的137行。

其他:

service httpd restart   出现 httpd:unrecognized service 错误


vi /etc/rc.local #在/etc/rc.d/rc.local中增加启动apache的命令


添加:


/usr/local/apache2/bin/apachectl start


或者               


#将apache注册为系统服务


# cp /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/httpd


#chmod 700 /etc/rc.d/init.d/httpd


#vi /etc/rc.d/init.d/httpd


在第三行后增加


#Comments to support chkconfig on RedHat Linux


#chkconfig: 2345 90 90


#description:http server

温馨提示:答案为网友推荐,仅供参考
第1个回答  2016-06-17
去httpd.conf文件里面看 对应的错误行已经给你了 看下是不是自己哪里写错了 不行就注释
第2个回答  2017-09-19
Syntax error on line 137 of /etc/httpd/conf.d/system-config-httpd.conf
检查下配置文件的137行。

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网