コンピュータでapache2 httpd Webサーバーを実行中にエラーが発生しました。

コンピュータでapache2 httpd Webサーバーを実行中にエラーが発生しました。

Raspberry PiをWebサーバーとして設定しようとしています。今日ちょうどインストールして最新の状態ですね。私はapache2を使用しました。私のコンピュータのIPアドレスをChromeに入力してもサンプルページが表示されない場合は、linuxコマンドを使用する必要があることを読みました。

sudo service apache2 start

ただし、コードを実行しようとすると、次のメッセージが表示されます。

Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.

その後、確認を要求した最初のファイルを開き、結果は次のようになります。

Jun 01 18:59:27 raspberrypi systemd[1]: Starting The Apache HTTP Server...
Jun 01 18:59:27 raspberrypi apachectl[6989]: /usr/sbin/apachectl: 174: /usr/sbin/apachectl: /usr/sbin/apachectl: /usr/sbin/apache2: not found
Jun 01 18:59:27 raspberrypi apachectl[6989]: Action 'start' failed.
Jun 01 18:59:27 raspberrypi apachectl[6989]: The Apache error log may have more information.
Jun 01 18:59:27 raspberrypi systemd[1]: apache2.service: Control process exited, code=exited status=127
Jun 01 18:59:27 raspberrypi systemd[1]: Failed to start The Apache HTTP Server.
Jun 01 18:59:27 raspberrypi systemd[1]: apache2.service: Unit entered failed state.
Jun 01 18:59:27 raspberrypi systemd[1]: apache2.service: Failed with result 'exit-code'.

Apacheファイルを正しくインストールしたかどうかはわかりません。

ベストアンサー1

/usr/sbin/apache2: not found

ファイルが存在しないようです。通常、ディストリビューションは適切な単位ファイルを提供すると予想しています。たぶん予想通りにApacheをインストールしていない可能性があります。インストールされているファイル(dpkg-query --listfiles apache2)を確認して正しいユニットファイルを生成できます。

おすすめ記事