httpdはポート80にバインドできないため起動しません。ポート80では何も実行されません

httpdはポート80にバインドできないため起動しません。ポート80では何も実行されません

新しい証明書をインストールして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をrootで始めましたか?

おすすめ記事