How to change Apache Server localhost port number from 80 to 8080?

How to change Apache Server localhost port number from 80 to 8080

How to change Apache Server localhost port number from 80 to 8080?
There are situations when you might need to change the default port number used by Apache (port number 80) to something else, say 8080 or 81. Such situations are like when you have Internet Information Services (IIS) running on the same machine etc. If IIS is required, keep it as it is and change the default port for Apache to listen to.

Steps to change the Apache’s port number:

  • Go to the path where Apache is installed.
  • From a local development computer running WAMPSERVER the location is C:\wamp\bin\apache\apache2.4.9\conf”
  • Open the “httpd.conf” file in a file editor such as Notepad or Notepad ++
  • It might be more readable to open the httpd.conf file in Notepad++ instead of Notepad.
  • Find the following and change from 80 to 8080
Find:
Listen 0.0.0.0:80
Listen [::0]:80


Change to:
Listen 0.0.0.0:8080
Listen [::0]:8080

  • After making the change, save the file
  • Restart Apache Services
That’s it.

Now you can access localhost using “http:localhost:8080” in your browser’s address bar. Using only “http://localhost” still will not work if it is already used by other services such as IIS.

No comments