2

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, in Apache 2.4.12?

I know that in Apache 2.4.7, it is in the apache.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.

1
  • There'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 also journalctl -eu apache2 to get it to show just apache logs. Commented Mar 9, 2016 at 11:38

2 Answers 2

2

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.

1
  • 2
    Thanks for the idea. Perhaps, I didn't have xxx.load module, so I needed to run sudo a2enmod *.load which loaded all the modules. Commented Mar 1, 2020 at 19:48
-2

I have solved the problem.

$ sudo service apache2 start 

Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.

apache2.service Failed Because the Control Process Exited with Error Code and apache2 service activation:failed perfect solution.

$ systemctl restart apache2 $ journal -xe $ sudo apt-get purge apache2 $ sudo apt autoremove apache2 $ sudo apt-get purge apache2 $ sudo apt-get purge apache2* $ sudo apt-get install apache2 $ sudo service apache2 start 
3
  • 1
    “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. Commented Jan 30, 2020 at 17:26
  • Thanks for your answer, but the a2enmod was definitely the thing I needed to get it working in my situation. Commented Jan 31, 2020 at 13:33
  • Indeed it does not answer the original question, so editing it might be a good idea. It worked for me though, so thanks. Commented Jan 17, 2022 at 16:30

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.