views:

22305

answers:

11

During the installation of Apache2 I got the following message into cmd window:

Installing the Apache2.2 service The Apache2.2 service is successfully installed. Testing httpd.conf....

Errors reported here must be corrected before the service can be started. httpd.exe: Could not reliably determine the server's fully qualified domain name , using 192.168.1.3 for ServerName (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Note the errors or messages above, and press the key to exit. 24...

and after installing everything look fine, but it isn't. If I try to start service I got the following message:

Windows could not start the Apache2 on Local Computer. For more information, review the System Event Log. If this is a non-Micorsoft service, contact the service vendor, and refer to service-specific error code 1.

Apach2 version is 2.2.9

Does anyone have the same problem, or could help me.

+13  A: 

There is some other program listening on port 80, usual suspects are

  1. Skype (Listens on port 80)
  2. NOD32 (Add Apache to the IMON exceptions' list for it to allow apache to bind)
  3. Some other antivirus (Same as above)

Way to correct it is either shutting down the program that's using the port 80 or configure it to use a different port or configure Apache to listen on a different port with the Listen directive in httpd.conf. In the case of antivirus configure the antivirus to allow Apache to bind on the port you have chosen.

Way to diagnose which app, if any, has bound to port 80 is run the netstat with those options, look for :80 next to the local IP address (second column) and find the PID (last column). Then, on the task manager you can find which process has the PID you got in the previous step. (You might need to add the PID column on the task manager)

C:\Users\vinko>netstat -a -p tcp

Conexiones activas

  Proto  Dirección local          Dirección remota        Estado           PID
  TCP    127.0.0.1:1110         127.0.0.1:51373        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:51379        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:51381        ESTABLISHED     388
  TCP    127.0.0.1:1110         127.0.0.1:51382        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:51479        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:51481        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:51483        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:51485        ESTABLISHED     388
  TCP    127.0.0.1:1110         127.0.0.1:51487        TIME_WAIT       0
  TCP    127.0.0.1:1110         127.0.0.1:51489        ESTABLISHED     388
  TCP    127.0.0.1:51381        127.0.0.1:1110         ESTABLISHED     5168
  TCP    127.0.0.1:51485        127.0.0.1:1110         ESTABLISHED     5168
  TCP    127.0.0.1:51489        127.0.0.1:1110         ESTABLISHED     5168
  TCP    127.0.0.1:59264        127.0.0.1:59265        ESTABLISHED     5168
  TCP    127.0.0.1:59265        127.0.0.1:59264        ESTABLISHED     5168
  TCP    127.0.0.1:59268        127.0.0.1:59269        ESTABLISHED     5168
  TCP    127.0.0.1:59269        127.0.0.1:59268        ESTABLISHED     5168
  TCP    192.168.1.34:51278     192.168.1.33:445       ESTABLISHED     4
  TCP    192.168.1.34:51383     67.199.15.132:80       ESTABLISHED     388
  TCP    192.168.1.34:51486     66.102.9.18:80         ESTABLISHED     388
  TCP    192.168.1.34:51490     74.125.4.20:80         ESTABLISHED     388
Vinko Vrsalovic
tnx, Hvala Vinko ;)
vaske
Yes, I hate how Skype tries to use port 80... I sometimes forget to change it, and then when I try to test some web thing I've written, Apache won't start.
R. Bemrose
It looks like the one new nod32 problem :(
vaske
Add Apache to its exceptions list to allow it to bind to port 80
Vinko Vrsalovic
Believe of not it's a skype.
vaske
It might also be IIS (internet information services).
Bozho
+1  A: 

I had the same problem. I checked netstat, other processes running, firewall and changed httpd.conf, stopped antivirus, But all my efforts were in vain. :(

So finally the solution was to stop the IIS. And it worked :)

I guess IIS and apache cant work together. If anybody know any work around let us know.

see http://stackoverflow.com/questions/431041/apache-xamp-and-iis-cant-work-together#431062
gbjbaanb
uhhh... of course they can't work together if they're on the same port...
Charlie Somerville
and it shows in netstat output...
Vinko Vrsalovic
+2  A: 

Hello, the better way to resolve the issue is change the port number in Apache2\conf\httpd.conf . Change the port number as fallows::: Listen 8888 and ServerName machinename:8888 .Reinstall the Apache server after changing the port number.

A: 

Thanks for the help guys. I found another culprit. Recently SimplifyMedia added a photo sharing option. Apparently it too uses port 80 and prevented Apache from starting up. I hope this helps someone out.

A: 

Use Linux!!!!! It works But if you have to use windows, some application is using port 80.

Chris Karas
Yes, Linux is great, but "use Linux!" should not be a blanket answer to any question. You could be having the same problem on Linux, for example, if you had Apache and lighttpd installed.
icktoofay
A: 

I have the same problem. First I unistalled IIS. It did not help. When I turned off NOD and Skype I was able to run Apache. After opening NOD and Skype again everything was fine even when I restarted Apache while running NOD and Skype. When I changed httpd.conf and intended to restart Apache after that I recieved again .. unable to open logs .. ( exactly the same as in original post )

Any idea wtf is going on here?

beek
A: 

Me also coming the same problem. The solution is goto add or remove programes then click the turn windows features on or off. Turn off the IIS. That is turn off the 'Internet information services' and 'Internet information service removable web core'. I chosed the remaining features are on. Computer will ask to restart the system. Restart ur computer and then install the apache http server. I got it. Server succesfully working...

raajesh
A: 

Finally i found that adobe updater was using port 80!!!

iAndy
A: 

dude do one thing Remove Apache from control panel and Delete Apache folder from program files and restart machine ,install apache again .This will b solve problem if not do one thing Install IIS if not install then start IIS and stop it ....Using services start apache service ...enjoy apache

vijay
A: 

IIS and apache cant work together. If anybody know any work around let us know.

thanks...... user46795

my problem is solved

thanks again

humniz
A: 

In my case skype was listening at port 80. Thanks... you solved my problem :)

Maverickag