Symptoms
When trying to rebuild the Apache configuration file, the system will fail and return this:
httpd: Syntax error in -C/-c directive: Include/IncludeOptional: Could not open directory /usr/local/apache/conf.modules.d: No such file or directory
Description
In some scenarios, Apache will not be able to rebuild the configuration file. This can also cause the Apache service to not start. If you attempt to rebuild the Apache configuration file, and it fails with either of the output below, we are going to need to reinstall the Apache Config Runtime package.
root@server [~]# /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.0804ff6d.cfgcheck -C Include "/usr/
local/apache/conf.modules.d/*.conf"” command (process 1063594) reported error number 1 when it ended.
httpd: Syntax error in -C/-c directive: Include/IncludeOptional: Could not open directory /usr/local/apache/
conf.modules.d: No such file or directory
root@server [~]# /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.5d056361.cfgcheck -C Include "/usr/local/apache/conf.modules.d/*.conf"” command (process 119719) reported error number 1 when it ended.
httpd_ls_bak: Syntax error in -C/-c directive: Include/IncludeOptional: No matches for the wildcard '*.conf' in '/usr/local/apache/conf.modules.d', failing
Workaround
The solution for this would be to reinstall the Apache Config Runtime package. To do this, please run the following commands:
rpm -e --nodeps --justdb ea-apache24-config-runtime.noarch
yum install ea-apache24-config-runtime.noarch
Once the packages are installed, attempt to rebuild and restart Apache using the command below:
/scripts/rebuildhttpdconf && /scripts/restartsrv_apache
Comments
0 comments
Article is closed for comments.