Failed to start Apache HTTP Server

Just getting my feet wet with FreePBX. Trying to install RasPBX on a Raspberry Pi 4, but am having a problem on boot.

I am gettting a “Failed to start the Apache HTTP Server” error message. I’ve done a little digging and have found the following error messages:

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 Wed 2022-12-07 18:25:45 CST; 32ms ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 11976 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)

Dec 07 18:25:45 raspberrypi systemd[1]: Starting The Apache HTTP Server...
Dec 07 18:25:45 raspberrypi apachectl[11976]: chown: invalid user: 'asterisk'
Dec 07 18:25:45 raspberrypi systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Dec 07 18:25:45 raspberrypi systemd[1]: apache2.service: Failed with result 'exit-code'.
Dec 07 18:25:45 raspberrypi systemd[1]: Failed to start The Apache HTTP Server.



pi@raspberrypi:/etc/apache2 $ systemctl status apache2.service
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2022-12-07 18:32:38 CST; 30min ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 694 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)


For some reason Apache thinks that “asterisk” is an invalid user. I’ve checked /etc/apache2/envvars and can confirm that ‘asterisk’ is listed as a valid user.

# Since there is no sane way to get the parsed apache2 config in scripts, some
# settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=asterisk
export APACHE_RUN_GROUP=asterisk

Any ideas on how to fix this problem?

Have you checked that there IS a ‘valid’ asterisk user in /etc/passwd ?

(depending on stuff, useradd or adduser asterisk in /usr/sbin would be a good start, perhaps you missed that step ? )

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.