Change default Apache port

Default Apache port number is 80, means that you can access your local web server at localhost:80. What if you want to change this number? Follow the steps below, where we are changing our port to 8010.

In Linux/Mac, open /etc/apache2/ports.conf with your favorite text editor and change the following:

NameVirtualHost *:8010
Listen :8010

You might also need to open /etc/apache2/sites-enabled/<your default file> and change the following:

<VirtualHost *:8010>

In Windows, look for httpd.conf (for example, if you are using Xampp, open .\xampp\apache\conf\httpd.conf) and change the following:

Listen 8010

Restart your server and browse your local site with the new port.

Comments are closed.