赞
踩
学习Linux的httpd模块报错:
修改httpd 服务程序的主配置文件后,重启httpd服务报了以下错:
[root@localhost ~]# systemctl restart httpd
Job for httpd.service failed because the control process exited with error code.
See "systemctl status httpd.service" and "journalctl -xe" for details.
其实最开是就应该想到是配置文件写错了,因为是修改文件后报错的。。。但还是记录一下一步一步的解决问题思路吧。
[root@localhost ~]# systemctl status httpd.service ● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since Wed 2020-11-04 23:46:48 CST; 10s ago Docs: man:httpd(8) man:apachectl(8) Process: 3319 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS) Process: 3609 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE) Main PID: 3609 (code=exited, status=1/FAILURE) Nov 04 23:46:48 localhost.localdomain systemd[1]: Starting The Apache HTTP Server... Nov 04 23:46:48 localhost.localdomain httpd[3609]: AH00526: Syntax error on line 119 of /etc/httpd/conf/httpd.conf: Nov 04 23:46:48 localhost.localdomain httpd[3609]: DocumentRoot '/home/wwwroot' is not a directory, or is not readable Nov 04 23:46:48 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE Nov 04 23:46:48 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server. Nov 04 23:46:48 localhost.localdomain systemd[1]: Unit httpd.service entered failed state. Nov 04 23:46:48 localhost.localdomain systemd[1]: httpd.service failed.
DocumentRoot '/home/wwwroot' is not a directory, or is not readable
以为是SELinux的原因,关闭SELinux后发现还未成功
# # DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/home/wwworoot" # # Relax access to content within /var/www. # <Directory "/home/wwwrooot"> AllowOverride None # Allow open access: Require all granted </Directory> # Further relax access to the default document root: <Directory "/home/wwwrooot"> # # Possible values for the Options directive are "None", "All", # or any combination of:
修改Directory目录后正确生效
参考:
https://blog.csdn.net/weixin_30709635/article/details/99143232
https://blog.csdn.net/wangxiaoming099/article/details/23165575
https://blog.csdn.net/zhuoyr/article/details/8393854
https://tpyyes.com/a/linux/616.html(这篇文章最后一句告诉我对症下药,然后我看了我的报错信息)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。