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.

httpd.conf generation failed

Discussion in 'General Discussion' started by bhanuprasad1981, Feb 17, 2011.

  1. bhanuprasad1981

    bhanuprasad1981 Well-Known Member

    Joined:
    Aug 5, 2008
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    i tried to regerate httpd.conf but its not working with this reason :-

    Code:
    root@host [~]# /scripts/rebuildhttpdconf
    info [rebuildhttpdconf] 'local' datastore in use (/var/cpanel/conf/apache/local)
    Initial configuration generation failed with the following message:
    
    An error occurred while running: /usr/local/apache/bin/httpd -DSSL -t -f /usr/local/apache/conf/httpd.conf.1297946044
    Exit signal was: 0
    Exit value was: 1
    Output was:
    ---
    httpd: Syntax error on line 99 of /usr/local/apache/conf/httpd.conf.1297946044: <IfModule> directive requires additional arguments
    ---
    
    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.1297946044
    Error:
    An error occurred while running: /usr/local/apache/bin/httpd -DSSL -t -f /usr/local/apache/conf/httpd.conf.1297946044
    Exit signal was: 0
    Exit value was: 1
    Output was:
    ---
    httpd: Syntax error on line 99 of /usr/local/apache/conf/httpd.conf.1297946044: <IfModule> directive requires additional arguments
    
    
    
     
  2. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    There is a minor error in the line number 99 of httpd.conf.

    Code:
    httpd: Syntax error on line 99 of /usr/local/apache/conf/httpd.conf.1297946044: <IfModule> directive requires additional arguments
    Without checking the lines it is not possible to say what is wrong with the <IfModule>. Can you copy paste the lines over here?
     
  3. bhanuprasad1981

    bhanuprasad1981 Well-Known Member

    Joined:
    Aug 5, 2008
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    here is content :-

    Code:
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    #   Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the       #
    #   configuration file. To have modifications retained, all modifications must be checked into the              #
    #   configuration system by running:                                                                            #
    #       /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
    #   To see if your changes will be conserved, regenerate the Apache configuration file by running:              #
    #       /usr/local/cpanel/bin/build_apache_conf                                                                 #
    #   and check the configuration file for your alterations. If your changes have been ignored, then they will    #
    #   need to be added directly to their respective template files.                                               #
    #                                                                                                               #
    #   It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf       #
    #   For detailed instructions on using Include files and the apache_conf_distiller with the new configuration   #
    #   system refer to the documentation at: http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html       #
    #                                                                                                               #
    #   This configuration file was built from the following templates:                                             #
    #     /var/cpanel/templates/apache2/main.default                                                                #
    #     /var/cpanel/templates/apache2/main.local                                                                  #
    #     /var/cpanel/templates/apache2/vhost.default                                                               #
    #     /var/cpanel/templates/apache2/vhost.local                                                                 #
    #     /var/cpanel/templates/apache2/ssl_vhost.default                                                           #
    #     /var/cpanel/templates/apache2/ssl_vhost.local                                                             #
    #                                                                                                               #
    #  Templates with the '.local' extension will be preferred over templates with the '.default' extension.        #
    #  The only template updated by the apache_conf_distiller is main.default.                                      #
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    
    
    Include "/usr/local/apache/conf/includes/pre_main_global.conf"
    Include "/usr/local/apache/conf/includes/pre_main_2.conf"
    
     
    
    LoadModule bwlimited_module modules/mod_bwlimited.so
    
    
    
    
    Include "/usr/local/apache/conf/php.conf"
    Include "/usr/local/apache/conf/includes/errordocument.conf"
    
    
    RLimitMEM 1862622890 
    RLimitCPU 240 
    ErrorLog 
    DefaultType 
    ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
    ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
    ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
    ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi
    ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi
    ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi
    
    RewriteEngine on
    AddType text/html .shtml
    
    Alias /akopia /usr/local/cpanel/3rdparty/interchange/share/akopia/
    Alias /bandwidth /usr/local/bandmin/htdocs/
    Alias /img-sys /usr/local/cpanel/img-sys/
    Alias /interchange /usr/local/cpanel/3rdparty/interchange/share/interchange/
    Alias /interchange-5 /usr/local/cpanel/3rdparty/interchange/share/interchange-5/
    Alias /java-sys /usr/local/cpanel/java-sys/
    Alias /mailman/archives /usr/local/cpanel/3rdparty/mailman/archives/public/
    Alias /pipermail /usr/local/cpanel/3rdparty/mailman/archives/public/
    Alias /sys_cpanel /usr/local/cpanel/sys_cpanel/
    
    
    ScriptAlias /cgi-sys /usr/local/cpanel/cgi-sys/
    ScriptAlias /mailman /usr/local/cpanel/3rdparty/mailman/cgi-bin/
    ScriptAlias /scgi-bin /usr/local/cpanel/cgi-sys/scgiwrap
    
    
    <Directory "">
        Options 
        AllowOverride 
    </Directory>
    
    <Directory "/usr/local/apache/htdocs">
        Options Includes Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    
    </Directory>
    
    <Files >
        Order 
    
        Satisfy 
    </Files>
    
    <FilesMatch >
        Order 
    
        Satisfy 
    </FilesMatch>
    
    <IfModule >
    
    
        <IfModule >
    
        </IfModule>
    
    </IfModule>
    
    <IfModule >
    
    </IfModule>
    
    <Directory "">
        AllowOverride 
        Options 
        Order 
    
    </Directory>
    
    <IfModule >
        TypesConfig 
    
    </IfModule>
    
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    #   Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the       #
    #   configuration file. To have modifications retained, all modifications must be checked into the              #
    #   configuration system by running:                                                                            #
    #       /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
    #   To see if your changes will be conserved, regenerate the Apache configuration file by running:              #
    #       /usr/local/cpanel/bin/build_apache_conf                                                                 #
    #   and check the configuration file for your alterations. If your changes have been ignored, then they will    #
    #   need to be added directly to their respective template files.                                               #
    #                                                                                                               #
    #   It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf       #
    #   For detailed instructions on using Include files and the apache_conf_distiller with the new configuration   #
    #   system refer to the documentation at: http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html       #
    #                                                                                                               #
    #   This configuration file was built from the following templates:                                             #
    #     /var/cpanel/templates/apache2/main.default                                                                #
    #     /var/cpanel/templates/apache2/main.local                                                                  #
    #     /var/cpanel/templates/apache2/vhost.default                                                               #
    #     /var/cpanel/templates/apache2/vhost.local                                                                 #
    #     /var/cpanel/templates/apache2/ssl_vhost.default                                                           #
    #     /var/cpanel/templates/apache2/ssl_vhost.local                                                             #
    #                                                                                                               #
    #  Templates with the '.local' extension will be preferred over templates with the '.default' extension.        #
    #  The only template updated by the apache_conf_distiller is main.default.                                      #
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    
    
    PidFile logs/httpd.pid
    LockFile logs/accept.lock
    # Defined in /var/cpanel/cpanel.config: apache_port
    Listen 0.0.0.0:80
    User nobody
    Group nobody
    ExtendedStatus On
    ServerAdmin me@mymail.com
    ServerName server.mysite.com
    LogLevel warn
    
    # These can be set in WHM under 'Apache Global Configuration'
    Timeout 300
    
    ServerSignature Off
    
    
    
    <IfModule prefork.c>
    
    
    </IfModule>
    
    
    
    
    
    
    
    RewriteEngine on
    RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
    RewriteLock /usr/local/apache/logs/rewrite_lock
    
    UserDir public_html
    
    # DirectoryIndex is set via the WHM -> Service Configuration -> Apache Setup -> DirectoryIndex Priority
    DirectoryIndex index.php index.php5 index.php4 index.php3 index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.phtml index.shtml index.xhtml index.html index.htm index.wml Default.html Default.htm default.html default.htm home.html home.htm
    
    # SSLCipherSuite can be set in WHM under 'Apache Global Configuration'
    
    SSLPassPhraseDialog  builtin
    SSLSessionCache         dbm:/usr/local/apache/logs/ssl_scache
    SSLSessionCacheTimeout  300
    SSLMutex  file:/usr/local/apache/logs/ssl_mutex
    SSLRandomSeed startup builtin
    SSLRandomSeed connect builtin
    
        # Defined in /var/cpanel/cpanel.config: apache_ssl_port
        Listen 0.0.0.0:443
        AddType application/x-x509-ca-cert .crt
        AddType application/x-pkcs7-crl .crl
    
    
    AddHandler cgi-script .cgi .pl .plx .ppl .perl
    AddHandler server-parsed .shtml
    AddType text/html .shtml
    AddType application/x-tar .tgz
    AddType text/vnd.wap.wml .wml
    AddType image/vnd.wap.wbmp .wbmp
    AddType text/vnd.wap.wmlscript .wmls
    AddType application/vnd.wap.wmlc .wmlc
    AddType application/vnd.wap.wmlscriptc .wmlsc
    
    <Location /whm-server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
    </Location>
    
    
    
    # SUEXEC is supported
    
    Include "/usr/local/apache/conf/includes/pre_virtualhost_global.conf"
    Include "/usr/local/apache/conf/includes/pre_virtualhost_2.conf"
    
    # DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
    NameVirtualHost *
    
    # Default vhost for unbound IPs
    
    <VirtualHost *>
        ServerName host.10gbin.com
        DocumentRoot /usr/local/apache/htdocs
        ServerAdmin bhanuprasad198131@gmail.com
        UserDir disable
    </VirtualHost>
    
    # DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
    
    # SSL
    
    # CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS
    <VirtualHost *>
        ServerName host.10gbin.com
        ServerAlias cpanel.* whm.* webmail.* webdisk.*
        DocumentRoot /usr/local/apache/htdocs
        ServerAdmin bhanuprasad198131@gmail.com
        UserDir disable
        RewriteEngine On
        <IfModule core.c>
            SSLProxyEngine On
        </IfModule>
        RewriteCond %{HTTP_HOST} ^cpanel\.
        RewriteCond %{HTTPS} on
        RewriteRule ^/(.*) https://127.0.0.1:2083/$1 [P]
        RewriteCond %{HTTP_HOST} ^webmail\.
        RewriteCond %{HTTPS} on
        RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]
        RewriteCond %{HTTP_HOST} ^whm\.
        RewriteCond %{HTTPS} on
        RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P]
        RewriteCond %{HTTP_HOST} ^webdisk\.
        RewriteCond %{HTTPS} on
        RewriteRule ^/(.*) https://127.0.0.1:2078/$1 [P]
        RewriteCond %{HTTP_HOST} ^cpanel\.
        RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P]
        RewriteCond %{HTTP_HOST} ^webmail\.
        RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P]
        RewriteCond %{HTTP_HOST} ^whm\.
        RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P]
        RewriteCond %{HTTP_HOST} ^webdisk\.
        RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P]
        UseCanonicalName Off
    </VirtualHost>
    
    
    Include "/usr/local/apache/conf/includes/post_virtualhost_global.conf"
    Include "/usr/local/apache/conf/includes/post_virtualhost_2.conf"
    
    
    # DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
    
    
     
    #3 bhanuprasad1981, Feb 17, 2011
    Last edited: Feb 17, 2011
  4. LinuxTechie

    LinuxTechie Well-Known Member

    Joined:
    Jan 22, 2011
    Messages:
    502
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello,

    I could see a space after <IfModule >. [Space b/w IfModule and > ]. This may cause issue and many tags are like this. If this is causing issue you may have to correct all the tags.
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Please note that it is normally a lot easier to simply include the line that is having the error or a few lines before and after it rather a very large portion of the httpd.conf file. At this point, we now have your email address in what has been provided along with your server's name. I'd highly suggest removing those other lines if at all possible and only providing line line 99 or a few lines around line 99.
     
  6. bhanuprasad1981

    bhanuprasad1981 Well-Known Member

    Joined:
    Aug 5, 2008
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    thanks for letting me know , i have changed email and server name , so any solution for this error ?
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If line 99 is <IfModule > then you should change to <IfModule> instead as cPtechie noted above my reply. I would like to just see lines 97-103 if possible. That would be great to have only those lines.
     
  8. bhanuprasad1981

    bhanuprasad1981 Well-Known Member

    Joined:
    Aug 5, 2008
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    ok here are they :-

    Code:
    </FilesMatch>
    
    <IfModule >
    
    
        <IfModule >
    
    
    

    i tried again to build httpd.conf every time script seems creating such new files nd ending without generating proper file
     
  9. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    We are probably going to have to have you open a ticket in WHM > Support Center > Contact cPanel or using the link in my signature if removing the space doesn't work to generate a working httpd.conf, since it might be that someone has edited an include file and put the wrong information into the include or someone has edited the default template at /var/cpanel/templates/apache2/main.local location (if main.default is copied to main.local and then modified, httpd.conf will build using that modified main.local version).
     
  10. bhanuprasad1981

    bhanuprasad1981 Well-Known Member

    Joined:
    Aug 5, 2008
    Messages:
    222
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    India
    yes my server has issue with that file "main.local" everytime cpanel updates this file is turned into 0 byte file, last time a server tech solved issue by copying main.local from other working server , i tried same but this time i got this error , presently i am using backup copy of httpd.conf to run sites .
     
  11. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    All right, then please open a ticket.
     
Loading...

Share This Page