Last week I have encountered a server with its http port 80 already taken by another software. The “culprit” was unsurprisingly another web server software, the IIS. Because the IIS users are already accustomed to the default port, the Apache installation had no choice but to use a less popular port for http, in this case case port 81.
If you are new to Apache, please checkout this simple guide on how to install Apache using XAMPP.
You might ask Why is port 80 important for http? Well, for one, it is the ease of use for the users. If you are browsing a web server with a port other than port 80, you will need to browse it with an address along with the port.
Something like this: http://yourdomain.com:81/ if port 81 is your web server’s port. If you use port 80 then you won’t have to type in port 80 on the address since it is the standard port used in http and https. According to http://www.tcpipguide.com
“To avoid chaos, the software that implements a particular server process normally uses the same reserved port number on every IP device, so clients can find it easily… Every Web browser just “knows” that Web sites are designed to listen for requests sent to port 80”.
So having that fact settled, let’s see how we can change the port of our Apache setup. First look for the httpd.conf file inside the Apache > conf folder.
httpd.conf is a text file used by all Apache implementations so changing a Unix Apache and Windows Apache is done the same way – thru this config file. Open the file using your favorite text editor and look for the line with “Listen 80”:
This line defines Apache to listen to port 80. All you have to do is change that port 80 to any port that you want to use. Make sure that the port that you will use is a free port and not already taken by other services. Read our guide about a free port scanner if you are not sure.
Once you have edited the file, save it and restart Apache. To test if you already are using the new port browse the URL with the port you have used. For example, if you entered port 81 as the new port, the new URL should be http://yourdomain:81
Ben Carigtan shows you how it’s done!







Be The First To Comment
Please Leave Your Comments Below