Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting apache fails (could not bind to address 0.0.0.0:80)

Update: Already fixed, it seems that one of VirtualHosts configurations files was wrong in sites-enabled.

I have Ubuntu 11.10

When I run the command to start apache2:

sudo /etc/init.d/apache2 start 

I get the following error message:

Starting web server apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Action 'start' failed.

I run this command in order to get the process that is using the port 80:

sudo netstat -ltnp | grep ':80' 

Which returns this output:

tcp6       0      0 :::80                   :::*                    LISTEN      1176/ 

To know which process is I run this command:

ps -wlp1176 

That returns:

F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD 5 D    33  1176     1  0  80   0 -     0 exit   ?        00:00:00 apache2 

But if I try to kill the process:

sudo kill -9 1176 

It doesn't kill it, if I run again the netstat command still appears listening and apache start fails.

Any suggestions?

like image 252
rfc1484 Avatar asked Apr 15 '12 07:04

rfc1484


People also ask

Could not bind to address 80 Apache Windows?

The error is because of port conflict. The Apache is trying to start on port 80, however the port 80 is being used or blocked by another application or server. When two or more applications are trying to use the same port its called as port conflict. Check the process that is using the port 80.

What is AH00072?

An Apache AH00072: make_sock: could not bind to address error message is generated when there is another process listening on the same port that Apache is configured to use. Typically the port will be the standard port 80 for HTTP connections, or port 443 for HTTPS connections.

How do I fix my AH00558?

To resolve an AH00558: Could not reliably determine the server's fully qualified domain name error message, you will need to add a ServerName directive to your Apache configuration.


2 Answers

Worked for me running this command:

fuser -k -n tcp 80 
like image 190
StandDuPp Avatar answered Sep 20 '22 17:09

StandDuPp


It may be skype or nginx using the port 80.

Try shutting down skype, or running: sudo /etc/init.d/nginx stop

like image 24
Benjamin Crouzier Avatar answered Sep 16 '22 17:09

Benjamin Crouzier