Sathishkumar Sathishkumar - 10 months ago 106
Apache Configuration Question

How to change XAMPP apache server port?

This is my Apache httpd.conf settings :

Listen 8012
ServerName localhost:8012

Every time I start Apache via
I see this message:

Status Check OK
Apache Started [Port 80]

Anybody, please help me can I change any other settings ?

Answer Source

To answer the original question :

To change the XAMPP Apache server port here the procedure :

1. Choose a free port number

Take a look to all your used ports with Netstat (integrated to XAMPP).

Screenshot of xampp control netstat

Then you can see all used ports and here we see that the 80port is already used by the System.

screenshot netstat port 80

Choose a free port number (8012, for this exemple).

2. Edit the file "http.conf"

This file should be found in C:\xampp\apache\conf on Windows or in bin/apache for Linux.

Locate the following lines :

Listen 80
ServerName localhost:80

Replace them by :

Listen 8012
ServerName localhost:8012

Save the file.

Access to : http://localhost:8012 for check if it's work.

If not, you must to edit the http-ssl.conf file. See step 3 below.

3. Edit the file "http-ssl.conf"

This file should be found in C:\xampp\apache\conf\extra on Windows or see this link for Linux.

Locate the following lines :

Listen 443
<VirtualHost _default_:443>
ServerName localhost:433

Replace them by with a other port number (8013 for this example) :

Listen 8013`
<VirtualHost _default_:8013>`
ServerName` or  `ServerName localhost:8013`

Save the file.

Restart the Apache Server.

Access to : http://localhost:8012 for check if it's work.

4. Configure XAMPP Apache server settings

If your want to access localhost without specify the port number in the URL
http://localhost instead of http://localhost:8012.

  • Open Xampp Control Panel
  • Go to ConfigService and Port SettingsApache
  • Replace the Main Port and SSL Port values ​​with those chosen (8012 and 8013 for this example).
  • Save Service settings
  • Save Configuration of Control Panel
  • Restart the Apache Server xampp apache setting port It should work now.

To answer your problem :

If you still have this message in Control Panel Console :

Apache Started [Port 80]

  • Find location of xampp-control.exe file
  • Create a file XAMPP.INI in that directory (so XAMPP.ini and xampp-control.exe are in the same directory)
  • Put following lines in the XAMPP.INI file:

    apache = 8012

Now , you will always get :

Apache started [Port 8012]

Please note that, this is for display purpose only. It has no relation with your httpd.conf.