logformat error in apache

Discussion in 'Server Operation' started by electroISP, Dec 30, 2006.

  1. electroISP

    electroISP New Member

    anyone got this message before?

    Syntax error on line 11 of /etc/apache2/mod_log_config.conf:
    Invalid command 'LogFormat', perhaps misspelled or defined by a module not included in the server configuration

    cannot start apache2 at the moment here is the mod_log_config.conf

    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive.
    #
    # http://httpd.apache.org/docs-2.2/mod/mod_log_config.html
    #

    #
    # Format string: Nickname:
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    LogFormat "%v %h %l %u %t \"%r\" %>s %b" vhost_common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
    LogFormat "%h %l %u %t \"%r\" %>s %b \
    \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%v %h %l %u %t \"%r\" %>s %b \
    \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined

    # To use %I and %O, you need to enable mod_logio
    <IfModule mod_logio.c>
    LogFormat "%h %l %u %t \"%r\" %>s %b \
    \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>

    # Use one of these when you want a compact non-error SSL logfile on a virtual
    # host basis:
    <IfModule mod_ssl.c>
    Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
    \"%r\" %b" ssl_common
    Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
    \"%r\" %b \"%{Referer}i\" \"%{User-Agent}i\"" ssl_combined
    </IfModule>

    any help would be great, this is a suse linux 10.2 64bit installation, following the how to for ispconfig
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Can you please post the content of the configuration file again, but wrapped in the code tags of the forum, so the line breaks wont get lost.
     
  3. electroISP

    electroISP New Member

    more info and still trouble

    electrohostone:/etc/apache2 # /etc/init.d/apache2 start
    Starting httpd2 (prefork) Syntax error on line 12 of /etc/apache2/mod_log_config.conf:
    Invalid command 'LogFormat', perhaps misspelled or defined by a module not included in the server configuration

    The command line was:
    /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf -DSSL
    failed

    Code:
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive.
    #
    # http://httpd.apache.org/docs-2.2/mod/mod_log_config.html
    #
    
    #
    #         Format string:                                Nickname:
    #
    
    LogFormat "%h %l %u %t \"%r\" %>s %b"                   common
    LogFormat "%v %h %l %u %t \"%r\" %>s %b"                vhost_common
    LogFormat "%{Referer}i -> %U"                           referer
    LogFormat "%{User-agent}i"                              agent
    LogFormat "%h %l %u %t \"%r\" %>s %b \
    \"%{Referer}i\" \"%{User-Agent}i\""                     combined
    LogFormat "%v %h %l %u %t \"%r\" %>s %b \
    \"%{Referer}i\" \"%{User-Agent}i\""                     vhost_combined
    
    
    # To use %I and %O, you need to enable mod_logio
    <IfModule mod_logio.c>
    LogFormat "%h %l %u %t \"%r\" %>s %b \
    \"%{Referer}i\" \"%{User-Agent}i\" %I %O"               combinedio
    </IfModule>
    
    # Use one of these when you want a compact non-error SSL logfile on a virtual
    # host basis:
    <IfModule mod_ssl.c>
    Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
    \"%r\" %b"                                              ssl_common
    Logformat "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \
    \"%r\" %b \"%{Referer}i\" \"%{User-Agent}i\""           ssl_combined
    </IfModule>
    
    it also makes reference to /etc/apache2/system.d/global.conf
    Code:
    GNU nano 1.3.12                             File: global.conf
    
    #
    # Files in this directory are created at apache start time by /usr/sbin/rcapache2
    # Do not edit them!
    #
    
    # see /etc/sysconfig/apache2
    
    Timeout 300
    ServerSignature on
    UseCanonicalName off
    ServerTokens OS
    LogLevel warn
    [COLOR="Red"]CustomLog[/COLOR] /var/log/apache2/access_log combined
    
    thanks for reply have tried by adding mod_ssl.c, mod_log_config.c, was wondering if this was anything to do with it, i have taken out the[...] in the middle of the line

    from setup 10.2
    APACHE_MODULES="actions alias auth_basic authn_file [...] setenvif ssl suexec userdir php5 rewrite"
     
  4. falko

    falko Super Moderator Howtoforge Staff

    Is mod_log_config included in your Apache configuration? You should have log_config in the APACHE_MODULES line.
     
  5. electroISP

    electroISP New Member

    log_config is in there

    unfortunately yes, ive tried reloading ssl and compiling another apache2 but both still have trouble, i cna get it past LogFormat, then it has trouble with the mod_mime call AddLanguage, im a little bewildered, will try a complete reinstall, if i have no luck ill repost
    thanks for your time, Happy New year from OZ

    Code:
    # fairly minimal
    # APACHE_MODULES="authz_host alias auth dir log_config mime setenvif"
    #
    # apache's default installation
    # APACHE_MODULES="authz_host actions alias asis auth autoindex cgi dir imap include log_config mime negotiation ssl suexe$
    # your settings
      APACHE_MODULES="actions alias auth_basic authn_file setenvif ssl suexec userdir php5 rewrite log_config"
    
     
  6. electroISP

    electroISP New Member

    life is good again

    didnt have to reinstall, took a little more time to look over the conf files and found a couple of modules missing in the apache_modules line, and also where i had cut and paste out of tutorial the lines had spread over two lines instead of all on one and this was causing grief, anyway lesson learner
    SLOW DOWN and dont get COCKY...
    till next hassle au revoir

    thanks again for time
     
  7. ristow

    ristow New Member

    error Syntax error on line 11 of /etc/apache2/mod_log_config.conf

    Problem wenn running apache:
    /etc/init.d/apache2 start
    or:
    /usr/sbin/rcapache2 restart

    linux-7hrh:/etc # /usr/sbin/rcapache2 restart
    Module "include" is not installed, ignoring.
    Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
    Module "mod_log_config" is not installed, ignoring.
    Check the APACHE_MODULES setting in /etc/sysconfig/apache2.
    Syntax error on line 11 of /etc/apache2/mod_log_config.conf:

    ok, you have a problem loading include and mod_log_config modules. If you take a look at: /etc/apache2/httpd.conf you'll find where the modules are loaded:
    (..)
    # generated from APACHE_MODULES in /etc/sysconfig/apache2
    Include /etc/apache2/sysconfig.d/loadmodule.conf
    (..)

    The file /etc/apache2/sysconfig.d/loadmodule.conf has:
    (...)
    #
    # Files in this directory are created at apache start time by /usr/sbin/rcapache2
    # Do not edit them!
    #
    # as listed in APACHE_MODULES (/etc/sysconfig/apache2)
    LoadModule actions_module /usr/lib/apache2-worker/mod_actions.so
    LoadModule alias_module /usr/lib/apache2-worker/mod_alias.soLoadModule actions_module /usr/lib/apache2-worker/mod_actions.so
    LoadModule alias_module /usr/lib/apache2-worker/mod_alias.so
    LoadModule auth_basic_module /usr/lib/apache2-worker/mod_auth_basic.so
    (...)

    Did you read the comments? , than go to: /etc/sysconfig/apache2:
    (...)
    # your settings
    APACHE_MODULES="actions alias auth_... include mod_log_config"
    (...)

    Now you have a trace of all files and can find out whats wrong.
    In my case the lines:
    LoadModule include_module /usr/lib/apache2-worker/mod_include.so
    LoadModule log_config_module /usr/lib/apache2-worker/mod_log_config.so
    were missed. Of course, for this reason I received the original error message.
    The problem must to be with the file:
    /usr/lib/apache2-worker/mod_include.so
    I deleted it and reinstall apache and everything works again!!!!
    Good Lock for you to!
     

Share This Page