Apache2在启动时崩溃,但在手动启动时不会崩溃

时间:2020-05-23 12:08:59

标签: apache web server apache2

我遇到了一个根本无法理解的有线问题:

我在Ubuntu 18.04上有一个安装了Apache2的家庭服务器。我的问题是Apache2在重新启动系统时一直崩溃。

systemctl status apache2 给我:

● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Drop-In: /lib/systemd/system/apache2.service.d
         └─apache2-systemd.conf
Active: failed (Result: exit-code) since Sat 2020-05-23 13:42:31 CEST; 3min 52s ago
Process: 1183 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 1224 (code=exited, status=1/FAILURE)

mai 23 13:42:30 potato-server systemd[1]: Starting The Apache HTTP Server...
mai 23 13:42:30 potato-server systemd[1]: Started The Apache HTTP Server.
mai 23 13:42:31 potato-server systemd[1]: apache2.service: Main process exited, code=exited, status=1/FAILURE
mai 23 13:42:31 potato-server systemd[1]: apache2.service: Failed with result 'exit-code'.

超级奇怪的是,当我手动执行 sudo systemctl start apache2 时,服务器会启动。 apache2ctl configtest给了我

Syntax OK

对问题可能来自何处的任何想法?

1 个答案:

答案 0 :(得分:0)

我有一些更新:

看来我的错误是由于我在 / etc / apache2 / envvar 中更改了Apache2的组和用户,根据这篇文章:https://www.simplified.guide/apache/change-user-and-group

如果我将用户和用户组改回www-data,它将再次起作用。但是,我想从www-data之外的其他用户运行Apache2。这可能吗 ?

相关问题