XAMPP Change Port for HTTP Requests with Apache

XAMPP uses the standard ports of 80 and 443 for HTTP and HTTPS traffic. These ports can be changed through a few configuration file changes.

Typically XAMPP traffic is used just through HTTP and thus there may not be a need to change the HTTPS settings. But this tutorial will show how to change both.

For the sake of this tutorial, the default port of 80 will be changed to 8080.

HTTPHTTPS
Default Values80443
Changed Values for Tutorial8080444
How to change the HTTP and HTTPS port in XAMPP for Apache

XAMPP Configuration

  1. Open XAMPP
  2. In the XAMPP Control Panel, click the Config button in the top right corner
Click the Config button in the XAMPP Control Panel
  1. Click the Service and Port Settings button.
Click the Service and Port Settings button
  1. On the Apache tab, change the Main Port and SSL Port settings as needed.
Change the port settings for XAMPP HTTP requests in Apache
  1. Click the Save button on the two open windows to get back to the main Control Panel window.
  2. Under the Apache line on the main Control Panel window, click the Config button and choose Apache (httpd.conf). This will open a configuration file in Notepad.
  3. Scroll down to line Listen 80
HTTP port configuration in http.conf
  1. Change this to the desired port (ie. 8080).
  2. Scroll down to line ServerName localhost:80
ServerName port configuration in http.conf
  1. Save the file in Notepad. Notepad can now be closed.
  2. Under the Apache line on the main Control Panel window, click the Config button and choose Apache (httpd-ssl.conf). This will open a configuration file in Notepad.
  3. Scroll down to line Listen 443
HTTP port configuration in http-ssl.conf
  1. Change this to the desired port (ie. 444).
  2. Save the file in Notepad. Notepad can now be closed.
  3. In the main XAMPP Control Panel, restart Apache by clicking the Stop and then Start button.

That is all it takes to change the ports in XAMPP for HTTP and HTTPS. Now you can access the websites with the new ports by adding :<port> at the end of the domain name. (ie. http://127.0.0.1:8080)