开发者

View Multiple localhost Dev website projects from VM Virtual Box to test IE compatibility

开发者 https://www.devze.com 2023-04-04 00:11 出处:网络
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 project

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_acce开发者_如何学运维ss.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


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!

0

精彩评论

暂无评论...
验证码 换一张
取 消