我正在全新安裝 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