1 September 2013

Unable to start the Apache in XAMPP, throwing an error

Hi Friends.

Sometime we face the problem when we installed the XAMPP successfully but when we try to start he Apache using XAMPP control panel.  It throws an error

[Apache]    Error: Apache shutdown unexpectedly.
[Apache]    This may be due to a blocked port, missing dependencies, 
[Apache]    improper privileges, a crash, or a shutdown by another method.
[Apache]    Check the "/xampp/apache/logs/error.log" file
[Apache]    and the Windows Event Viewer for more clues

and if we try to start the Apache using the batch file we get the following error on cmd prompt.

(OS 10048) Only one usage of each socket address (protocol/network address/port)
is normally permitted.  : AH00072: make_sock: could not bind to address [::]:443

(OS 10048) Only one usage of each socket address (protocol/network address/port)
is normally permitted.  : AH00072: make_sock: could not bind to address 0.0.0.0:
443
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs

Apache konnte nicht gestartet werden
Apache could not be started
Press any key to continue . . .


Because Xampp starts the Apache at port:80 and for secure socket layer it reserve the port:443, if you are getting these error thats mean either port:80 or port:443 or both are used by some other application. Like if we are running IIS which by default use the port:80, if you are running VMWare that use the port:443 for secure connection.  To check it out which port is in used you can run the command

    netstat -aon

it will show you the result of the port used by other applications. see the output of above command in my system

Active Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       864
  TCP    0.0.0.0:443            0.0.0.0:0              LISTENING       2196   
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:902            0.0.0.0:0              LISTENING       1048
  TCP    0.0.0.0:912            0.0.0.0:0              LISTENING       1048
  TCP    0.0.0.0:1025           0.0.0.0:0              LISTENING       532
  TCP    0.0.0.0:1026           0.0.0.0:0              LISTENING       948
  TCP    0.0.0.0:1027           0.0.0.0:0              LISTENING       1036
  TCP    0.0.0.0:1028           0.0.0.0:0              LISTENING       652
  TCP    0.0.0.0:1029           0.0.0.0:0              LISTENING       592
  TCP    0.0.0.0:2861           0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:12025          0.0.0.0:0              LISTENING       1480
  TCP    0.0.0.0:12110          0.0.0.0:0              LISTENING       1480
  .........
  .........
  .........


see port:443 is in used by someother application, in my case as I'm running VMWare which is using this port. So when I try to start Apache it throws in error.

To run the apche you have to change the port in config file.

if port:80 in used

1.  Go to
    Xampp installed directory/Apache/conf
2.  open the file httpd.conf and search for the text "Listen 80", you
    will find the first occurrence around line no. (45-50) change this
    line port from 80 to 8080

   Listen 80 make it Listen 8080


save the file and now try to run Apache

if port:443 is used

1.  Go to
    Xampp installed directory/Apache/conf/extra
2.  open the file httpd-ssl.conf and search for the text "Listen 443",
    you will find the first occurrence around line no. (40-45) change
    this line port from 443 to 1443 (or any other not used port)

   Listen 443 make it Listen 1443

save the file and now try to run Apache

if both port in used, follow the above both file changes..

Remember now you have to open the url in browser would be 
 https://localhost:8080
as we have changed the port from '80' to '8080'

and now run the Apache .. 
Happy knowledge sharing.. :)


1 comment:

  1. I recently had the good fortune of reading your Post.
    It was well-written and I appreciate you.
    In fact, I look forward to reading your next informative work. Thank you.
    Please_Visit_My_Post!

    ReplyDelete