0

I have centOS 6.4 64bit and apache2 (httpd) installed. I do:

 /etc/init.d/httpd start     

And Apache starts up fine with just a green [Ok]

However; when I try to load any webpages hosted on it they fail to load and:

service https status    

Shows that https is stopped.

When using:

service httpd restart    

I get this error:

(98)Address already in use: make_sock: could not bind to address [::]:80
(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
                                                           [FAILED]

What could be causing apache to do this?

3
  • What happens when you reboot the machine? That is the very first thing you should do in a case like this to see if that clears things up. Nov 15, 2013 at 22:42
  • 2
    When you see that error run netstat -nap | grep '0.0.0.0:80'. Look at the far right column which will contain the PID/process that is bound. I've seen this happen when doing a restart sometimes. You may have better luck doing service httpd stop;sleep 1;service httpd start
    – user143703
    Nov 15, 2013 at 22:45
  • The -l option is handy in this situation as netstat then only lists listening ports. Also you must run it as root for the -poption to work.
    – Ladadadada
    Nov 16, 2013 at 11:02

2 Answers 2

0

use


    netstat -antu|grep 80
    lsof -i -n -P|grep 80

try with with this topic

or NixCraft

1
  • Apache seems to be using a iPv6 address that is taking port 80, can I have some help and fixing/removing that function of it so it only uses iPv4? httpd 10975 root 4u IPv6 1010994 0t0 TCP *:80 (LISTEN) Nov 15, 2013 at 22:52
-1

You probably have a line in your httpd.conf that looks like:

Listen 80

try changing it to:

Listen 0.0.0.0:80

which will make it listen on all IPv4 addresses. Recent apaches will listen to (only) IPv6 by default if you just have Listen 80 , if the system has as valid IPv6 address (even just a link local self-assigned address).

1
  • Don't the messages about not being able to bind to [::]:80 and 0.0.0.0:80 kind of imply that it can't bind to any IPv6 or IPv4 address ?
    – user9517
    Nov 23, 2013 at 8:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .