Apache重启报警,不存在虚拟主机目录 AH00112: Warning: DocumentRoot……

参考:https://www.cnblogs.com/tulips-lily/p/7070542.html

Apache重启时报警:

AH00112: Warning: DocumentRoot [/usr/local/apache/docs/dummy-host.example.com] does not exist

问题原因:

Apache在配置虚拟主机时会在配置文件中(httpd.conf)开启虚拟主机的配置文件;

将“ #Include /etc/httpd/extra/httpd-vhosts.conf ”前面的“#”去掉;

而“httpd-vhosts.conf ”中会有两个配置虚拟主机的例子:

<VirtualHost *:80>
   ServerAdmin webmaster@dummy-host.example.com
   DocumentRoot "/usr/local/apache/docs/dummy-host.example.com"
   ServerName dummy-host.example.com
   ServerAlias www.dummy-host.example.com
   ErrorLog "logs/dummy-host.example.com-error_log"
   CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>

解决方法:

注销不要的虚拟主机代码即可。

posted @ 2022-12-06 22:18  轻风细雨_林木木  阅读(198)  评论(0编辑  收藏  举报