Solved

VMware Fusion: accessing an Apache2.2.x Virtual host on Host Machine from WindowsXP guest machine

Posted on 2008-10-16
12
1,217 Views
Last Modified: 2012-05-05
Im running Apache2.2.x on OSx 10.5.5. Ive configured a couple virtual hosts;
local.clientname.com, clientname2.dev etc... and added them to the host file and
associated the to 172.0.0.1 and All works when accessing them from the mac.
 
But What I need to do is access then for the Guest Windows Machine via
http://local.clientname.com and so on. The closest Google search I could come
up with was from a drupal site[http://drupal.org/node/238805] that said to add
the NAT address given to the guest by VMWare to the Windows host file.
Like This,  172.16.110.123  local.clientname.com. This doesn't appear to do anything.
I still get this error:
From Firefox - can't establish a connection to the server at local.clientname.com.
from IE -The page cannot be displayed
The page you are looking for is currently unavailable.
The Web site might be experiencing technical difficulties,
or you may need to adjust your browser settings.


0
Comment
Question by:Scottshane
  • 7
  • 5
12 Comments
 
LVL 4

Expert Comment

by:michote
ID: 22736495
I would forget about the NAT mode, and use bridge networking. Assign the guest an empty ip on the same subnet as the host. Problem solved.

This is like if the guest was next to the host computer.
0
 
LVL 4

Expert Comment

by:michote
ID: 22736504
Because as you have it it seems that the NAT is introducing problems in your config.
0
 
LVL 1

Author Comment

by:Scottshane
ID: 22736692
I have all the confidence in the world that what you suggest will work flawlessly. But here the thing . I Use window for IE testing only. I don't know anything about windows networking so I would know were to start to "assigning an empty IP on the same subnet as the host"
0
 
LVL 4

Expert Comment

by:michote
ID: 22736728
very simple, look at your ip configuration in mac. In system preferences, Network.

Tell me what it says. for ethernet.
0
 
LVL 4

Expert Comment

by:michote
ID: 22736730
or aiport in case you are using a laptop wifi
0
 
LVL 1

Author Comment

by:Scottshane
ID: 22736752
ip:192.168.2.2
Subnet: 255.255.255.0
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 4

Expert Comment

by:michote
ID: 22736859
Okey, I am under the assumption there are no more computers in your network.

On turn off the vmachine guest. On settings for networks use bridged instead of nat.

Boot up the windows machine.

Go to control panel, Networks, Local Area connection

Select properties, Select TCP/IP press properties.(next to uninstall)

for Ip use 192.168.2.3 (3 can be any number from 3- 254 not 2 beucase it alredy in use by your mac)
subnet mask 255.255.255.0
Gateway: (what ever it says on router for your mac most probably 192.168.2.1 o 192.168.2.254)

DNS: again what ever it says on your DNS in the mac (usually the same as the router but check your mac)

That is it. Now your guest xp is in the same network as your mac. Browse to it by opening 192.168.2.2 in a browser. No more Nats to get in the way

Hope this solves your problem
0
 
LVL 1

Author Comment

by:Scottshane
ID: 22737079
after setting the window machine to a static IP i gliched the whole ntework. I lost internet access on mac and windows. had to restart every thing to get internet back on mac. window w/ static IP has no access. So I set it back to DHCP which basically does what you have above. either way still can resolve a http://local.clientname.com virtual host.

0
 
LVL 4

Expert Comment

by:michote
ID: 22737237
If you glithced you network then the 3 ip was in use, then use another. Any wya DHCP got it working

First of all, are you seeing yo mac from the pc. In explorer do http://192.168.2.2 see if you get the apache server.

If not do start run, type in cmd and enter. You'll get a black screen in a window with a prompt. type:
ping 192.168.2.2

If both test pass you are good. we can do the next step.
0
 
LVL 1

Author Comment

by:Scottshane
ID: 22737310
I use 9. checked the routers DCHP table to make sure and the only 2 IP were x.x.x.2(the mac of course) and x.x.x.6 another mac. So I used x.x.x.9.

I do see http://192.168.2 from IE. And for safety I pinged as you suggested and it's all good as well.

Also a bit more info.
On the mac the etc/host looks like this for the vhosts:
#########################

##Ive tried both, separately. and both work on mac/ neither on PC
#172.0.0.1      local.clientname.com
192.168.2.2    local.clientname.com

##########################
 
##httpd-vhosts.conf

<VirtualHost *:80>
    ServerAdmin admin@local.clientname.com
    DocumentRoot "/Users/username/Sites/local.clientname.com/www"
    ServerName local.clientname.com
    ErrorLog /private/var/log/apache2/local.clientname.com-error_log
    CustomLog /private/var/log/apache2/local.clientname.com-access_log common
      <Directory "/Users/username/Sites/local.clientname.com">
      Options Indexes FollowSymLinks MultiViews Includes
        AllowOverride All
        Order allow,deny
        Allow from all
        Deny from none
      </Directory>
</VirtualHost>

0
 
LVL 4

Accepted Solution

by:
michote earned 500 total points
ID: 22737341
Yep that is good and all you are on the same network

Woohoo

The final reason why the name in the url is not working is the following. In order to resolve names you need a DNS. Since you've stated this a test bench a dns would not be the best solution. So as you've discover on you mac you need to hardcode a host file. This takes the place of the DNS server for name resolving.

The final step is easy, you need to do this for your windows XP.

The file is located on c:\windows\system32\drivers\etc\
it is called hosts. Edit it as you did your mac file by adding the line

192.168.2.2 local.clientname.com

save it, and you are done.

WHoowhooo.
0
 
LVL 1

Author Closing Comment

by:Scottshane
ID: 31506926
Thanks a million. Works Perfectly. and I even learn a little about the Windows. Thanks again.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

HOW TO: Install and Configure VMware vSphere Hypervisor 6.5 (ESXi 6.5), Step by Step Tutorial with screenshots. From Download, Checking Media, to Completed Installation.
In this step by step tutorial with screenshots, we will show you HOW TO: Enable SSH Remote Access on a VMware vSphere Hypervisor 6.5 (ESXi 6.5). This is important if you need to enable SSH remote access for additional troubleshooting of the ESXi hos…
Teach the user how to rename, unmount, delete and upgrade VMFS datastores. Open vSphere Web Client: Rename VMFS and NFS datastores: Upgrade VMFS-3 volume to VMFS-5: Unmount VMFS datastore: Delete a VMFS datastore:
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now