새 인증서를 설치하고 httpd 서비스를 다시 시작하려고 하면 다음 메시지가 계속 나타납니다.
$ httpd -X
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
구문을 확인합니다.
$ httpd -t
Syntax OK
서비스 점검을 통해 다음과 같은 정보를 얻을 수 있습니다.
$ systemctl status httpd.service
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2023-04-21 18:36:25 UTC; 14s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 254501 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 254501 (code=exited, status=1/FAILURE)
저널 xe의 경우 다음을 얻습니다.
sudo journalctl --no-pager -u httpd
-- Logs begin at Fri 2023-04-21 13:58:29 UTC, end at Fri 2023-04-21 19:12:22 UTC. --
Apr 21 13:58:47 domian.com systemd[1]: Starting The Apache HTTP Server...
Apr 21 13:58:49 domian.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Apr 21 13:58:49 domian.com systemd[1]: Failed to start The Apache HTTP Server.
Apr 21 13:58:49 domian.com systemd[1]: Unit httpd.service entered failed state.
Apr 21 13:58:49 domian.com systemd[1]: httpd.service failed.
Apr 21 15:12:48 domian.com systemd[1]: Starting The Apache HTTP Server...
Apr 21 15:12:48 domian.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Apr 21 15:12:48 domian.com systemd[1]: Failed to start The Apache HTTP Server.
Apr 21 15:12:48 domian.com systemd[1]: Unit httpd.service entered failed state.
Apr 21 15:12:48 domian.com systemd[1]: httpd.service failed.
Apr 21 18:09:59 domian.com systemd[1]: Starting The Apache HTTP Server...
Apr 21 18:09:59 domian.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Apr 21 18:09:59 domian.com systemd[1]: Failed to start The Apache HTTP Server.
Apr 21 18:09:59 domian.com systemd[1]: Unit httpd.service entered failed state.
Apr 21 18:09:59 domian.com systemd[1]: httpd.service failed.
Apr 21 18:11:21 domian.com systemd[1]: Starting The Apache HTTP Server...
Apr 21 18:11:21 domian.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Apr 21 18:11:21 domian.com systemd[1]: Failed to start The Apache HTTP Server.
Apr 21 18:11:21 domian.com systemd[1]: Unit httpd.service entered failed state.
Apr 21 18:11:21 domian.com systemd[1]: httpd.service failed.
Apr 21 18:15:43 domian.com systemd[1]: Unit httpd.service cannot be reloaded because it is inactive.
Apr 21 18:36:25 domian.com systemd[1]: Starting The Apache HTTP Server...
Apr 21 18:36:25 domian.com systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Apr 21 18:36:25 domian.com systemd[1]: Failed to start The Apache HTTP Server.
Apr 21 18:36:25 domian.com systemd[1]: Unit httpd.service entered failed state.
Apr 21 18:36:25 domian.com systemd[1]: httpd.service failed.
포트 80에는 아무것도 없습니다
xxxx@domain conf.d]$ sudo netstat -tulpn | grep --color :80
[xxxx@domain conf.d]$
httpd를 시작하려면 또 무엇을 해야 할지 모르시나요?
sudo netstat -an의 부분 출력
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5001 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:7373 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6062 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1935 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:6162 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8126 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:4352 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:4355 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:45288 127.0.0.1:6379 TIME_WAIT
tcp 0 0 127.0.0.1:48962 127.0.0.1:6379 ESTABLISHED
tcp 0 0 127.0.0.1:6379 127.0.0.1:49170 ESTABLISHED
tcp 0 0 127.0.0.1:45610 127.0.0.1:6379 TIME_WAIT
tcp 0 0 127.0.0.1:47764 127.0.0.1:6379 TIME_WAIT
tcp 0 0 127.0.0.1:47626 127.0.0.1:6379 TIME_WAIT
tcp 0 0 127.0.0.1:6379 127.0.0.1:49010 ESTABLISHED
tcp 0 0 127.0.0.1:48872 127.0.0.1:6379 ESTABLISHED
tcp 0 0 127.0.0.1:45778 127.0.0.1:6379 TIME_WAIT
tcp 0 0 127.0.0.1:47260 127.0.0.1:6379 TIME_WAIT
tcp 0 0 127.0.0.1:48332 127.0.0.1:6379 ESTABLISHED
tcp 0 0 127.0.0.1:45336 127.0.0.1:6379 TIME_WAIT ```
답변1
일부 시스템에서는 1024 미만의 포트에 대한 액세스가 제한됩니다. 그보다 높은 포트에서 실행해 보거나 httpd를 루트로 시작해 보셨나요?
답변2
그래서 나는 다른 사람이 cert 디렉토리에 이전 키를 넣어서 httpd가 포트:80에 바인딩할 수 있는 권한을 갖지 못하게 한다는 것을 발견했습니다. 소중한 제안과 답변에 감사드립니다.