我正在全新安装 Centos 7,在为 Apache 设置 VirtualHost 后,它无法启动。没有明显的错误,journalctl -xe
但无论如何,这里都是输出。
-- Unit httpd.service has begun starting up.
Sep 30 23:28:41 vps97148.vps.ovh.ca systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Sep 30 23:28:41 vps97148.vps.ovh.ca kill[1424]: kill: cannot find process ""
Sep 30 23:28:41 vps97148.vps.ovh.ca systemd[1]: httpd.service: control process exited, code=exited status=1
Sep 30 23:28:41 vps97148.vps.ovh.ca systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has failed.
--
-- The result is failed.
Sep 30 23:28:41 vps97148.vps.ovh.ca systemd[1]: Unit httpd.service entered failed state.
Sep 30 23:28:41 vps97148.vps.ovh.ca systemd[1]: httpd.service failed.
Sep 30 23:28:41 vps97148.vps.ovh.ca polkitd[1082]: Unregistered Authentication Agent for unix-process:1408:672266 (system bus name :1.29, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
httpd -t
并apachectl configtest
告诉我我的语法没问题。
apachectl -S
没有输出。
这是我的域名.com.conf:
<VirtualHost *:80>
ServerName domainname.com
DocumentRoot /var/www/domainname.com/public_html
ErrorLog /var/www/domainname.com/error.log
CustomLog /var/www/domainname.com/requests.log combined
</VirtualHost>
对我有任何帮助吗?或者有人可以告诉我我做错了什么吗?
这里有更多信息。
在顶级配置的底部有一行内容,上面写着Include sites-enabled/*.conf
这是我的domainname.com.conf 所在的位置。
日志的目录确实存在,并且我可以访问日志。
DocumentRoot
确实指向一个目录。服务器可以解析该ServerName
条目,并指向回服务器的IP