Unable to start Apache on Plesk server: Cannot load modules/mod_<name>.so

Started by mahesh, Nov 27, 2024, 06:30 AM

Previous topic - Next topic

mahesh

Symptoms
Note: The following symtoms could be presented with different Apache module

  • The following error show up while checking apache configuration syntax:
#httpd -t
httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 36 of /etc/httpd/conf.modules.d/00-base.conf: Cannot load modules/mod_ext_filter.so into server: /etc/httpd/modules/mod_ext_filter.so: cannot open shared object file: No such file or directory

  • The mentioned apache module file is missing:
#ls -l /etc/httpd/modules/mod_ext_filter.so
ls: cannot access /etc/httpd/modules/mod_ext_filter.so: No such file or directory
  • Apache fails to start with the following error:
#systemctl start httpd
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
  • The following error show up in journalctl -xe command
-- Unit httpd.service has begun starting up.
httpd[29946]: httpd: Syntax error on line 56 of /etc/httpd/conf/httpd.conf: Syntax error on line 36 of /etc/httpd/conf.modules.d/00-base.conf: Cannot load modules/mod_ext_filter.so into server: /etc/httpd/modules/mod_ext_filter.so: cannot open shared object file: No such file or directory
systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
systemd[1]: Failed to start The Apache HTTP Server.

Cause
Apache module was not removed correctly and orphan reference to it exists in Apache configuration files.

Resolution
1.Connect to the server via SSH

2.Find in which Apache configuration file the module is being referenced, with command:

#grep -lR "mod_ext_filter.so" /etc/httpd/
/etc/httpd/conf.modules.d/00-base.conf

Note: Modify the command above accordingly with the corresponding missing module if is different than mod_ext_filter.so

3.Use vi or any text editor of your preference to edit the configuration file with the missing module

#vi /etc/httpd/conf.modules.d/00-base.conf
Note: In case the previous step command prompt a different path, use that path instead

4.Comment out the missing module. It should stay this way:

#LoadModule ext_filter_module modules/mod_ext_filter.so
5.Restart Apache:

6.service httpd restart

7.Run the following command:

#plesk repair web
8.Verify that Apache syntax is correct:

#httpd -t
Syntax OK