重新启动apache2服务器时发出警告

时间:2014-09-02 05:10:51

标签: apache2

重新启动apache2服务器时,我收到警告。

$ sudo service apache2 restart
* Restarting web server apache2
[Tue Sep 02 10:38:54 2014] [warn] NameVirtualHost *:80 has no VirtualHosts
[Tue Sep 02 10:38:54 2014] [warn] NameVirtualHost *:80 has no VirtualHosts

如何解决此警告?

1 个答案:

答案 0 :(得分:0)

这里的问题是您的服务器配置错误。您希望确保ListenNameVirtualHostVirtualHost的值都匹配。在你的情况下,我期待:

Listen *:80
NameVirtualHost *:80

<VirtualHost *:80>
    ServerName ...
    DocumentRoot ...
    ...
</VirtualHost>