Reload failed for The Apache HTTP Server

Hello,

I’m setting up a LAMP development environment and getting the following message: Reload failed for The Apache HTTP Server. I’ve placed the log below but I have a hard time to figuring things out, how to get it running.
I’ve read that it would be easier to use a LAMP stack in a docker container but I don’t have experience with Docker yet and I’m wondering if it is worth exploring now because I’m yet have to learn the LAMP stack.
I’ve tried installing on a template and standalone HVM but on both I received the same notification.
I hope that someone with experience installing LAMP can help me out.

Here you can the Docker on Qubes.

You can find the logs below.

user@study:~$ sudo systemctl status apache2.service
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2022-04-15 14:48:31 EDT; 23min ago
Docs: Apache HTTP Server Version 2.4 Documentation - Apache HTTP Server Version 2.4
Process: 2583 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=1/FAILURE)
Main PID: 725 (apache2)
Tasks: 7 (limit: 4641)
Memory: 25.5M
CPU: 160ms
CGroup: /system.slice/apache2.service
├─ 725 /usr/sbin/apache2 -k start
├─ 734 /usr/sbin/apache2 -k start
├─ 735 /usr/sbin/apache2 -k start
├─ 736 /usr/sbin/apache2 -k start
├─ 737 /usr/sbin/apache2 -k start
├─ 738 /usr/sbin/apache2 -k start
└─2211 /usr/sbin/apache2 -k start

Apr 15 14:58:53 study apachectl[2261]: The Apache error log may have more information.
Apr 15 14:58:53 study systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Apr 15 14:58:53 study systemd[1]: Reload failed for The Apache HTTP Server.
Apr 15 15:00:59 study systemd[1]: Reloading The Apache HTTP Server.
Apr 15 15:00:59 study apachectl[2586]: AH00526: Syntax error on line 1 of /etc/apache2/sites-enabled/test.conf:
Apr 15 15:00:59 study apachectl[2586]: Invalid command ‘VirtualHost’, perhaps misspelled or defined by a module not included in the server configuration
Apr 15 15:00:59 study apachectl[2583]: Action ‘graceful’ failed.
Apr 15 15:00:59 study apachectl[2583]: The Apache error log may have more information.
Apr 15 15:00:59 study systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Apr 15 15:00:59 study systemd[1]: Reload failed for The Apache HTTP Server.

See “systemctl status apache2.service” and “journalctl -xe” for details.
user@study:~$ sudo journalctl -xe
░░ The job identifier is 1558.
Apr 15 15:09:02 study systemd[1]: phpsessionclean.service: Succeeded.
░░ Subject: Unit succeeded
░░ Defined-By: systemd
░░ Support: Debian -- Support
░░
░░ The unit phpsessionclean.service has successfully entered the ‘dead’ state.
Apr 15 15:09:02 study systemd[1]: Finished Clean php session files.
░░ Subject: A start job for unit phpsessionclean.service has finished successfully
░░ Defined-By: systemd
░░ Support: Debian -- Support
░░
░░ A start job for unit phpsessionclean.service has finished successfully.
░░
░░ The job identifier is 1558.
Apr 15 15:09:57 study qubes-gui[712]: Not supported selection_req target 0x167 text/plain;charset=utf-8
Apr 15 15:11:02 study qubes-gui[712]: XGetWindowAttributes for 0x800003 failed in handle_crossing, ret=0x0
Apr 15 15:12:28 study sudo[3274]: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/systemctl status apache2.service
Apr 15 15:12:28 study sudo[3274]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
Apr 15 15:12:28 study sudo[3274]: pam_unix(sudo:session): session closed for user root
Apr 15 15:13:25 study qubes-gui[712]: XGetWindowAttributes for 0x12002a0 failed in handle_crossing, ret=0x0
Apr 15 15:14:24 study sudo[3290]: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/systemctl reload apache2
Apr 15 15:14:24 study sudo[3290]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)
Apr 15 15:14:24 study systemd[1]: Reloading The Apache HTTP Server.
░░ Subject: A reload job for unit apache2.service has begun execution
░░ Defined-By: systemd
░░ Support: Debian -- Support
░░
░░ A reload job for unit apache2.service has begun execution.
░░
░░ The job identifier is 1630.
Apr 15 15:14:24 study apachectl[3296]: AH00526: Syntax error on line 1 of /etc/apache2/sites-enabled/test.conf:
Apr 15 15:14:24 study apachectl[3296]: Invalid command ‘VirtualHost’, perhaps misspelled or defined by a module not included in the server configuration
Apr 15 15:14:24 study apachectl[3293]: Action ‘graceful’ failed.
Apr 15 15:14:24 study apachectl[3293]: The Apache error log may have more information.
Apr 15 15:14:24 study systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: Debian -- Support
░░
░░ An ExecReload= process belonging to unit apache2.service has exited.
░░
░░ The process’ exit code is ‘exited’ and its exit status is 1.
Apr 15 15:14:24 study systemd[1]: Reload failed for The Apache HTTP Server.
░░ Subject: A reload job for unit apache2.service has finished
░░ Defined-By: systemd
░░ Support: Debian -- Support
░░
░░ A reload job for unit apache2.service has finished.
░░
░░ The job identifier is 1630 and the job result is failed.
Apr 15 15:14:24 study sudo[3290]: pam_unix(sudo:session): session closed for user root
Apr 15 15:14:36 study sudo[3297]: user : TTY=pts/0 ; PWD=/home/user ; USER=root ; COMMAND=/usr/bin/journalctl -xe
Apr 15 15:14:36 study sudo[3297]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=1000)

Thanks in advanced for your help.
Best regards,
Ken

First thank you for looking at this issue.

I’ve solved the issue.

The issue was that apache server failed to start.
I’ve downloaded xampps but still that didn’t helped to start the apache server.
The following instruction helped to solve my problem and all light are green now.

user@development-apache:~$ sudo /etc/init.d/apache2 stop
Stopping apache2 (via systemctl): apache2.service.
user@development-apache:~$ sudo /opt/lampp/lampp stop
Stopping XAMPP for Linux 8.1.4-1…
XAMPP: Stopping Apache…not running.
XAMPP: Stopping MySQL…ok.
XAMPP: Stopping ProFTPD…ok.
user@development-apache:~$ sudo /opt/lampp/lampp start
Starting XAMPP for Linux 8.1.4-1…
XAMPP: Starting Apache…ok.
XAMPP: Starting MySQL…ok.
XAMPP: Starting ProFTPD…ok.

The solution.

download xampp file apachefriends.org
cd Downloads/
sudo chmod +x xampp-linux-x64-8.1.5-0-installer.run
sudo ./chmod +x xampp-linux-x64-8.1.5-0-installer.run

Apache didn’t startup so I looked for a solution and that was that we needed to install libnsl

sudo dnf install libnsl

Good luck