我的服务器运行正常,但有些东西改变了,我不确定是什么.
我收到以下错误,无法获得某些子域名.
apache2: Could not reliably determine the server's fully qualified domain name, using 2001:.....:a669 for ServerName [Sat Dec 14 21:20:36 2013] [warn] NameVirtualHost 0.0.0.0:80 has no VirtualHosts ... [Sat Dec 14 21:20:36 2013] [warn] NameVirtualHost 0.0.0.0:80 has no VirtualHosts Syntax OK
我已经尝试将ports.conf更改为Listen 80和Listen 0.0.0.0:80(参见http://www.rackaid.com/resources/how-to-disable-ipv6-in-apache-server/)
这是我的一个vhost文件.
NameVirtualHost 0.0.0.0:80 Listen 0.0.0.0:80ServerName www.domain.us ServerAlias domain.us ServerAdmin email@domain.us DocumentRoot /home/valid_domain_path/www Options FollowSymLinks AllowOverride None Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all ErrorLog ${APACHE_LOG_DIR}/www.domain.us.error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel info CustomLog ${APACHE_LOG_DIR}/www.domain.us.access.log combined
000默认链接正确.
Apache 2.2.22
谢谢,
如果我的怀疑是正确的,并且您的系统最近已经更新,那么您现在使用Apache 2.4而不是2.2,就像许多其他用户刚刚(已)转移到新的Ubuntu 13.10版本一样.(如果您尚未更改为Apache 2.4,那么现在可能是更新新的*.conf文件的好时机.)
以下是关于如何使基于命名的VirtualHosts在Apache 2.4中工作的非常好的解释:http: //httpd.apache.org/docs/2.4/vhosts/name-based.html
在本质上:
从现在开始不要使用任何"NameVirtualHost"条目
像这样启动所有VirtualHost条目 <VirtualHost *:80>
确保在每个VirtualHost条目中只包含一个ServerName,例如. ServerName www.example.com
最后它应该是这样的:
<VirtualHost *:80> # This first-listed virtual host is also the default for *:80 ServerName www.example.com ServerAlias example.com DocumentRoot /www/domain </VirtualHost> <VirtualHost *:80> ServerName other.example.com DocumentRoot /www/otherdomain </VirtualHost>