Apachevhost,丢失defaut路由

Apachevhost,丢失defaut路由,apache,routing,vhosts,Apache,Routing,Vhosts,我在centos 6上,阿帕奇, 安装apache之后,当我以URL形式键入服务器时,我会得到index.html,它位于/var/www/html下 现在我开始使用VirtualHost,这是我的配置: VirtualHost *:80> ServerAdmin xxx@xxx.com DocumentRoot /var/www/html/site ServerName www.xxx.net ServerAlias xxx.net Er

我在centos 6上,阿帕奇, 安装apache之后,当我以URL形式键入服务器时,我会得到index.html,它位于/var/www/html下

现在我开始使用VirtualHost,这是我的配置:

VirtualHost *:80>
     ServerAdmin xxx@xxx.com
     DocumentRoot /var/www/html/site
     ServerName www.xxx.net
     ServerAlias xxx.net
     ErrorLog /var/log/httpd/site/error.log
     CustomLog /var/log/httpd/site/out.log common
</VirtualHost>
VirtualHost*:80>
服务器管理员xxx@xxx.com
DocumentRoot/var/www/html/site
服务器名www.xxx.net
服务器别名xxx.net
ErrorLog/var/log/httpd/site/error.log
CustomLog/var/log/httpd/site/out.log公共
因此,当我转到www.xxx.net时,我会得到index.html,它位于/var/www/html/site下,这就是我想要的,但当我转到服务器ip作为URL时,服务器会将我重定向到www.xxx.net

我想把我的服务器ip点保持在/var/www/html/index.html上!!!
有什么解决办法吗?

所以我经过一些测试后得到了它, 独奏: 取消此行的注释

#NameVirtualHost *:80
并为默认路由配置添加一个新的VirtualHost,如下所示:

<VirtualHost *:80>
     ServerAdmin xx@xxx.com
     DocumentRoot /var/www/html
     ServerName 212.212.212.212
     ServerAlias 212.212.212.212
     ErrorLog /var/log/httpd/gobal/error.log
     CustomLog /var/log/httpd/gobal/out.log common
</VirtualHost>

服务器管理员xx@xxx.com
DocumentRoot/var/www/html
服务器名212.212.212.212
服务器别名212.212.212.212
ErrorLog/var/log/httpd/gobal/error.log
CustomLog/var/log/httpd/gobal/out.log公共