0

Surely I know that same question is already posted here. However, when I searched it, the status is different from mine and I cannot understand the answers. Therefore I post my problem here. Sorry for duplicating issues.

My homepage suddenly doesn't work and I found out that it failed to start httpd service. Following image is the result when I command 'sudo service httpd start'

Starting httpd: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015: Unable to open logs [FAILED]

restart doesn't work also.

$ sudo service httpd restart
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015: Unable to open logs [FAILED]

What should I do to restart httpd service and revive my homepage?

martian03
  • 147
  • 1
  • 4
  • Seemed like a dupe, but couldn't quickly find another question with the same exact problem (most seem to be running the script directly from `/etc/init.d`). Therefore, answering instead of flagging. – andrewgu Oct 10 '17 at 03:53
  • see what PID is running on port 80 already and kill it. `sudo kill $(netstat -lntp | egrep ':80' | awk '{print $NF}' | cut -d '/' -f1 | sort -u) && sudo start httpd` – salparadise Oct 10 '17 at 04:27
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. – jww Oct 10 '17 at 19:09

4 Answers4

1

Error 98 usually occurs when some webserver is using the port, here 80, or The clean release port/address was not done.

If port is being used by other webserver, shutdown the server. You can find out which service is using port 80 by

netstat -pan |grep 80

and then shutdown the service.

If the port was not released upon unclean shutdown of server, then

sudo service networking restart

to release address/port combination from bind. This usually fixes error 98 for me.

dlmeetei
  • 9,905
  • 3
  • 31
  • 38
1

I have the same problem. So i looked to netstat:

sudo netstat -tulpn | grep :80

and received:

tcp6       0      0 :::80                   :::*                    LISTEN      7836/docker-proxy

after killing process:

sudo kill 7836 
Sergey Pavlov
  • 289
  • 3
  • 8
0
  1. Files defined inside conf.d would have Listen port as 80 along with repetitive declaration of Listen port in httpd.conf which can cause this issue.
  2. Seems port 80 is used by some other process, it can be checked by "netstat -anp|grep :80" Or assign a new available port to the Listen directive in httpd.conf and restart httpd.
Giri
  • 171
  • 4
-1

Your httpd server is already started. Try restarting the service instead of starting it again:

 sudo service httpd restart
andrewgu
  • 1,562
  • 14
  • 23
  • restart doesn't work.... $ sudo service httpd restart Stopping httpd: [FAILED] Starting httpd: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015: Unable to open logs [FAILED] – martian03 Oct 10 '17 at 04:17