从 VM Virtual Box 查看多个 localhost Dev 网站项目以测试 IE 兼容性
我正在运行 Fedora 14,并且我的 localHost 中有各种 Web 开发项目。
我已经安装了VM VirtualBox并安装了windowsXP来测试我的项目的Internet Explorer兼容性问题。
我可以通过在 VirtualBox IE8 上输入笔记本电脑的 IP 地址来访问第一个本地主机网站项目,但我不知道如何访问 Fedora 本地主机下的其他项目。
我查了一下互联网,但发现它很混乱,而且我一直陷入困境。
这是我所拥有的:
1 -> sudo gedit /etc/hosts
127.0.0.1 localhost.localdomain localhost.localdomain localhost localhost4 www.smile www.intranet www.etrack manosLocal www.box
::1 localhost.localdomain localhost6.localdomain6 localhost6 localhost manosLocal
2 -> sudo gedit /etc/httpd/conf.d/vhosts.conf
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName www.smile
ServerAlias www.smile
DocumentRoot /repos/smile/trunk
ErrorLog /srv/www/logs/smile_error.log
CustomLog /srv/www/logs/smile_access.log combined <br />
</VirtualHost>
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName www.intranet
ServerAlias www.intranet
DocumentRoot /repos/intranet/trunk
ErrorLog /srv/www/logs/intranet_error.log
CustomLog /srv/www/logs/intranet_access.log combined <br />
</VirtualHost>
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName www.etrack
ServerAlias www.etrack
DocumentRoot /repos/etrack/trunk
ErrorLog /srv/www/logs/etrack_error.log
CustomLog /srv/www/logs/etrack_access.log combined <br />
</VirtualHost>
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName www.box
ServerAlias www.box
DocumentRoot /repos/box/trunk
ErrorLog /srv/www/logs/box_error.log
CustomLog /srv/www/logs/box_access.log combined <br />
</VirtualHost>
我的笔记本电脑 IP 地址是: ifconfig -> inet addr:192.168.1.57
当我启动 VirtualBox-WindowsXP 并在 IE8 中输入此 IP 地址时,我可以访问 Fedora LocalHost 的 www.smile
网站。 如果我更改 VirtualHosts 的顺序并重新启动 HTTPD 服务,那么我还可以访问我在顺序中放在第一位的本地主机。
我希望能够同时访问我的 Fedora 本地主机的所有虚拟主机,但我不知道该怎么做。
任何帮助将不胜感激。 马诺斯
I'm running Fedora 14 and I have various web-development projects in my localHost.
I have installed VM VirtualBox and installed windowsXP to test Internet Explorer compatibility issues of my projects.
I can access the 1st localhost website project by typing the IP address of my laptop on the VirtualBox IE8 but I don't know how to access the other projects under Fedora localhost.
I looked on the internet but I find it confusing and I keep getting stuck.
Here's what I have:
1 -> sudo gedit /etc/hosts
127.0.0.1 localhost.localdomain localhost.localdomain localhost localhost4 www.smile www.intranet www.etrack manosLocal www.box
::1 localhost.localdomain localhost6.localdomain6 localhost6 localhost manosLocal
2 -> sudo gedit /etc/httpd/conf.d/vhosts.conf
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName www.smile
ServerAlias www.smile
DocumentRoot /repos/smile/trunk
ErrorLog /srv/www/logs/smile_error.log
CustomLog /srv/www/logs/smile_access.log combined <br />
</VirtualHost>
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName www.intranet
ServerAlias www.intranet
DocumentRoot /repos/intranet/trunk
ErrorLog /srv/www/logs/intranet_error.log
CustomLog /srv/www/logs/intranet_access.log combined <br />
</VirtualHost>
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName www.etrack
ServerAlias www.etrack
DocumentRoot /repos/etrack/trunk
ErrorLog /srv/www/logs/etrack_error.log
CustomLog /srv/www/logs/etrack_access.log combined <br />
</VirtualHost>
<VirtualHost *:80>
ServerAdmin root@localhost
ServerName www.box
ServerAlias www.box
DocumentRoot /repos/box/trunk
ErrorLog /srv/www/logs/box_error.log
CustomLog /srv/www/logs/box_access.log combined <br />
</VirtualHost>
My Laptop IP address is:
ifconfig -> inet addr:192.168.1.57
When I start my VirtualBox-WindowsXP and type this IP address in IE8 I can access the www.smile
website of my Fedora LocalHost.
If I change the order of the VirtualHosts and restart the HTTPD service then I can also access whichever Localhost I put first in the order.
I want to be able to access all the VirtualHosts of my Fedora Localhost at the same time but I don't know how to do it.
Any help would be truly appreciated.
Manos
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明我只需要在virtualBox的Windows XP中配置主机文件即可。
然后将默认的
127.0.0.1 localhost
替换为
ifconfig
IP 地址以及我的所有 virtualHosts保存文件,重新启动 Internet Explorer 并输入上述任意地址:-)
完毕!
It turns out I just had to configure the host file in the Windows XP of the virtualBox.
Then replace the default
127.0.0.1 localhost
with the
ifconfig
IP address along with all my virtualHostsSave the file restart Internet Explorer and type any of the above addresses :-)
Done!