My webserver structure is as follows:
/srv/www/htdocs - index.html displays It Works!
/srv/www/htdocs/website1 - index.html displays website1’s home page.
/srv/www/htdocs/website2 - index.html displays website2’s home page
My webserver resides within the internal network (not dmz). When using a client computer connected to the internal network, I type http://192.168.1.50 into the browser and the home page for website2 is displayed. I have a feeling that only the first vhosts.conf file is being looked at by apache when it serves the page.
Is the only answer here to use anonymous proxy surfing to come into my server from “outside”? It would be much easier to develop my particular sites via a web browser on the internal network as I am using Joomla! to host my sites. Should I somehow configure my Windows DNS server to handle this properly?
Usually the solution is to use split DNS where the same name, e.g. website1.example.com resolves to an external address on the outside and to an internal IP address on the inside. This requires entering the names in the internal DNS server.
One trick you can do is to use a partial domain name on the inside and make sure this resolves, for example, use just http://website1/index.html. In the ServerAlias line, add website1 to the list of alternate names for the virtual site.
Ok, so here is what I came up with. I created 2 new zones on my Windows DNS server and added an A-record for each new zone pointing to the IP address of the webserver.
It’s working perfectly now. I can get to both domains from an internal source without any errors. I can always use the anonymous proxy surfing to test my site externally.
It’s time to work on the web content now that the infrastructure is complete! Finally!