Failed to generate a syntactically correct Apache configuration

A Hartonian

Active Member
May 22, 2018
44
9
8
Oman
cPanel Access Level
DataCenter Provider
Hello,

I used the command
Code:
/scripts/rebuildhttpdconf
to rebuild HTTPD for certain changes that I wanted to take effect.

After that I am getting the following errors:

Code:
[[email protected] ~]# /scripts/rebuildhttpdconf
Initial configuration generation failed with the following message:

The “/usr/local/apache/bin/httpd -DSSL -t -f /usr/local/apache/conf/httpd.conf.work.eeee1023.cfgcheck -C Include "/usr/local/apache/conf.modules.d/*.conf"” command (process 13754) reported error number 1 when it ended.
httpd_ls_bak: Syntax error in -C/-c directive: Include/IncludeOptional: Could not open directory /usr/local/apache/conf.modules.d: No such file or directory

Rebuilding configuration without any local modifications.

Failed to generate a syntactically correct Apache configuration.
Bad configuration file located at /usr/local/apache/conf/httpd.conf.work.eeee1023
Error:
The “/usr/local/apache/bin/httpd -DSSL -t -f /usr/local/apache/conf/httpd.conf.work.eeee1023.cfgcheck -C Include "/usr/local/apache/conf.modules.d/*.conf"” command (process 13765) reported error number 1 when it ended.
httpd_ls_bak: Syntax error in -C/-c directive: Include/IncludeOptional: Could not open directory /usr/local/apache/conf.modules.d: No such file or directory
I would appreciate your insight on this.

Thank you
 

A Hartonian

Active Member
May 22, 2018
44
9
8
Oman
cPanel Access Level
DataCenter Provider
This is what I did to fix the problem.
Thought it might be useful for someone else who is facing the same issue.

Code:
# cd /etc/
# mv apache2 apache2bk
# yum reinstall ea-apache* -y
# /scripts/rebuildhttpdconf
# /scripts/restartsrv_httpd
 
  • Like
Reactions: cPanelLauren

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,271
313
Houston
Hello,


I'm really glad that you were able to resolve the issue. This happens when there is an issue with the copy of the httpd.conf litespeed makes (httpd_ls_bak) is incorrect.

Thank you for providing the steps you too to resolve the issue.