Discussion:
Accessing site on VM
(too old to reply)
Seven Corners
2012-07-23 20:53:30 UTC
Permalink
I have a Windows host and a Ubuntu Linux VirtualBox VM, and several websites on the VM. I need to access the various sites from Windows so I can test their CSS under IE. I have configured the VM network connection to be host-only. I have gotten the IP address of the VM eth0 through ifconfig, and am able to ping it and get a response. When I input that value in the host's IE address bar, I do get the default Apache "It Works!" page.

However, I can't figure out how to get to the virtual address of any of my sites. Within the Linux /etc/hosts file, they have a standard configuration, i.e. (names changed to protect the company),

***@my-ubuntu-vm$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 my-ubuntu-vm

127.0.0.30 site1.com
127.0.0.31 site2.com
127.0.0.33 site3.com

/etc/apache2/sites-enabled contains this list:

***@my-ubuntu-vm:~$ ls -l /etc/apache2/sites-enabled/
total 40
lrwxrwxrwx 1 root root 26 2012-07-23 15:27 000-default -> ../sites-available/default
lrwxrwxrwx 1 root root 42 2012-07-12 10:41 site1.com -> ../sites-available/site1.com
lrwxrwxrwx 1 root root 46 2012-05-24 03:45 site2.com -> ../sites-available/site2.com
...
***@my-ubuntu-vm:~$

and a typical vhost file would look like this:

<VirtualHost 127.0.0.31>
ServerName site2.com
DocumentRoot /me/RubymineProjects/site1/public
CustomLog /var/log/apache2/site2.com-access.log combined
</VirtualHost>

On the Windows side, you can't ping the site from its server name. You can't find it by putting the server name in the browser.

I understand I probably need to set something up on the Windows side so its hosts file knows where to find the site but I have no idea what to do. Any ideas?
Seven Corners
2012-07-23 21:05:11 UTC
Permalink
Post by Seven Corners
ServerName site2.com
DocumentRoot /me/RubymineProjects/site1/public
CustomLog /var/log/apache2/site2.com-access.log combined
I have a Windows host and a Ubuntu Linux VirtualBox VM, and several websites on the VM. I need to access the various sites from Windows so I can test their CSS under IE. I have configured the VM network connection to be host-only. I have gotten the IP address of the VM eth0 through ifconfig, and am able to ping it and get a response. When I input that value in the host&#39;s IE address bar, I do get the default Apache &quot;It Works!&quot; page.
However, I can&#39;t figure out how to get to the virtual address of any of my sites. Within the Linux /etc/hosts file, they have a standard configuration, i.e. (names changed to protect the company),
127.0.0.1 localhost
127.0.1.1 my-ubuntu-vm
127.0.0.30 site1.com
127.0.0.31 site2.com
127.0.0.33 site3.com
total 40
...
ServerName site2.com
DocumentRoot /me/RubymineProjects/site1/public
CustomLog /var/log/apache2/site2.com-access.log combined
On the Windows side, you can&#39;t ping the site from its server name. You can&#39;t find it by putting the server name in the browser.
I understand I probably need to set something up on the Windows side so its hosts file knows where to find the site but I have no idea what to do. Any ideas?
Continue reading on narkive:
Loading...