在计算机上运行 apache2 httpd Web 服务器时出错

在计算机上运行 apache2 httpd Web 服务器时出错

我正在尝试将我的树莓派设置为网络服务器。我今天刚安装了它,所以它是最新配置。我已经用apache2了。我读过,如果在 chrome 中输入我的计算机的 IP 地址无法调出示例页面,我应该使用 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)并创建正确的单元文件。

相关内容