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 am working on ubuntu. I got the error messages while try to restart apache.

root@XXX:/etc/init.d# sudo /etc/init.d/apache2 restart
 * Restarting web server apache2                                                                                                              apache2: Could not reliably determine the server's fully qualified domain name,                                                               using xxx.xxx.xx.xxx for ServerName
httpd (no pid file) not running
apache2: Could not reliably determine the server's fully qualified domain name,                                                               using xxx.xxx.xx.xxx 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

I got the following message when tried netstat -pant

tcp        0   0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          32748       9950/httpd

tcp      429      0 xxx.xxx.xx.xxx:80       xxx.xxx.xx.xxx:xxxxx    CLOSE_WAIT  0          0          
share|improve this question

3 Answers 3

Use lsof -i :80 {check if the parameter is correct). It's listing all the application that are listening on port 80.

Also try to run apache2 {directly the executable} to check what is happening.

share|improve this answer

Just kill apache pid ( i think that its 'kill 9950' )

and then try /etc/init.d/apache2 start

share|improve this answer
    
I have tried it but apache2 start shows same errors –  user59503 Nov 8 '10 at 7:21
1  
You need to kill what ever is running on port 80... The PID complaint is only because you are trying to stop something that hasnt written a pid.. ( not important ) Is this an aptitude install? Or a precompiled version of apache? –  Arenstar Nov 8 '10 at 7:41
    
If kill does not work you can also try 'killall -9 httpd', verify using 'ps -C httpd' that process got killed and then use '/etc/init.d/apache2 start'. –  Saurabh Barjatiya Nov 8 '10 at 10:15

use pgrep apache2 to get to get the process list

share|improve this answer
1  
And after that, then what? –  Michael Hampton Oct 2 '13 at 3:25

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.