使用service httpd start 启动Apache时出现下列问题。请问该怎么解决?急求。 10
[root@localhosthttpd-2.4.20]#systemctlstatushttpd.service●httpd.service-TheApacheHTTP...
[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. 展开
● 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. 展开
3个回答
展开全部
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
展开全部
去httpd.conf文件里面看 对应的错误行已经给你了 看下是不是自己哪里写错了 不行就注释
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Syntax error on line 137 of /etc/httpd/conf.d/system-config-httpd.conf
检查下配置文件的137行。
检查下配置文件的137行。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询