【发布时间】:2016-04-02 11:56:20
【问题描述】:
我在 centos 6,apache, 安装 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>
因此,当我转到 www.xxx.net 时,我得到了我的 index.html,它位于 /var/www/html/site 下,这就是我想要的但是当我将我的服务器 ip 作为 URL 时,服务器重定向我去 www.xxx.net。
我想将我的服务器 IP 点保留在 /var/www/html/index.html 上!!! 有什么解决办法吗?
【问题讨论】: