You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Richard de Vries <ri...@yahoo.com> on 2006/02/05 02:26:24 UTC

[users@httpd] CustomLog logs/access_log combined not working from within

I am having the weirdest problem. Running Apache
2.0.55 on Solaris 9, I am unable to get Apache to
generate and write to the access_log file while the
CustomLog directive is  enclosed in the <IfModule>
</IfModule> tags.

This is what I have:

<IfModule log_config_module>
    #
    # The following directives define some format
nicknames for use with
    # a CustomLog directive (see below).
    #
    LogFormat "%h %l %u %t \"%r\" %>s %b
\"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    CustomLog logs/access.log combined
</IfModule>

It simply doesn’t work.

If I remove the <IfModule></IfModule> tags, it does
work. I made sure I am loading the log_config_module

LoadModule access_module modules/mod_access.so
LoadModule alias_module modules/mod_alias.so
LoadModule auth_module modules/mod_auth.so
LoadModule dir_module modules/mod_dir.so
LoadModule dumpio_module modules/mod_dumpio.so
LoadModule include_module modules/mod_include.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule log_forensic_module
modules/mod_log_forensic.so
LoadModule logio_module modules/mod_logio.so
LoadModule security_module modules/mod_security.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule unique_id_module modules/mod_unique_id.so

I even proved this to myself by removing the
“LoadModule log_config_module xxx” line, at which
point Apache complains about the CustomLog directive.
So I know the module is loaded.

I tried to reproduce this behavior on my Fedora 4
linux box with Apache 2.0.55 (RPM) and it does the
same thing.

I am not using any virtual hosts and/or SSL, and yes,
the logs and log directory have the appropriate
permissions.

Has anyone seen / experienced this before?

	Richard


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CustomLog logs/access_log combined not working from within

Posted by ht...@karsites.net.
Yes, I checked the module identifier in my httpd.conf file, 
and that's where I came up with the psuedo-solution to your 
problem.

The manual for this module says:

Apache Module mod_log_config

Description: Logging of the requests made to the server
Status: Base
Module Identifier: log_config_module
Source File: mod_log_config.c

It looks like you need to use the full source code filename 
for the <IfModule xyz.c> directive, and not the Module 
identifier.

If you're not sure what name to use, just check the docs 
for the source file name for a particular module. Hopefully, 
that will stop any future problems like this occuring.

You probably don't need to clutter your httpd.conf file with 
<IfModule> directives anyway, once you know what modules you 
intend to keep using.

You could comment out any unused LoadModule directives for 
your DSO's, and uncomment them when you want to add them to 
your configuration file, with the appropriate directives.

Regards

Keith

In theory, theory and practice are the same;
In practice they are not. 

On Sun, 5 Feb 2006, Richard de Vries wrote:

> To: users@httpd.apache.org From: Richard de Vries 
> <ri...@yahoo.com> Subject: Re: [users@httpd] 
> CustomLog logs/access_log combined not working from
>      within <IfModule log_config_module></IfModule>
> 
> Ok .. sorry, my mistake.
> 
> Your suggestion of adding .c did work, but not when
> applying it to the module alias .. DUH.
> 
> so this does not work:
> 
>     <IfModule log_config_module.c>
> 
> but this DOES work:
> 
>     <IfModule mod_log_config.c>
> 
> Do you happen to know why this is?. Why do some
> <IfModule> statements work fine on the module
> name/alias, and others require it to be the
> "mod_real_name.c" ?
> 
> --- Richard de Vries <ri...@yahoo.com>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CustomLog logs/access_log combined not working from within

Posted by Richard de Vries <ri...@yahoo.com>.
Ok .. sorry, my mistake.

Your suggestion of adding .c did work, but not when
applying it to the module alias .. DUH.

so this does not work:

    <IfModule log_config_module.c>

but this DOES work:

    <IfModule mod_log_config.c>

Do you happen to know why this is?. Why do some
<IfModule> statements work fine on the module
name/alias, and others require it to be the
"mod_real_name.c" ?

--- Richard de Vries <ri...@yahoo.com>
wrote:

> Hmm ... nope, that didn't work either :(
> 
> Just for fun I used an <IfModule> directive from an
> other module that is loaded ... i..e <IfModule
> ssl_module> which I know works on other
> configuration
> directives, but as soon as I put it around the
> CustomLog logs/access_log common statement, it does
> the same thing.
> 
> This is absolutely bizarre!. It's almost as if the
> "CustomLog" configuration variable simply does not
> work when placed within <IfModule></IfModule>
> statements.
> 
> --- httpd2@karsites.net wrote:
> 
> > 
> > Try adding .c to the directive. This is probably
> > where 
> > your problem lies.
> > 
> > > This is what I have:
> > >
> > > <IfModule log_config_module>
> > 
> > <IfModule log_config_module.c>
> > 
> > Keith
> > 
> > 
> > In theory, theory and practice are the same;
> > In practice they are not. 
> > 
> > On Sat, 4 Feb 2006, Richard de Vries wrote:
> > 
> > > To: users@httpd.apache.org
> > > From: Richard de Vries
> <ri...@yahoo.com>
> > > Subject: [users@httpd] CustomLog logs/access_log
> > combined not working from
> > >     within <IfModule
> log_config_module></IfModule>
> > > 
> > > I am having the weirdest problem. Running Apache
> > > 2.0.55 on Solaris 9, I am unable to get Apache
> to
> > > generate and write to the access_log file while
> > the
> > > CustomLog directive is  enclosed in the
> <IfModule>
> > > </IfModule> tags.
> > > 
> > > This is what I have:
> > > 
> > > <IfModule log_config_module>
> > >     #
> > >     # The following directives define some
> format
> > > nicknames for use with
> > >     # a CustomLog directive (see below).
> > >     #
> > >     LogFormat "%h %l %u %t \"%r\" %>s %b
> > > \"%{Referer}i\" \"%{User-Agent}i\"" combined
> > >     LogFormat "%h %l %u %t \"%r\" %>s %b" common
> > > 
> > >     CustomLog logs/access.log combined
> > > </IfModule>
> > > 
> > > It simply doesn’t work.
> > > 
> > > If I remove the <IfModule></IfModule> tags, it
> > does
> > > work. I made sure I am loading the
> > log_config_module
> > > 
> > > LoadModule access_module modules/mod_access.so
> > > LoadModule alias_module modules/mod_alias.so
> > > LoadModule auth_module modules/mod_auth.so
> > > LoadModule dir_module modules/mod_dir.so
> > > LoadModule dumpio_module modules/mod_dumpio.so
> > > LoadModule include_module modules/mod_include.so
> > > LoadModule log_config_module
> > modules/mod_log_config.so
> > > LoadModule log_forensic_module
> > > modules/mod_log_forensic.so
> > > LoadModule logio_module modules/mod_logio.so
> > > LoadModule security_module
> modules/mod_security.so
> > > LoadModule mime_module modules/mod_mime.so
> > > LoadModule rewrite_module modules/mod_rewrite.so
> > > LoadModule ssl_module modules/mod_ssl.so
> > > LoadModule unique_id_module
> > modules/mod_unique_id.so
> > > 
> > > I even proved this to myself by removing the
> > > “LoadModule log_config_module xxx” line, at
> which
> > > point Apache complains about the CustomLog
> > directive.
> > > So I know the module is loaded.
> > > 
> > > I tried to reproduce this behavior on my Fedora
> 4
> > > linux box with Apache 2.0.55 (RPM) and it does
> the
> > > same thing.
> > > 
> > > I am not using any virtual hosts and/or SSL, and
> > yes,
> > > the logs and log directory have the appropriate
> > > permissions.
> > > 
> > > Has anyone seen / experienced this before?
> > > 
> > > 	Richard
> > > 
> > > 
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around 
> > > http://mail.yahoo.com 
> > > 
> > >
> >
>
---------------------------------------------------------------------
> > > The official User-To-User support forum of the
> > Apache HTTP Server Project.
> > > See <URL:http://httpd.apache.org/userslist.html>
> > for more info.
> > > To unsubscribe, e-mail:
> > users-unsubscribe@httpd.apache.org
> > >    "   from the digest:
> > users-digest-unsubscribe@httpd.apache.org
> > > For additional commands, e-mail:
> > users-help@httpd.apache.org
> > > 
> > > 
> > >
>
---------------------------------------------------------------------
> > The official User-To-User support forum of the
> > Apache HTTP Server Project.
> > See <URL:http://httpd.apache.org/userslist.html>
> for
> > more info.
> > To unsubscribe, e-mail:
> > users-unsubscribe@httpd.apache.org
> >    "   from the digest:
> > users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail:
> users-help@httpd.apache.org
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
>
---------------------------------------------------------------------
> The official User-To-User support forum of the
> Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for
> more info.
> To unsubscribe, e-mail:
> users-unsubscribe@httpd.apache.org
>    "   from the digest:
> users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail:
> users-help@httpd.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CustomLog logs/access_log combined not working from within

