Hi there, I have an Apache 2.0 running on localhost. My default DocumentRoot is set to: DocumentRoot "H:/apache2.0/Apache2/htdocs"
I'm trying to use virtual hosting (for testing), and I've got the following settings: NameVirtualHost 127.0.0.1:80 <VirtualHost 127.0.0.1> DocumentRoot "c:/mywebpage" ServerName localhost </VirtualHost> Now when I type "http://localhost" in my browser, apache still serves the index page from the default DocumentRoot ! Why's this ?
Because you have a conflict between the virtual host and the default host - you're giving them both the same URL! A more realistic setup would be to do: <VirtualHost 127.0.0.1:8080> in order to see the alternate (virtual) host as http://localhost:8080. This requires that you tell Apache it's OK to serve out of port 8080 in addition to port 80. The other use of VirtualHost is to access under a different domain, like so: <VirtualHost www.mydomain.com> <VirtualHost info.mydomain.com> <VirtualHost www.otherdomain.net> Which provides 4 total host URLs - the default + http://www.mydomain.com,http://info.mydomain.com, and http://www.otherdomain.net.
Customer surveys are for companies who didn't pay proper attention to begin with.
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
cool .. thanks a lot !
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.