サイトアイコン アラコキからの Raspberry Pi 電子工作

php8.1 にすると Failed to start The Apache HTTP Server がでる

Webサーバー サイトの管理
Raspberry Pi nginx で php8.1 にすると
Failed to start The Apache HTTP Server がでる
 
php を 8.1 に変更すると、起動時に次のメッセージが出る様になった。
Failed to start The Apache HTTP Server
 
起動時のタイミングによっては、次のエラーメッセージになる。
Failed to start nginx - high performance web server
 
原因。
原因-1:AH00558: apache2: Could not reliably determine the server's fully qualified domain name
原因-2:AH00072: make_sock: could not bind to address [::]:80
 
以下、このエラーへの対処結果。
 
 

 

スポンサー リンク

 

 
 
 目 次
 
 
 
1. 稼働環境
 
現行Webサーバーのバージョン。
Raspberry Pi OS : 64-bit Debian GNU/Linux 11 (bullseye)
Nginx : Stable version 1.22.0
PHP : 7.4.28
 
上記環境で php を「8.1」に変更すると、起動時に
Failed to start The Apache HTTP Server」エラーがでる。
 
 
 
2. 原因
 
sudo apachectl configtest での結果。
 
sudo systemctl status apache2 での結果。
 
エラー-1:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name
 
エラー-2:
AH00072: make_sock: could not bind to address [::]:80
 
エラー-1の原因:
/etc/hosts に localhost 以外に自分で設定したホスト名が、Apacheの設定ファイルに定義されていないために発生する。
 
sudo nano /etc/hosts の内容。
 
エラー-2の原因:
Apacheでは、80番ポートを使う設定になっており、他のソフトウェアによって80番ポートが使用されていると起動できない。
 
 
 
3. 解決策-1
 
apache の設定ファイルに ServerName を追記する。
sudo echo ServerName $HOSTNAME > /etc/apache2/conf-available/fqdn.conf
sudo a2enconf fqdn
 
sudo nano /etc/apache2/conf-available/fqdn.conf で、内容を確認。
 
sudo apachectl configtest で検証すると、
「Syntax OK」となる。
 
 
 
4. 解決策-2
 
Apache のポート番号を、「80」から例えば「8080」に変更する。
 
ports.conf」を編集し、ポート番号を「8080」に変更する。
sudo nano /etc/apache2/ports.conf
 
 
 
以上。
(2022.06.19)
 

 

スポンサー リンク

 

             

 

 

 
モバイルバージョンを終了