使用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.
展开
 我来答
大董小生
2018-03-30 · TA获得超过9091个赞
知道小有建树答主
回答量:89
采纳率:100%
帮助的人:2.9万
展开全部

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

zues_chan
2016-06-17
知道答主
回答量:1
采纳率:0%
帮助的人:1115
展开全部
去httpd.conf文件里面看 对应的错误行已经给你了 看下是不是自己哪里写错了 不行就注释
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
jinbulee
2017-09-19
知道答主
回答量:6
采纳率:0%
帮助的人:4.4万
展开全部
Syntax error on line 137 of /etc/httpd/conf.d/system-config-httpd.conf
检查下配置文件的137行。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式