Stephen A. Fuqua (SAF) is a Bahá'í, software developer, and conservation and interfaith advocate in the DFW area of Texas.

Configuring Apache (Wamp) With Additional Ports

August 22, 2008

Years ago I knew how to configure the Apache webserver, back when I was a grad student / Linux admin. As any reader will have figured out, I've been a Microsoft-centric programmer for a number of years now. Thus it is not surprised that I would have forgotten some basics about Apache.

I wanted to re-setup a WAMP environment in XP sp3 and had just downloaded WAMPServer2. I desired to setup a root folder on the primary port and add two more ports so that I could have "virtual directories" without the directory (i.e. instead of http://localhost/something, where the pages in /something have stylesheet references to /, use http://localhost:81).

Just set up the VirtualHost section, right? (Like this guy says). Well, that didn't work.

Scrolling through the httpd.conf, I found another possibility: apparently now (or has it always been this way?) you must explicitly set Apache to listen on the particular port. Thus I now have the following Listen section:

# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
# Change this to Listen on specific IP addresses as shown below to 
# prevent Apache from glomming onto all bound IP addresses.
Listen 80
Listen 81 ← New
Listen 82 ← New

That did the trick :-).