我正在使用Centos6.3,我已经使用Slicehost教程配置了apache。
我的配置如下:
<VirtualHost *:80>
ServerName christabellehotel.com
ServerAlias www.christabellehotel.com
DirectoryIndex index.php
DocumentRoot /home/sites/christabellehotel.com
LogLevel warn
ErrorLog /home/sites/christabellehotel.com/error.log
CustomLog /home/sites/christabellehotel.com/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName akteabeach.com
ServerAlias www.akteabeach.com
DirectoryIndex index.php
DocumentRoot /home/sites/akteabeach.com
LogLevel warn
ErrorLog /home/sites/akteabeach.com/error.log
CustomLog /home/sites/akteabeach.com/access.log combined
</VirtualHost>
<VirtualHost *:80>
ServerName 198.199.125.69
DirectoryIndex index.php
DocumentRoot /home/sites/
LogLevel warn
ErrorLog /home/sites/error.log
CustomLog /home/sites/access.log combined
</VirtualHost>问题是,当我打开http://christabellehotel.com/时,我无法看到所配置的虚拟主机,其内容如下:http://198.199.125.69/christabellehotel.com
有用的信息:
# /usr/sbin/httpd -S
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
_default_:443 198.199.125.69 (/etc/httpd/conf.d/ssl.conf:74)
*:80 is a NameVirtualHost
default server christabellehotel.com (/etc/httpd/conf/httpd.conf:1023)
port 80 namevhost christabellehotel.com (/etc/httpd/conf/httpd.conf:1023)
alias www.christabellehotel.com
port 80 namevhost akteabeach.com (/etc/httpd/conf/httpd.conf:1034)
alias www.akteabeach.com
port 80 namevhost 198.199.125.69 (/etc/httpd/conf/httpd.conf:1044)语法确定
发布于 2013-04-06 20:49:15
接受第三个虚拟主机条目,将其移动到顶部,并将指令更改为
<VirtualHost 198.199.125.69:80>
发布于 2013-04-10 16:22:41
将NameVirtualHost *:80更改为NameVirtualHost *
https://serverfault.com/questions/496823
复制相似问题