httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jayson Strudwick" <>
Subject Re: SetEnvIf Woes
Date Fri, 30 Nov 2001 15:04:20 GMT
> Jayson Strudwick wrote:
> > 
> > I have checked the documentation numerous times,
> > I have looked at examples provided online, and for
> > some reason I still can not get the SetEnvIf directive
> > to work as I expected it to.
> > 
> > I have a directory password protected via an .htaccess
> > file using the mod_auth directives, that all works fine.
> > 
> > What I am playing around with is logging authenticated
> > requests to the server to one logfile, and all the rest
> > to a second logfile. I am attempting to use the following
> > within the VirtualHost definition.
> >         ....
> >         SetEnvIfNoCase REMOTE_USER "<username>" login
> >         CustomLog logfile_auth combined env=login
> >         CustomLog logfile combined env=!login
> >         ....
> I've not used this directive before, but there seems to be a case-error:
> "REMOTE_USER" should be "Remote_User". 
> Also, you're not using these directives in a .htaccess file are you? If
> so, they can't go there (well, SetEnvIfNoCase can but CustomLog can't).
> try the whole shebang in httpd.conf.
> Rgds,
> Owen Boyle.

I had tried it both upper and lower case, then I looked at the source
for SetEnvIf and found out that it doesn't matter, it uses a case
insensitive comparison.

Line 271 of setenvif.c:

        else if (!strcasecmp(fname, "remote_user")) {
            new->special_type = SPECIAL_REMOTE_USER;

I am using these directives inside a VirtualHost definition, which is
in turn inside the server config file. The current problem is that all
information is logging to one file, not being seperated into two.

Jayson Strudwick

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message