首页 > 解决方案 > 在 Raspbian 上卸载并重新安装 apache2 后无法启动 Apache HTTP 服务器

问题描述

我卸载了 apache、php、mysql、proftpd、wordpress、cerbot 和letsencrypt 以获得全新的apache 安装。

卸载所有软件包并重新安装 apache 后,出现此错误:

Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.
invoke-rc.d: initscript apache2, action "restart" failed.
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2021-08-28 15:46:46 CEST; 23ms ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 10693 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Aug 28 15:46:46 raspberrypi systemd[1]: Starting The Apache HTTP Server...
Aug 28 15:46:46 raspberrypi apachectl[10693]: apache2: Syntax error on line 225 of /etc/apache2/apache2.conf: Syntax error on line 33 of /etc/apache2/sites-enabled/000-default-le-ssl.conf: Could not open configuration file /etc/letsencrypt/options-ssl-apache.conf: No such file or directory
Aug 28 15:46:46 raspberrypi apachectl[10693]: Action 'start' failed.
Aug 28 15:46:46 raspberrypi apachectl[10693]: The Apache error log may have more information.
Aug 28 15:46:46 raspberrypi systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Aug 28 15:46:46 raspberrypi systemd[1]: apache2.service: Failed with result 'exit-code'.
Aug 28 15:46:46 raspberrypi systemd[1]: Failed to start The Apache HTTP Server.
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for systemd (241-7~deb10u8+rpi1) ...

我试图通过以下方式删除所有与 apache 相关的软件包

sudo apt-get remove apache2
sudo apt autoremove

但这也不起作用。

标签: apacheraspberry-piapache2

解决方案


我在 Pi 上刷了一个新图像,因为我无法让它运行。


推荐阅读