Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

build_apache_conf fails trying to open conf.d

Discussion in 'EasyApache' started by astopy, Dec 1, 2017.

  1. astopy

    astopy Well-Known Member

    Joined:
    Apr 3, 2003
    Messages:
    166
    Likes Received:
    0
    Trophy Points:
    166
    cPanel Access Level:
    Root Administrator
    I'm getting the following error when trying to rebuild my Apache config with EA3 (WHM 62.0 (build 35)):

    Code:
    # /usr/local/cpanel/bin/build_apache_conf
    Initial configuration generation failed with the following message:
    
    The “/usr/local/apache/bin/httpd” command (process 491969) reported error number 1 when it ended.
    Configuration problem detected on line 45 of file /usr/local/apache/conf/httpd.conf.work.UX6x7wN0:      : Could not open config directory /usr/local/apache/conf/conf.d: No such file or directory
    
            --- /usr/local/apache/conf/httpd.conf.work.UX6x7wN0 ---
            39
            40
            41Include "/usr/local/apache/conf/modhostinglimits.conf"
            42Include "/usr/local/apache/conf/php.conf"
            43Include "/usr/local/apache/conf/modsec2.conf"
            44Include "/usr/local/apache/conf/includes/errordocument.conf"
            45 ===> Include "/usr/local/apache/conf/conf.d/*.conf" <===
            46
            47
            48ErrorLog "logs/error_log"
            49ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
            50ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
            51ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
            --- /usr/local/apache/conf/httpd.conf.work.UX6x7wN0 ---
    
    
    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.UX6x7wN0
    Error:
    The “/usr/local/apache/bin/httpd” command (process 492004) reported error number 1 when it ended.
    Configuration problem detected on line 45 of file /usr/local/apache/conf/httpd.conf.work.UX6x7wN0:      : Could not open config directory /usr/local/apache/conf/conf.d: No such file or directory
    
            --- /usr/local/apache/conf/httpd.conf.work.UX6x7wN0 ---
            39
            40
            41Include "/usr/local/apache/conf/modhostinglimits.conf"
            42Include "/usr/local/apache/conf/php.conf"
            43Include "/usr/local/apache/conf/modsec2.conf"
            44Include "/usr/local/apache/conf/includes/errordocument.conf"
            45 ===> Include "/usr/local/apache/conf/conf.d/*.conf" <===
            46
            47
            48ErrorLog "logs/error_log"
            49ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
            50ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
            51ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
            --- /usr/local/apache/conf/httpd.conf.work.UX6x7wN0 ---
    
    I initially encountered this when I edited one of the include files via WHM (just adding a Passenger-related directive, nothing mentioning conf.d) and reverting that change makes no difference.

    As far as I can tell /usr/local/apache/conf/conf.d has never existed and isn't mentioned anywhere in /usr/local/apache or in /var/cpanel/templates. It seems to be coming from this block in /var/cpanel/templates/apache2/main.default:

    Code:
    [% FOREACH dir IN main.include.items -%]
    Include [% dir.include %]
    [% END -%]
    
    But I'm not sure where main.include.items is populated from.

    Can anyone point me in the right direction?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    41,516
    Likes Received:
    1,616
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you open a support ticket using the link in my signature so we can take a closer look to see how Apache has been configured?

    Thank you.
     
Loading...

Share This Page