You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Robert Schoultz <ro...@gmail.com> on 2013/05/24 13:52:56 UTC

[users@httpd] Apache 2.2.22 Win32 CustomLog problem

Hello!

I have a small problem with my Apache configuration. I am trying to
use the "combined" CustomLog directive and it simply wont work and I
have no clue why. I have made sure modules are loaded and that there
isn't another CustomLog overriding the combined one. Here's a paste of
all the information I believe is the most important related to this
topic(everything is sort of default) and sorry for the messy text
structure:

[httpd.conf]

...
LoadModule log_config_module modules/mod_log_config.so   <---- OK
...

<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

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

    #
    # The location and format of the access logfile (Common Logfile Format).
    # If you do not define any access logfiles within a <VirtualHost>
    # container, they will be logged here.  Contrariwise, if you *do*
    # define per-<VirtualHost> access logfiles, transactions will be
    # logged therein and *not* in this file.
    #
    #CustomLog "logs/access.log" common   <--- note #

    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    CustomLog "logs/access.log" combined
</IfModule>

[/httpd.conf]



Checking to see if the log_config_module is actually loaded:


C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin>httpd
-t -D DUMP_MODULES
Loaded Modules:
 core_module (static)
 win32_module (static)
 mpm_winnt_module (static)
 http_module (static)
 so_module (static)
 actions_module (shared)
 alias_module (shared)
 asis_module (shared)
 auth_basic_module (shared)
 authn_default_module (shared)
 authn_file_module (shared)
 authz_default_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cgi_module (shared)
 dir_module (shared)
 env_module (shared)
 include_module (shared)
 isapi_module (shared)
 log_config_module (shared)       <------------- OK
 mime_module (shared)
 negotiation_module (shared)
 setenvif_module (shared)
 php5_module (shared)
Syntax OK


It still won't log referer/user-agent into the log files (access.log)
:(. What am I missing? I've had it working many years ago on another
machine and I don't remember doing anything out of the ordinary to get
it to work.

Thanks in advance!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2.22 Win32 CustomLog problem

Posted by Robert Schoultz <ro...@gmail.com>.
I am editing httpd.conf in the "conf" directory as administrator, as I
said, I have disabled UAC and my account is an administrator account
so it will always run everything through my account unless specified
otherwise.
I have already confirmed that Apache is using httpd.conf in the "conf"
directory because I've done other changes to the config file and those
changes do show.

To avoid any further confusion about user-rights:
httpd.exe is running as one of the built-in accounts that comes with
Windows called SYSTEM (through Services). Checking Apache's folder
rights confirms that SYSTEM has full rights, so in other words,
httpd.exe (Apache server) has full rights to its folder, all sub
folders and files. Reading and writing is no problem.

So to summarize it all:

1) I am running an administrator account, all applications I launch
will always be run through my account unless specified otherwise.
Saving httpd.conf is not a problem, even if there would be a problem,
my text editing program would have told me it was unable to write to
the file.
2) httpd.exe (Apache server) is being run with the account SYSTEM
which has full rights to the Apache server's folder, sub folders and
all files by default.
3) Apache server is using httpd.conf inside the "conf" dir, it is confirmed.
4) Apache has loaded log_config_module.
5) CustomLog "combined" directive is not being overridden.

On Fri, May 24, 2013 at 2:26 PM, Eric Covener <co...@gmail.com> wrote:
> On Fri, May 24, 2013 at 8:19 AM, Robert Schoultz <ro...@gmail.com> wrote:
>> I'm not sure what you mean by file system redirection. And if we go
>> back to your previous post, I can edit access.log just fine, infact,
>> it's around 4 mb big from all the logging.
>> So Apache do have full rights to the log files and I don't see the
>> logical reason to why Apache wouldn't be able to add a
>> referer/user-agent when it can already fill the log file with
>> everything else. I'm a bit confused by your answer :S.
>
> The server might see a different httpd.conf then you do. Try editing
> it as Administrator.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2.22 Win32 CustomLog problem

Posted by Eric Covener <co...@gmail.com>.
On Fri, May 24, 2013 at 8:19 AM, Robert Schoultz <ro...@gmail.com> wrote:
> I'm not sure what you mean by file system redirection. And if we go
> back to your previous post, I can edit access.log just fine, infact,
> it's around 4 mb big from all the logging.
> So Apache do have full rights to the log files and I don't see the
> logical reason to why Apache wouldn't be able to add a
> referer/user-agent when it can already fill the log file with
> everything else. I'm a bit confused by your answer :S.

The server might see a different httpd.conf then you do. Try editing
it as Administrator.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2.22 Win32 CustomLog problem

Posted by Robert Schoultz <ro...@gmail.com>.
I'm not sure what you mean by file system redirection. And if we go
back to your previous post, I can edit access.log just fine, infact,
it's around 4 mb big from all the logging.
So Apache do have full rights to the log files and I don't see the
logical reason to why Apache wouldn't be able to add a
referer/user-agent when it can already fill the log file with
everything else. I'm a bit confused by your answer :S.

On Fri, May 24, 2013 at 2:13 PM, Eric Covener <co...@gmail.com> wrote:
> On Fri, May 24, 2013 at 7:58 AM, Robert Schoultz <ro...@gmail.com> wrote:
>> Hello Eric. I am on Windows 7 so I guess that's vista-like. The first
>> thing I do when I install an OS such as Windows 7, is to disable UAC
>> alltogether, so no need for all the "run as administrator" stuff as it
>> will always run everything as administrator!
>
> Are you sure the file system redirection is turned off when you turn
> off UAC?  It may be separate and explains your symptom.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2.22 Win32 CustomLog problem

Posted by Eric Covener <co...@gmail.com>.
On Fri, May 24, 2013 at 7:58 AM, Robert Schoultz <ro...@gmail.com> wrote:
> Hello Eric. I am on Windows 7 so I guess that's vista-like. The first
> thing I do when I install an OS such as Windows 7, is to disable UAC
> alltogether, so no need for all the "run as administrator" stuff as it
> will always run everything as administrator!

Are you sure the file system redirection is turned off when you turn
off UAC?  It may be separate and explains your symptom.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2.22 Win32 CustomLog problem

Posted by Robert Schoultz <ro...@gmail.com>.
Hello Eric. I am on Windows 7 so I guess that's vista-like. The first
thing I do when I install an OS such as Windows 7, is to disable UAC
alltogether, so no need for all the "run as administrator" stuff as it
will always run everything as administrator!

On Fri, May 24, 2013 at 1:56 PM, Eric Covener <co...@gmail.com> wrote:
> If you're on a vista-like OS, try editing the file as the real Administrator.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Apache 2.2.22 Win32 CustomLog problem

Posted by Eric Covener <co...@gmail.com>.
If you're on a vista-like OS, try editing the file as the real Administrator.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org