从 VM Virtual Box 查看多个 localhost Dev 网站项目以测试 IE 兼容性

发布于 2024-12-04 11:38:46 字数 2179 浏览 1 评论 0原文

我正在运行 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱已欠费 2024-12-11 11:38:46

事实证明我只需要在virtualBox的Windows XP中配置主机文件即可。

c:\WINDOWS\system32\drivers\etc\hosts

然后将默认的 127.0.0.1 localhost 替换

ifconfig IP 地址以及我的所有 virtualHosts

192.168.1.57    localhost    www.smile    www.intranet    www.box    www.etrack

保存文件,重新启动 Internet Explorer 并输入上述任意地址:-)
完毕!

It turns out I just had to configure the host file in the Windows XP of the virtualBox.

c:\WINDOWS\system32\drivers\etc\hosts

Then replace the default 127.0.0.1 localhost

with the ifconfig IP address along with all my virtualHosts

192.168.1.57    localhost    www.smile    www.intranet    www.box    www.etrack

Save the file restart Internet Explorer and type any of the above addresses :-)
Done!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文