Apache2는 다시 시작하면 연결을 닫을 수 없습니다

Apache2는 다시 시작하면 연결을 닫을 수 없습니다

저는 Apache2와 함께 Debian 웹서버를 실행하고 있는데 다시 시작 명령을 실행하면 오류가 발생하기 시작했습니다.

root@srv:~# service apache2 stop
Stopping web server: apache2.
root@srv:~# service apache2 start
Starting web server: apache2(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
Action 'start' failed.
The Apache error log may have more information.
 failed!

때때로 실제로 문제 없이 다시 시작되지만 일반적으로 먼저 killall -9 apache2를 실행해야 합니다. Debian IRC의 누군가가 나에게 활성 apache2 연결을 확인하라고 했고, 연결이 종료되지 않고 수십 개가 계속 열려 있는 것으로 나타났습니다. 결국 시간 초과되도록 하려면 어떻게 해야 합니까?

답변1

노력하다

lsof -i :80

그런 다음 관련 PID를 종료하십시오.

관련 정보