level 1
花果山上舞大虫
楼主
用的windows8 vmware搭建的一个ubuntu虚拟机
在ubuntu虚拟机里的apache服务器一共有两个网站
一个是:127.0.0.1(apache的默认页面)
另一个是:http://www.test.com
修改unbuntu虚拟机的hosts文件 加入 127.0.0.1 http://www.test.com
虚拟机访问http://www.test.com显示正常
那么,问题来了!
将windows主机下的8000端口映射到虚拟机的80端口
修改windows下的host文件加入 127.0.0.1 http://www.test.com
windows浏览器访问 http://www.test.com:8000 出现的是apache的默认页面 不是test页面
输入127.0.0.1:8000 出现的也是apache默认页面
想问问怎么才能在windows主机上成功访问虚拟机上的 http://www.test.com页面呢?
附上虚拟机里apache2的virtualhost配置:
<VirtualHost *:80>
ServerName karltest.com
ServerAdmin [email protected]
DocumentRoot /home/karlsohelloworld/karltest/
ErrorLog /home/karlsohelloworld/karlsotestlog/error.log
CustomLog /home/karlsohelloworld/karlsotestlog/access.log combined
ServerAlias http://www.karltest.com
<Directory /home/karlsohelloworld/karltest/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
-----------------------------------------------------------------------------------
求大神相助,纠结了好几天了
不甚感激
2015年02月24日 13点02分
1
在ubuntu虚拟机里的apache服务器一共有两个网站
一个是:127.0.0.1(apache的默认页面)
另一个是:http://www.test.com
修改unbuntu虚拟机的hosts文件 加入 127.0.0.1 http://www.test.com
虚拟机访问http://www.test.com显示正常
那么,问题来了!
将windows主机下的8000端口映射到虚拟机的80端口
修改windows下的host文件加入 127.0.0.1 http://www.test.com
windows浏览器访问 http://www.test.com:8000 出现的是apache的默认页面 不是test页面
输入127.0.0.1:8000 出现的也是apache默认页面
想问问怎么才能在windows主机上成功访问虚拟机上的 http://www.test.com页面呢?
附上虚拟机里apache2的virtualhost配置:
<VirtualHost *:80>
ServerName karltest.com
ServerAdmin [email protected]
DocumentRoot /home/karlsohelloworld/karltest/
ErrorLog /home/karlsohelloworld/karlsotestlog/error.log
CustomLog /home/karlsohelloworld/karlsotestlog/access.log combined
ServerAlias http://www.karltest.com
<Directory /home/karlsohelloworld/karltest/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
-----------------------------------------------------------------------------------
求大神相助,纠结了好几天了
不甚感激