ubutu 12.04 apache 2.4.12
在 http-vhost.conf添加虚拟主机无法访问
配置文件如下:
<VirtualHost *:80>
DocumentRoot "/home/test"
ServerName test.develop
ErrorLog "logs/dummy-host.example.com-error_log"
CustomLog "logs/dummy-host.example.com-access_log" common
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/home/test1/"
ServerName test1.develop
ErrorLog "logs/test1-error_log"
CustomLog "logs/test1-access_log
</VirtualHost>
在本地添加hosts
test.develop 192.168.9.209
test1.develop 192.168.9.209
question :
1.访问ip显示第一个虚拟机
2.域名访问都不能访问
防火墙,selinix 都已经关闭了。是不是自己在设置的时候忘记了什么,求大神指教
1.首先回答关于设置NameVirtualHost *:80的问题,不用设置。
2.再使用ServerName访问页面的时候,要加上http://,才能被访问到。
比如:http://test1.develop或者是http://test.develop
这样才能够访问到不同的页面。
3.当访问192.168.9.209 的时候确实后优先访问第一个页面(如上的http://test.develop)。