Recently my XAMPP install in Windows 10 started showing an Apache error “Apache WILL NOT start without the configured ports free!”. In my case another service is now using port 80 (happens to be a Microsoft service) which is the default port for Apache which is causing this error.
In this how to we’ll cover changing your Apache listen port from port 80 to fix that problem.
- Open the XAMPP control panel, stop all running modules.
- Click the “Config” button for the Apache module and select “Apache (httpd.conf)”.
- Alternately you can open the file located in your XAMPP install folder “/apache/conf/httpd.conf” with a different text editor.
- Find the following line around line 58 in the file. Port 80 is the default listen port for Apache.
- Change it to another port number not in use, for this example we’ll change it to port 8080.
- Find the following line around line 225 in the same file. The ServerName variable is used to give the server a name and port to identify itself with.
- Replace it with the same port number you used in step 4.
- Save the conf file and in the XAMPP control panel click “Config” and “Service and Port Settings”. Change the “Main Port” under the Apache tab to the port set in step 4.
- At this point you shouldn’t see any port errors and can start the Apache module again.
- Open your browser and navigate to “localhost:8080” where you should now see the XAMPP dashboard or click on “Admin” in the XAMPP control panel.
If you need to change the ports for a https connection change the same settings in the “httpd-ssl.conf” file.