AH00112:警告:DocumentRoot [/html/www/html] 不存在

AH00112:警告:DocumentRoot [/html/www/html] 不存在

當我做

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為正確的路徑,或刪除該虛擬主機。

相關內容