Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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. –  JakeGould Nov 15 '13 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 –  yoonix Nov 15 '13 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 '13 at 11:02

2 Answers 2

use


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

try with with this topic

or NixCraft

share|improve this answer
    
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) –  Connor Gavitt Nov 15 '13 at 22:52

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).

share|improve this answer
    
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 ? –  Iain Nov 23 '13 at 8:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.