[Tutorial] Fix not boot Apache

Thứ Hai, 26 tháng 5, 2014
This is a post sysadmins out there For those who tremble into problems with servers running a LAMP setup. 

Occasionally, for some reason or another - usually Because you changed some settings - it is Necessary to restart apache from the terminal (ie in putty). 

Sometimes, though this is rare, this fails. If apache fails to restart and displays a message similar to "Address already in use: make_sock: could not bind to address" then unfortunately you wondering how to Get Your friend server back online! 

The precise message you receive could look something like this: 

Starting httpd: (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 

You may not have sewing or other error messages, but let's deal with this one! 

The slow fix is ​​to do a full reboot của server hardware. This takes quite some time, and is not necessarily the best course of action, but it nên solve this issue. 

The reason for the message, tuy nhiên, là có there are still active connections were not closed before. Probably some process was running When you hit "restart" (Identify Nên just by checking what - but that's beyond the scope of what we're doing here!). In any case, you'll want to find out what process is running, and "kill" it. 

Here's how: 

1) Type: 

ps-aux | grep httpd 

2) This will return a set of processes running đó are thời. There nên vài friend or two. It will look something like this: 

root 23605 0.1 0.1 861052 21208? Ss 10:07 0:00 / usr / sbin / httpd 
apache 23609 0.0 0.0 220500 7720? S 10:07 0:00 / usr / sbin / httpd 
root 23697 0.0 0.0 61184 776 pts / 0 S + 10:10 0:00 grep httpd 

3) Kill the apache processes are showing đó by typing: 

kill -9 23 609 

Remember to replace "23 609" with whatever number your process actually is! 

An alternative to this, if you have a lot of all running processes, is to use the "killall" method, mà: 

killall -9 httpd 

Then restart apache - it nên đúng work! 

service httpd restart 

You'll then want to set about đó Identifying processes were causing this in the first place! 

Leave a comment below if this worked for you - or if it did not - and we might be able and to help.
Chia sẻ bài viết ^^
Other post

All comments [ 0 ]


Your comments