我的服务器工作正常,但有变化,我不知道是什么。
我得到了下面的错误,无法得到一些子域。
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更改为侦听80和侦听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:80
<VirtualHost 0.0.0.0:80>
ServerName www.domain.us
ServerAlias domain.us
ServerAdmin email@domain.us
DocumentRoot /home/valid_domain_path/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/valid_domain_path/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
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
缺省值是正确链接的。
Apache 2.2.22
谢谢,
发布于 2014-01-09 13:09:45
如果我的猜测是正确的,并且您的系统最近已经更新,那么您现在使用的是Apache2.4而不是2.2,就像其他刚刚(获得)到新的Ubuntu13.10版本的用户一样。(如果您还没有更改为Apache2.4,那么现在可能是更新新*.conf文件的好时机。)
下面是关于如何使基于名称的VirtualHosts在Apache2.4:http://httpd.apache.org/docs/2.4/vhosts/name-based.html中工作的一个很好的解释
实质上:
<VirtualHost *:80>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>https://stackoverflow.com/questions/20591951
复制相似问题