웹서버를 운영하다 보면 httpd 서비스를 restart 할 경우가 아주 많이 있습니다. 이때 발생하는 오류케이스 한 개를 정리합니다.

발생 오류메세지
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details. |
우선 상태를 먼저 확인합니다.
systemctl status httpd |
결과
● httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: failed (Result: exit-code) since 금 2020-05-08 14:27:30 KST; 32s ago Docs: man:httpd(8) man:apachectl(8) Process: 14844 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE) Process: 27947 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS) |
Process: 14841 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 14841 (code=exited, status=1/FAILURE)
5월 08 14:27:30 localhost.localdomain httpd[14841]: (13)Permission denied: AH00072: make_sock: could not bind to address [::]:7708
5월 08 14:27:30 localhost.localdomain httpd[14841]: (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:7708
5월 08 14:27:30 localhost.localdomain httpd[14841]: no listening sockets available, shutting down
5월 08 14:27:30 localhost.localdomain httpd[14841]: AH00015: Unable to open logs
5월 08 14:27:30 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
5월 08 14:27:30 localhost.localdomain kill[14844]: kill: cannot find process ""
5월 08 14:27:30 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1 5월 08 14:27:30 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server. 5월 08 14:27:30 localhost.localdomain systemd[1]: Unit httpd.service entered failed state. 5월 08 14:27:30 localhost.localdomain systemd[1]: httpd.service failed.
오류내용 (13)Permission denied: AH00072: make_sock: could not bind to address [::]:7708
|
이 경우는 SELinux 정책 때문에 생기는 문제입니다.
간단히 해결이 가능하나 이게 완전히 해결이 된 것이 아니므로 뒷부분은 추후 정리하도록 하겠습니다.
해결방법
setenforce 0 service httpd start |
출처 : https://jiniweb.tistory.com/43