# [SOLVED]awstat wrong log format

## trondert

--Just changed to logformat=4 in apache2 setup----

----------------------------------------------------------------------

I am trying too get awstats to work with my apache2 web server. I have emerged it, and gotten it to display the awstats.pl page.

But when i try to run 

 *Quote:*   

> media trondert # /usr/share/webapps/awstats/6.5/hostroot/cgi-bin/awstats.pl -config=overmoen.no-ip.info -update

 

I get the following:

 *Quote:*   

> Update for config "/etc/awstats/awstats.overmoen.no-ip.info.conf"
> 
> With data in log file "/var/log/apache2/access_log"...
> 
> Phase 1 : First bypass old records, searching new record...
> ...

 

And i can see the difference in the log entries, but how can i change this? Both configs (apache2/awstats) have  "NCSA apache combined/ELF/XLF log format".

Part of the config for /etc/apache2/httpd.conf:

 *Quote:*   

> #
> 
> # The following directives define some format nicknames for use with
> 
> # a CustomLog directive (see below).
> ...

 

Should i uncoment any of these? And can i change the order of them? And then get it to be like awstat wants it? Couse i dont use the access.log for anything else then for awstat(when i get it to work that is).

This is how part of my awstat .conf for my domain looks like:

 *Quote:*   

> # Enter here your log format (Must match your web server config. See setup
> 
> # instructions in documentation to know how to configure your web server to
> 
> # have the required log format).
> ...

 

Someone else been here? Or know if changing my log settings in apache would fixs this?

Hope someone can give me a "nudge" in the right direction.

-TrondertLast edited by trondert on Thu Dec 22, 2005 1:03 pm; edited 1 time in total

----------

## magic919

You need an Apache directive like this

CustomLog logs/access_log combined

----------

## trondert

Entered this into the awstats config file, but no luck.

Oh, and i had to have it like CustomLog="logs/access_log combined"

or i got an syntax error msg when i tried it.

But still the same error msg.

----------

## trondert

I still can´t shake the feeling that this needs some editing:

/etc/apache2/httpd.conf

 *Quote:*   

> 
> 
> #
> 
> # The following directives define some format nicknames for use with
> ...

 

Should all of the LogFormat be uncommented? Does it use all of them? Or is it one of them i need, and the rest can be commented out?

(Updating MySQL right now, so cant edit and test yet)

----------

## magic919

It's an Apache directive.  You need to stick it in the Apache config file where the host is defined.

The bits you are keen to edit are just definitions of the log format (as it says above them).

Mine is slightly different, but it may be another Apache version.

```
#

# 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

LogFormat "%{Referer}i -> %U" referer

LogFormat "%{User-agent}i" agent

LogFormat "%v %h %l %u %t \"%r\" %>s %b %T" script

LogFormat "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" VLOG=%{VLOG}e" vhost

# 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

#

# 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

```

----------

