Symptoms
Apache will not start and an error similar to the following can be seen when attempting to rebuild the Apache configuration.
# The “/usr/sbin/httpd -DSSL -t -f /etc/apache2/conf/httpd.conf.work.437b55ee.cfgcheck -C Include "/etc/apache2/conf.modules.d/*.conf"” command (process 32022) reported error number 1 when it ended.
httpd: Syntax error in -C/-c directive: Syntax error on line 2 of /etc/apache2/conf.modules.d/005_mod_cgid.conf: Cannot load modules/mod_cgid.so into server: /etc/apache2/modules/mod_cgid.so: undefined symbol: ap_set_content_type_ex
Cause
The issue occurs when /etc/apache2/logs exists as a folder instead of a symlink to /var/log/apache2/logs.
Resolution
- Access the server's command line as the 'root' user via SSH or Terminal in WHM.
Move the
/etc/apache2/logsfolder under/var.# mv /etc/apache2/logs /var/log/apache2/logs
Create a symlink under
/etcto the logs folder under/var.# ln -s /var/log/apache2/logs /etc/apache2/logs
- Reinstall Apache.
CentOS 7, CloudLinux 7
# yum reinstall ea-apache24
AlmaLinux 8/9, CloudLinux 8/9, Rocky Linux 8/9
# dnf reinstall ea-apache24
Ubuntu
# apt install --reinstall ea-apache24
Comments
0 comments
Article is closed for comments.