Failed to start The Apache HTTP Server

So, try disabling it and re-enabling it (a2dismod mpm_event and a2enmod mpm_event), and make sure the link exists in mods-enabled and that it actually contains something reasonable that would load the module.

Edit: And keep looking at the logs and errors.

a2dismod mpm_event

Module mpm_event disabled.
To activate the new configuration, you need to run:
  systemctl restart apache2

systemctl restart apache2

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

a2enmod mpm_event

Considering conflict mpm_worker for mpm_event:
Considering conflict mpm_prefork for mpm_event:
Enabling module mpm_event.
To activate the new configuration, you need to run:
  systemctl restart apache2

systemctl restart apache2

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

Those are the modules currently enabled:

We need to see the errors. Why isn’t it starting now?

Through what file or command?

Error_log is always the same:

[Mon Nov 21 00:00:06.986602 2022] [mpm_event:notice] [pid 845:tid 139666938759040] AH00489: Apache/2.4.52 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Mon Nov 21 00:00:06.986693 2022] [core:notice] [pid 845:tid 139666938759040] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 21 15:41:11.931131 2022] [mpm_event:notice] [pid 845:tid 139666938759040] AH00493: SIGUSR1 received.  Doing graceful restart
[Mon Nov 21 15:41:13.518313 2022] [mpm_event:notice] [pid 845:tid 139666938759040] AH00489: Apache/2.4.52 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Mon Nov 21 15:41:13.518366 2022] [core:notice] [pid 845:tid 139666938759040] AH00094: Command line: '/usr/sbin/apache2'
[Mon Nov 21 16:03:45.032209 2022] [mpm_event:notice] [pid 845:tid 139666938759040] AH00493: SIGUSR1 received.  Doing graceful restart
[Mon Nov 21 16:03:45.536368 2022] [mpm_event:notice] [pid 845:tid 139666938759040] AH00489: Apache/2.4.52 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 configured -- resuming normal operations
[Mon Nov 21 16:03:45.536404 2022] [core:notice] [pid 845:tid 139666938759040] AH00094: Command line: '/usr/sbin/apache2'
[Tue Nov 22 08:54:28.448282 2022] [mpm_event:notice] [pid 845:tid 139666938759040] AH00491: caught SIGTERM, shutting down

sudo systemctl status apache2

Γ— 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-11-23 18:21:37 UTC; 5min ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 1955429 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
        CPU: 15ms

Starting The Apache HTTP Server...
AH00534: apache2: Configuration error: No MPM loaded.
Action 'start' failed.
The Apache error log may have more information.
apache2.service: Control process exited, code=exited, status=1/FAILURE
apache2.service: Failed with result 'exit-code'.
Failed to start The Apache HTTP Server.

Apache2.conf:

DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn

#IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

Include ports.conf

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

#<Directory /srv/>
#	Options Indexes FollowSymLinks
#	AllowOverride None
#	Require all granted
#</Directory>

AccessFileName .htaccess

<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1
SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384

When you restarted Apache and it failed, it suggested a journalctl command. I’d start there.

journalctl -xeu apache2.service output is regrettably the same:

β–‘β–‘ A start job for unit apache2.service has begun execution.
β–‘β–‘
β–‘β–‘ The job identifier is 309458.
Nov 23 18:09:13 apachectl[1954874]: AH00534: apache2: Configuration error: No MPM loaded.
Nov 23 18:09:13 apachectl[1954871]: Action 'start' failed.
Nov 23 18:09:13 apachectl[1954871]: The Apache error log may have more information.
Nov 23 18:09:13 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
β–‘β–‘ Subject: Unit process exited
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ An ExecStart= process belonging to unit apache2.service has exited.
β–‘β–‘
β–‘β–‘ The process' exit code is 'exited' and its exit status is 1.
Nov 23 18:09:13 systemd[1]: apache2.service: Failed with result 'exit-code'.
β–‘β–‘ Subject: Unit failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ The unit apache2.service has entered the 'failed' state with result 'exit-code'.
Nov 23 18:09:13 systemd[1]: Failed to start The Apache HTTP Server.
β–‘β–‘ Subject: A start job for unit apache2.service has failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ A start job for unit apache2.service has finished with a failure.
β–‘β–‘
β–‘β–‘ The job identifier is 309458 and the job result is failed.
Nov 23 18:21:37 systemd[1]: Starting The Apache HTTP Server...
β–‘β–‘ Subject: A start job for unit apache2.service has begun execution
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ A start job for unit apache2.service has begun execution.
β–‘β–‘
β–‘β–‘ The job identifier is 309541.
Nov 23 18:21:37 apachectl[1955432]: AH00534: apache2: Configuration error: No MPM loaded.
Nov 23 18:21:37 apachectl[1955429]: Action 'start' failed.
Nov 23 18:21:37 apachectl[1955429]: The Apache error log may have more information.
Nov 23 18:21:37 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
β–‘β–‘ Subject: Unit process exited
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ An ExecStart= process belonging to unit apache2.service has exited.
β–‘β–‘
β–‘β–‘ The process' exit code is 'exited' and its exit status is 1.
Nov 23 18:21:37 systemd[1]: apache2.service: Failed with result 'exit-code'.
β–‘β–‘ Subject: Unit failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ The unit apache2.service has entered the 'failed' state with result 'exit-code'.
Nov 23 18:21:37: Failed to start The Apache HTTP Server.
β–‘β–‘ Subject: A start job for unit apache2.service has failed
β–‘β–‘ Defined-By: systemd
β–‘β–‘ Support: http://www.ubuntu.com/support
β–‘β–‘
β–‘β–‘ A start job for unit apache2.service has finished with a failure.
β–‘β–‘
β–‘β–‘ The job identifier is 309541 and the job result is failed.

What’s going on here? Did you change that? Why?

What is in /etc/apache2/mods-enabled?

1 Like

I told OP to comment that out for troubleshooting purposes before we knew that PHP-FPM was completely gone. I mentioned once or twice since then that it should be undone.

Richard

1 Like

So, a summary, and to close out this thread:

  1. You uninstalled mod_fcgid, which made Apache unhappy when it saw fcgid directives in the Apache config file. Can’t use those directives without mod_fcgid loaded. To avoid that problem in the future, don’t uninstall mod_fcgid again.
  2. Disabling loading all *.load files caused Apache to stop loading all optional modules. That can’t possibly work. Don’t do that. :man_shrugging:
2 Likes

Hi Joe, Richard,

thank you for your very special efforts, Apache came back to life!

Just one thing, now - opening one of the website - I get this:

Your PHP installation appears to be missing the MySQL extension which is required by WordPress

Please note my current settings:

Any suggestion to get back the WP installation?

Thank you once again.

Solved! MySQL extensions were missing, now properly installed:

Just to be sure, may you please confirm the correct setting for the below:

image

Thank you!

2 Likes

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