Posted by Richard de Vries <ri...@yahoo.com>.
Hmm ... nope, that didn't work either :(

Just for fun I used an <IfModule> directive from an
other module that is loaded ... i..e <IfModule
ssl_module> which I know works on other configuration
directives, but as soon as I put it around the
CustomLog logs/access_log common statement, it does
the same thing.

This is absolutely bizarre!. It's almost as if the
"CustomLog" configuration variable simply does not
work when placed within <IfModule></IfModule>
statements.

--- httpd2@karsites.net wrote:

> 
> Try adding .c to the directive. This is probably
> where 
> your problem lies.
> 
> > This is what I have:
> >
> > <IfModule log_config_module>
> 
> <IfModule log_config_module.c>
> 
> Keith
> 
> 
> In theory, theory and practice are the same;
> In practice they are not. 
> 
> On Sat, 4 Feb 2006, Richard de Vries wrote:
> 
> > To: users@httpd.apache.org
> > From: Richard de Vries <ri...@yahoo.com>
> > Subject: [users@httpd] CustomLog logs/access_log
> combined not working from
> >     within <IfModule log_config_module></IfModule>
> > 
> > I am having the weirdest problem. Running Apache
> > 2.0.55 on Solaris 9, I am unable to get Apache to
> > generate and write to the access_log file while
> the
> > CustomLog directive is  enclosed in the <IfModule>
> > </IfModule> tags.
> > 
> > This is what I have:
> > 
> > <IfModule log_config_module>
> >     #
> >     # The following directives define some format
> > nicknames for use with
> >     # a CustomLog directive (see below).
> >     #
> >     LogFormat "%h %l %u %t \"%r\" %>s %b
> > \"%{Referer}i\" \"%{User-Agent}i\"" combined
> >     LogFormat "%h %l %u %t \"%r\" %>s %b" common
> > 
> >     CustomLog logs/access.log combined
> > </IfModule>
> > 
> > It simply doesn’t work.
> > 
> > If I remove the <IfModule></IfModule> tags, it
> does
> > work. I made sure I am loading the
> log_config_module
> > 
> > LoadModule access_module modules/mod_access.so
> > LoadModule alias_module modules/mod_alias.so
> > LoadModule auth_module modules/mod_auth.so
> > LoadModule dir_module modules/mod_dir.so
> > LoadModule dumpio_module modules/mod_dumpio.so
> > LoadModule include_module modules/mod_include.so
> > LoadModule log_config_module
> modules/mod_log_config.so
> > LoadModule log_forensic_module
> > modules/mod_log_forensic.so
> > LoadModule logio_module modules/mod_logio.so
> > LoadModule security_module modules/mod_security.so
> > LoadModule mime_module modules/mod_mime.so
> > LoadModule rewrite_module modules/mod_rewrite.so
> > LoadModule ssl_module modules/mod_ssl.so
> > LoadModule unique_id_module
> modules/mod_unique_id.so
> > 
> > I even proved this to myself by removing the
> > “LoadModule log_config_module xxx” line, at which
> > point Apache complains about the CustomLog
> directive.
> > So I know the module is loaded.
> > 
> > I tried to reproduce this behavior on my Fedora 4
> > linux box with Apache 2.0.55 (RPM) and it does the
> > same thing.
> > 
> > I am not using any virtual hosts and/or SSL, and
> yes,
> > the logs and log directory have the appropriate
> > permissions.
> > 
> > Has anyone seen / experienced this before?
> > 
> > 	Richard
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> > http://mail.yahoo.com 
> > 
> >
>
---------------------------------------------------------------------
> > The official User-To-User support forum of the
> Apache HTTP Server Project.
> > See <URL:http://httpd.apache.org/userslist.html>
> for more info.
> > To unsubscribe, e-mail:
> users-unsubscribe@httpd.apache.org
> >    "   from the digest:
> users-digest-unsubscribe@httpd.apache.org
> > For additional commands, e-mail:
> users-help@httpd.apache.org
> > 
> > 
> >
---------------------------------------------------------------------
> The official User-To-User support forum of the
> Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for
> more info.
> To unsubscribe, e-mail:
> users-unsubscribe@httpd.apache.org
>    "   from the digest:
> users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail:
users-help@httpd.apache.org


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CustomLog logs/access_log combined not working from within

