I decided to revisit one of my older posts; Setting Up Multiple Apache Local Web Sites On Your Computer; which was written as a guideline for Apache 1.3.x for both Linux and Windows machines.
I’ve always used Apache 1.3.x for my web development needs (yeah, I’m old school), but this time around though, I need to get some testing done Apache 2.0.x because it’s what one of the server I’m developing for runs.
After downloading the necessary Windows installer for Apache 2.0.x (yes, I’m assigned a Windows XP notebook at work) one thing I discovered almost immediately is that the tips I’ve mentioned in my earlier post doesn’t work on Apache 2.0.x right off the bat.
After reading some of the comments in my original post, as well as reading through the Apache 2.0 manual, and bouts of experimenting I found out that the following changes are necessary for VirtualHosts to work properly:
- Define the
NameVirtualHost 127.0.0.1:*directive: If this line is commented or non-existant in httpd.conf, your local VirtualHosts won’t work - Include the hostname in the VirtualHost container. For example:
<VirtualHost localtest>. If you want the VirtualHost to listen to other ports, use this example (of listening to port 8080):<VirtualHost localtest:8080>
That’s pretty much it. Migrating my Apache 1.3.x sites to Apache 2.0.x was a breeze.










September 19th, 2007 at 2:51 pm
[...] Update: This guide is for Apache 1.3.x. To get local VirtualHosts to work with Apache 2.0.x, please click here. [...]
September 25th, 2007 at 3:25 pm
I want to have multiple web pages being served under apache 2.2 but everything I’ve tried to do with httpd seems not to work 403 error denied on the site or just serves the orginal page. This includes your advice on how to do this also. Can you help me resolve this problem please. I can email you my httpd to look at if it helps. Thanks for your time Phillip
March 9th, 2008 at 1:25 am
To Phillip: Try checking your firewall settings and make sure you have port 80 open. I had problems with 403 error even trying to connect to localhost as well as other computers on the network (Windows).
March 9th, 2008 at 1:26 am
To Phillip: Little late but might help other people. Try checking your firewall settings and make sure you have port 80 open. I had problems with 403 error even trying to connect to localhost as well as other computers on the network (Windows).
June 14th, 2008 at 8:20 am
I run Apache 2.0 on Windows XP and I don’t have to do either of those. I just do this:
ServerName …
And it seems to work just fine.