Introduction
When trying to make changes to Apache's include files or when trying to switch to Apache through the WHM, we encounter the following error. How can we resolve this?
/scripts/rebuildhttpdconf
Initial configuration generation failed with the following message:
The “/usr/sbin/httpd -DSSL -t -f /etc/apache2/conf/httpd.conf.work.3eb24a3d.cfgcheck -C Include "/etc/apache2/conf.modules.d/*.conf"” command (process 4939) 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/385_mod_rewrite.conf: Cannot load modules/mod_rewrite.so into server: /etc/apache2/modules/mod_rewrite.so: undefined symbol: ap_stat_check
Rebuilding configuration without any local modifications.
Failed to generate a syntactically correct Apache configuration.
Bad configuration file located at /etc/apache2/conf/httpd.conf.work.3eb24a3d
Error:
The “/usr/sbin/httpd -DSSL -t -f /etc/apache2/conf/httpd.conf.work.3eb24a3d.cfgcheck -C Include "/etc/apache2/conf.modules.d/*.conf"” command (process 4940) 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/385_mod_rewrite.conf: Cannot load modules/mod_rewrite.so into server: /etc/apache2/modules/mod_rewrite.so: undefined symbol: ap_stat_check
Procedure
When this issue occurs, the Apache binary will need to be reinstalled.
- Access your server through SSH as root.
-
If you are using AlmaLinux, CloudLinux, or RockyLinux, please use Yum or DNF to reinstall the package.
yum reinstall ea-apache24 -
If you are using Ubuntu, please use apt-get.
apt-get install --reinstall ea-apache24
Additional Resources
How to log into server using SSH?
How-To reinstall packages using yum/dnf
Comments
0 comments
Article is closed for comments.