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 came in this morning and our web server wasn't running so I shutdown apache and tried to start it again. Nothing has been touched on this server for at least 2-3 weeks httpd.conf was working last time i restarted it. I have tried rebooting the server to no avail. Below is the message i get when trying to start apache2.

username:~$ sudo /etc/init.d/apache2 start
 * Starting web server apache2
(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
   ...fail!
share|improve this question

4 Answers 4

up vote 2 down vote accepted

There is already a process listening on Port 80.

You can identify it by running the following command:

sudo netstat -anp | grep "0.0.0.0:80"

The rightmost column will give you the PID of the offending process(es).

If you are certain your Apache instance is the only thing that should be bound to port 80 on this system and running the init 'stop' script has had no effect, you can attempt to kill INSERTPIDHERE them and then try to start Apache again.

share|improve this answer

Your best bet is that part or all of the earlier HTTPD server is still running, whether active or hung. I would suggest that you:

sudo /etc/init.d/apache2 stop && ps -leaf | egrep -i "(http|apache)"

Anything printed by the grep is a likely suspect. If nothing is printed you should check for other processes listening, or otherwise using, port 80.

share|improve this answer

Though if rebooting the server doesn't fix it, its unlikely a hung apache process is taking up port 80. That last part:

Unable to open logs
   ...fail!

Suggests to me that their might be very little disk space left on the drive, or at least in the log file location. You can check available free space by typing df -h. If it's full might want to try deleting some log files, or other unnecessary files.

share|improve this answer
    
best answer here! –  warren Nov 30 '10 at 2:46

Thats mean another soft usinng port 80.

netstat -plan |grep :80 "this command will show you whas is using port 80"

share|improve this answer

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.