Posted by ht...@karsites.net.
Try adding .c to the directive. This is probably where 
your problem lies.

> This is what I have:
>
> <IfModule log_config_module>

<IfModule log_config_module.c>

Keith


In theory, theory and practice are the same;
In practice they are not. 

On Sat, 4 Feb 2006, Richard de Vries wrote:

> To: users@httpd.apache.org
> From: Richard de Vries <ri...@yahoo.com>
> Subject: [users@httpd] CustomLog logs/access_log combined not working from
>     within <IfModule log_config_module></IfModule>
> 
> I am having the weirdest problem. Running Apache
> 2.0.55 on Solaris 9, I am unable to get Apache to
> generate and write to the access_log file while the
> CustomLog directive is  enclosed in the <IfModule>
> </IfModule> tags.
> 
> This is what I have:
> 
> <IfModule log_config_module>
>     #
>     # The following directives define some format
> nicknames for use with
>     # a CustomLog directive (see below).
>     #
>     LogFormat "%h %l %u %t \"%r\" %>s %b
> \"%{Referer}i\" \"%{User-Agent}i\"" combined
>     LogFormat "%h %l %u %t \"%r\" %>s %b" common
> 
>     CustomLog logs/access.log combined
> </IfModule>
> 
> It simply doesn’t work.
> 
> If I remove the <IfModule></IfModule> tags, it does
> work. I made sure I am loading the log_config_module
> 
> LoadModule access_module modules/mod_access.so
> LoadModule alias_module modules/mod_alias.so
> LoadModule auth_module modules/mod_auth.so
> LoadModule dir_module modules/mod_dir.so
> LoadModule dumpio_module modules/mod_dumpio.so
> LoadModule include_module modules/mod_include.so
> LoadModule log_config_module modules/mod_log_config.so
> LoadModule log_forensic_module
> modules/mod_log_forensic.so
> LoadModule logio_module modules/mod_logio.so
> LoadModule security_module modules/mod_security.so
> LoadModule mime_module modules/mod_mime.so
> LoadModule rewrite_module modules/mod_rewrite.so
> LoadModule ssl_module modules/mod_ssl.so
> LoadModule unique_id_module modules/mod_unique_id.so
> 
> I even proved this to myself by removing the
> “LoadModule log_config_module xxx” line, at which
> point Apache complains about the CustomLog directive.
> So I know the module is loaded.
> 
> I tried to reproduce this behavior on my Fedora 4
> linux box with Apache 2.0.55 (RPM) and it does the
> same thing.
> 
> I am not using any virtual hosts and/or SSL, and yes,
> the logs and log directory have the appropriate
> permissions.
> 
> Has anyone seen / experienced this before?
> 
> 	Richard
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
>