Step-by-Step: Apache 2.0.35 - Changing the Port Number
April 28, 2002

Now let's change the port number that Apache listens to.  By default, Apache listens to port 80.  However, we can/must change this depending on whether we have access to port 80 or not.  In order to do this, we must once again edit the "httpd.conf" file.

Use "Find" to find "Listen 80".

Change this port number to the port that you'll be using on your webserver.  For this example, we'll use "8888".

No, we're not done quite yet.  Use "find" once again to look for "ServerName".  A few lines below, you should see the server name you entered during installation.  This is what I see.

At the end of your server name, change port 80 to 8888.

Now close the file, save the changes, and restart the Apache server.

Now bring up your web browser again and let's see if we can get to our website by entering "http://localhost" or "".  You should see a similar error message.

What happened?  Oh yeah, we changed the port number to 8888.  Okay, let's try "http://localhost:8888" or "" instead.

There you have it!

There are about a million more things you could customize with Apache, but you should now have a decent basis to start working with Apache.  Good luck!


Changing the Document Directory

Additional Information

Apache Info: