0

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)

lemon
  • 21
  • 1
  • 6

1 Answers1

0

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

gloom700
  • 116
  • 7