출처 : https://kldp.org/node/32149



갑자기 httpd가 안됩니다.



jowook의 아바타

흑흑 좀 살려주세요.

# ./httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
[FAILED]

shyxu의 아바타

Re: 갑자기 httpd가 안됩니다.

jowook wrote:
흑흑 좀 살려주세요.

# ./httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
[FAILED]

저두 그거때문에 고생했었는데 ^^;;
80포트를 다른 프로그램에서 이미 사용하고 있다는 메시지입니다.

구글에서 찾아보니 그거에 대한 글들이 있네요.

http://www.webhostingtalk.com/showthread.php?threadid=43697

제가 볼때는 아래 방법이 제일 좋은 방법일듯.
netstat으로 어떤 프로그램이 80포트를 쓰는지 감시하고
그 프로그램을 죽이는 방법인데... 한번 보시구 상황에 따라 잘 체크하셔서 하면 될듯.

Techark wrote:

Here is how you take care of that problem from root type.
killall -9 httpd

then

netstat -anp | grep 80

Look for the process PID that is binding to port 80 and kill it. kill -9 PID. You may need run this command a few times, since other processes will try to latch on to the port as well. Once the above command returns nothing and takes you back to your prompt, then you can restart apache.

You can also do the same when a SSL process binds to port 443.

참고로 정상적으로 httpd가 돌아가는 경우..
netstat -anp | grep 80 실행했을땐 다음과 같은 결과가 나왔습니다.
한개든 두개든 상관은 없을겁니다 ^^;
아까 실행해보니 8개 정도 나오기도 하네요

# netstat -anp | grep 80
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      24184/httpd

Since 2003. 
지금은 맥유저...
---
http://jtjoo.com

익명 사용자의 아바타

# netstat -ltnp | grep

# netstat -ltnp | grep ':80'

위와 같이 명령어로 80 port를 사용하는 프로그램이 무엇인지 파악하시고

tcp 0 0 :::80 :::* LISTEN 3945/gpasswd

위와 같이 이상한 프로그램이 80포트를 사용하고 있으면 
아래 명령으로 프로세스를 kill합니다.

# kill -9 3945

이렇게 반복하다 보면 80포트를 더이상 사용하지 않게 되는데 이 때 apache를 시작시키시면 웹서버 잘돌아 갑니다.

- 이상 -


+ Recent posts