Fix XAMPP Apache Not Starting Because Port 80 In Use & Busy

The most common cause for the XAMPP Apache server not starting issue is because the default port no 80 may already be in use by another program like Skype, Teamviewer etc.  For example, in my previous blog post with the solution for XAMPP and Windows User Account Control warning message issue, Mr. Shankar Paul said his new XAMPP Apache was not working. He had got the below message from XAMPP which says the Port 80 in use by another program. 

————————-
I can not start Apache because of the problem mentioned below.
I can not understand how to solve it. Any body help me, please.
3:07:06 PM [main] Initializing Control Panel
3:07:06 PM [main] Windows Version: Windows 7 Ultimate 32-bit
3:07:06 PM [main] XAMPP Version: 1.8.3
3:07:06 PM [main] Control Panel Version: 3.2.1 [ Compiled: May 7th 2013 ]
3:07:06 PM [main] You are not running with administrator rights! This will work for
3:07:06 PM [main] most application stuff but whenever you do something with services
3:07:06 PM [main] there will be a security dialogue or things will break! So think
3:07:06 PM [main] about running this application with administrator rights!
3:07:06 PM [main] XAMPP Installation Directory: “c:\xampp\”
3:07:06 PM [main] Checking for prerequisites
3:07:07 PM [main] All prerequisites found
3:07:07 PM [main] Initializing Modules
3:07:07 PM [Apache] Problem detected!
3:07:07 PM [Apache] Port 80 in use by “Unable to open process” with PID 4!
3:07:07 PM [Apache] Apache WILL NOT start without the configured ports free!
3:07:07 PM [Apache] You need to uninstall/disable/reconfigure the blocking application
3:07:07 PM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
3:07:07 PM [main] Starting Check-Timer
3:07:07 PM [main] Control Panel Ready
3:08:54 PM [Apache] Problem detected!
3:08:54 PM [Apache] Port 80 in use by “Unable to open process” with PID 4!
3:08:54 PM [Apache] Apache WILL NOT start without the configured ports free!
3:08:54 PM [Apache] You need to uninstall/disable/reconfigure the blocking application
3:08:54 PM [Apache] or reconfigure Apache and the Control Panel to listen on a different port
3:08:54 PM [Apache] Attempting to start Apache app…
3:08:54 PM [Apache] Status change detected: running
3:08:56 PM [Apache] Status change detected: stopped
3:08:56 PM [Apache] Error: Apache shutdown unexpectedly.
3:08:56 PM [Apache] This may be due to a blocked port, missing dependencies,
3:08:56 PM [Apache] improper privileges, a crash, or a shutdown by another method.
3:08:56 PM [Apache] Press the Logs button to view error logs and check
3:08:56 PM [Apache] the Windows Event Viewer for more clues
3:08:56 PM [Apache] If you need more help, copy and post this
3:08:56 PM [Apache] entire log window on the forums
————————-

Solutions 1: Stop Conflicting Program And Start XAMPP Apache Server

If you carefully read this XAMPP message, you’ll see they give a solution – to uninstall/disable or reconfigure the blocking program. For example most common programs for Apache not starting is Skype. If that is the case quit/stop Skype and run Apache and see. I have also heard other programs like Teamviewer, Microsoft Internet Server etc. also use port 80 and block Apache from starting.
However this is not best solution. If today one program is blocking Apache from starting up, tomorrow another program (or even a service like windows web publishing service etc.) can use the same port and block Apache from running.

Solutions 2: Change Default Port 80,443 of XAMPP Apache Server

So, the best solution like EL.Web.ID and Geethika says, is to reconfigure the XAMPP Apache server to listen and use different port numbers. Here is how you do it:
1) First, you need to open the Apache “httpd.conf” file and configure it to use/listen on a new port no.
setup xampp apache
To open httpd.conf file, click the “Config” button next to Apache “Start” and “Admin” buttons. In the popup menu that opens, click and open httpd.conf
2) Within the httpd.conf file search for “listen”. You’ll find two rows with something like;
#Listen 12.34.56.78:80
Listen 80
Change the port no to a port no. of your choice (e.g. port 1234) like below
#Listen 12.34.56.78:1234
Listen 1234
3) Next, in the same httpd.conf file look for “ServerName localhost:” Set it to the new port no.
ServerName localhost:1234
4) Save and close the httpd.conf file.
5) Now click the Apache config button again and open the “httpd-ssl.conf” file.
6) In the httpd-ssl.conf file, look for “Listen” again. You may find:
Listen 443
Change it to listen on a new port no of your choice. Say like:
Listen 1443
7) In the same httpd-ssl.conf file find another line that says, “<VirtualHost _default_:443>”. Change this to your new port no. (like 1443)
7) Also in the same httpd-ssl.conf you can find another line defining the port no. For that look for “ServerName”. you might find something like:
ServerName www.example.com:443 or  ServerName localhost:433
Change this ServerName to your new port no.
8) Save and close the httpd-ssl.conf file.
9) Finally, there’s just one more place you should change the port no. For that, click and open the “Config” button of your XAMPP Control Panel. Then click the, “Service and Port Settings” button. Within it, click the “Apache” tab and enter and save the new port nos in the “main port” and “SSL port” boxes. Click save and close the config boxes.
That should do the trick. Now “Start” Apache and if everything goes well, your Apache server should start up.
You will also see the Apache Port/s no in the XAMPP control panel has change to the new port IDs you set :)
Using XAMPP Apache Server After Port No. Change If you follow solution 2 and change the Apache port no, you will have to append the new port number to the URL when you connect to the Apache server. For example, previously if you typed localhost, you will now have to type localhost:1234.
Post a Comment
Thanks for your comment
Powered by Blogger.



close