![AH00112:警告:DocumentRoot [/html/www/html] 不存在](https://rvso.com/image/1024456/AH00112%EF%BC%9A%E8%AD%A6%E5%91%8A%EF%BC%9ADocumentRoot%20%5B%2Fhtml%2Fwww%2Fhtml%5D%20%E4%B8%8D%E5%AD%98%E5%9C%A8.png)
當我做
cd /etc/apache2/
apache2ctl configtest
我明白了:
AH00112:警告:DocumentRoot [/html/www/html] 不存在
我在哪裡可以找到該行,以便我可以更改它?
答案1
實際上,這只是一個警告而不是錯誤,您可以忽略它。如果您DocumentRoot
在虛擬主機中定義不存在的路徑,就會發生這種情況。如果您想刪除該警告,只需找到指向該目錄的虛擬主機即可。通常/etc/apache2/sites-enabled/000-default.conf
包含如下內容:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
只需變更DocumentRoot /var/www/html
為正確的路徑,或刪除該虛擬主機。