这是启动Apache2时出现的错误:
* Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
[Wed Oct 21 16:37:26 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Wed Oct 21 16:37:26 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Wed Oct 21 16:37:26 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Wed Oct 21 16:37:26 2009] [error] VirtualHost *:80 -- mixing * ports and non-* ports with a NameVirtualHost address is not supported, proceeding with undefined results
[Wed Oct 21 16:37:26 2009] [warn] NameVirtualHost *:80 has no VirtualHosts
我首先按照此指南设置了Apache以托管多个站点:
然后,我在ServerFault上找到了一个类似的问题,并尝试应用该解决方案,但没有帮助。
这是我最终的VirtualHost配置的示例:
<VirtualHost *:80>
ServerAdmin admin@xxx.com
ServerName www.xxx.com
ServerAlias xxx.com
# Indexes + Directory Root.
DirectoryIndex index.html
DocumentRoot /var/www/www.xxx.com
# Logfiles
ErrorLog /var/www/www.xxx.com/logs/error.log
CustomLog /var/www/www.xxx.com/logs/access.log combined
</VirtualHost>
用X域名来保护无辜的人:-)
另外,指南中提到的conf.d / virtual.conf文件如下所示:
NameVirtualHost *
奇怪的是,这三个站点中的两个似乎一切正常。