I am running 64bit Ubuntu 9.04 Server, in Virtual Box. I have installed the LAMP stack, and I am having a hard time getting VirtualHosts to work. I have given the VM it's own static IP address (192.168.1.105) and I have given it the hostname "LAMPVM" via my router, and when I try to access it from my browser it only goes to 1 domain at a time.
I have "vhost_alias" & "rewrite" enabled.
I have my /etc/apache2/httpd.conf setup as follows:
I have the following sites-enabled:
Allow from all
ServerAlias localhost *.localhost
ServerAlias test1 *.test1
And I enter "LAMPVM" into my browser it only goes to the most recent domain I added (test2).
ServerAlias test2 *.test2
If I enter "test1.LAMPVM" into my browser it doesn't find the address.
I realize this is because my DNS on my browsers machine (not the VM) is not configured to recognize what "test1.LAMPVM" means. But when I enter the following into my /etc/hosts file:
By browser goes to the address "test2.lampvm", but it thinks "test1.lampvm" is the same as "test2.lampvm" (or "test1.lampvm" is being routed to the most recently added domain [which happens to be test2]).
Again, I kinda get why this isn't working because both "test1.lampvm" and "test2.lampvm" are pointing to the same address (192.168.1.105), but that is the address of the VM, and I don't know how else to get access to multiple domains on the same VM/IP?
My guess is I probably need to make some adjustments in my Router, but not sure exactly what?
Any/All Help, Comments, Suggestions will be greatly appreciated.