apache2.service Failed Because the Control Process Exited with Error Code
The issue here, was that I had to use:
sudo a2enmod xxx.load
Then it said to restart Apache2. I did that, and now it is working.
This version of Apache (2.4.12) works different to how 2.4.7 works, so I had to do things a little differently.
Related videos on Youtube

Kevdog777
If I told you about me, then I wouldn't be so mysterious!
Updated on September 18, 2022Comments
-
Kevdog777 3 months
I am using Ubuntu 15 64-bit:
$ uname -a Linux {hostname} 4.2.0-16-generic
And I have installed
apache2
:$ sudo apt-get install -y apache2
I have a
mod_xxx.so
, which I have placed into:/usr/lib/apache2/modules/
. I set the permissions to 755 (rwx r-x r-x).I edited the
apache2.conf
:$ sudo vi /etc/apache2/apache2.conf AddHandler xxx-handler .xxx LoadModule xxx_module modules/mod_xxx.so
I know this works, as I have done this on several other Linux machines before.
When I try to restart Apache, it is failing with this error:
$ sudo service apache2 restart Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
After doing, what it says above,
systemctl status apache2.service
, it shows this:apache2.service - LSB: Apache2 web server Loaded: loaded (/etc/init.d/apache2) Active: failed (Result: exit-code) since Wed 2016-03-09 10:32:34 GMT; 9s ago Docs: man:systemd-sysv-generator(8) Process: 3479 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS) Process: 3503 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE) Mar 09 10:32:34 Ubuntu14 apache2[3503]: * Mar 09 10:32:34 Ubuntu14 apache2[3503]: * The apache2 configtest failed. Mar 09 10:32:34 Ubuntu14 apache2[3503]: Output of config test was: Mar 09 10:32:34 Ubuntu14 apache2[3503]: apache2: Syntax error on line 224 of...y Mar 09 10:32:34 Ubuntu14 apache2[3503]: Action 'configtest' failed. Mar 09 10:32:34 Ubuntu14 apache2[3503]: The Apache error log may have more i.... Mar 09 10:32:34 Ubuntu14 systemd[1]: apache2.service: Control process exite...=1 Mar 09 10:32:34 Ubuntu14 systemd[1]: Failed to start LSB: Apache2 web server. Mar 09 10:32:34 Ubuntu14 systemd[1]: apache2.service: Unit entered failed state. Mar 09 10:32:34 Ubuntu14 systemd[1]: apache2.service: Failed with result 'e...'. Hint: Some lines were ellipsized, use -l to show in full.
So I have tried to search everywhere for where
LoadModule
is specified. So I have tried doing this:$ sudo grep "LoadModule" /
I have also tried this:
sudo find / -type f grep -l "LoadModule"
Still no luck.
Where is the
LoadModule
specified, inApache 2.4.12
?I know that in
Apache 2.4.7
, it is in theapache.conf
file, which I have used the same logic here that I have used in the newer version.This is done on a Virtual Machine, so if an error does happen, I can clean the machine and start again. I am the root user too.
-
garethTheRed almost 7 yearsThere's some change in line 224 that's caused an issue? Edit your post with the content of this file, or at least an extract around line 224. As the output suggests, use the
-l
option to get a full width output. You can alsojournalctl -eu apache2
to get it to show just apache logs.
-
-
Stephen Kitt almost 3 years“The problem” was solved correctly a while ago, for the original question asker. Your approach deletes all the local configuration, which might work for you, but won’t for most people who need to fix their configuration rather than wipe it.
-
Kevdog777 almost 3 yearsThanks for your answer, but the
a2enmod
was definitely the thing I needed to get it working in my situation. -
Puspam almost 3 yearsThanks for the idea. Perhaps, I didn't have xxx.load module, so I needed to run
sudo a2enmod *.load
which loaded all the modules. -
Axel Köhler 11 monthsIndeed it does not answer the original question, so editing it might be a good idea. It worked for me though, so thanks.