my problem is the following: I have an Oracle VM with debian on it running apache2. This apache shall handle two webservers, therefore my conf looks like this:

< VirtualHost *:80 > (no spaces, serverfault just shows it wrong without)

    ServerAdmin webmaster@localhost     ServerName site1.hostpc.domain.com  DocumentRoot /var/www/html/site1

    ErrorLog ${APACHE_LOG_DIR}/site1/error.log  CustomLog ${APACHE_LOG_DIR}/site1/access.log combined

< /Virtualhost >

< VirtualHost *:80 >

    ServerAdmin webmaster@localhost     ServerName site2.hostpc.domain.com  DocumentRoot /var/www/html/site2

    ErrorLog ${APACHE_LOG_DIR}/site2/error.log  CustomLog ${APACHE_LOG_DIR}/site2/access.log combined

< /Virtualhost >

where hostpc is the name of the hostpc and domain.com is the local domain.

I forwarded Port 80 through NAT from the VM to the host pc (TCP, guest port 80 -> host port 80)

So here is my problem now: when I go to site1.hostpc.domain.com or site2.hostpc.domain.com in the VM, the different websites are shown perfectly, but when I try to open site1.hostpc.domain.com or site2.hostpc.domain.com on my host PC it can't resolve the DNS of the website. When I open hostpc.domain.com it shows site1 just fine, but no way to get site2.

I've tried a lot, but I cannot get it running. (PS: I need to use NAT, Bridged network would disconnect my host PC from the network)


You should forward port 80 from host machine to port 80 of virtual machine. Make sure your host entries are correct

  • this is how my entries look like: i.epvpimg.com/Dnwic.png – lemon Sep 2 '16 at 7:15
  • Show me your host entry. It should be your-site-name – gloom700 Sep 2 '16 at 7:21
  • oh, forgot to say it has to be reached by the whole local network, so a local host entry wouldn't work. – lemon Sep 2 '16 at 7:23
  • Try local host entry and see if it works. I think you have DNS problem – gloom700 Sep 2 '16 at 7:26
  • Try disable firewall on virtual machine – gloom700 Sep 2 '16 at 7:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.