Solved

Problem with AWStats for Apache in Windows

Posted on 2011-09-02
6
826 Views
Last Modified: 2012-05-12
Hello everyone,

I'm getting a couple errors with AWStats that I'm not 100% sure what's going on.

The first is it doesn't like my log format... it was set as log format type 1 because it's apache but I realized I had to do a custom.

So here's what my server is logging it as ....

192.168.1.1 - - [01/Sep/2011:09:35:20 -0700] "GET /about.cgi HTTP/1.1" 200 8015

So I have the logformat as

LogFormat= "%host %time1 %methodurl %code %bytesd"

However I'm getting this error


C:\Program Files (x86)\AWStats\wwwroot\cgi-bin>perl awstats.pl -update -config=www.metascan-online.com
Create/Update database for config "./awstats.www.metascan-online.com.conf" by AWStats version 7.0 (build 1.971)
From data in log file "C:\Program Files (x86)\Apache Software Foundation\Apache2.2\logs\access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
AWStats did not find any valid log lines that match your LogFormat parameter, in the 50th first non commented lines read
 of your log.
Your log file C:\Program Files (x86)\Apache Software Foundation\Apache2.2\logs\access.log must have a bad format or LogF
ormat parameter setup does not match this format.
Your AWStats LogFormat parameter is:
%host %time1 %methodurl %code
This means each line in your web server log file need to have the following personalized log format:
%host %time1 %methodurl %code
And this is an example of records AWStats found in your log file (the record number 50 in your log):
192.168.1.1 - - [18/Aug/2011:09:19:19 -0700] "GET /img/menu-bg.png HTTP/1.0" 200 3216
Setup ('./awstats.www.metascan-online.com.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).


As you can see I'm throwing some second error at the bottom... I've added permissions to both the logfile as well as the .conf file to make sure that they are readable by everyone.

Any ideas?? Thanks!
0
Comment
Question by:it_opswat
  • 3
  • 2
6 Comments
 
LVL 30

Expert Comment

by:IanTh
ID: 36477514
could it be a permission problem can you explore the log file manually
0
 
LVL 9

Expert Comment

by:parparov
ID: 36478083
Your AWStats LogFormat parameter is:
%host %time1 %methodurl %code

It looks like your LogFormat is also defined elsewhere and is missing bytesd parameter which is mandatory for awstats.
0
 
LVL 1

Author Comment

by:it_opswat
ID: 36490785
Thanks guys.

And my bad parparov I accidentally pasted the wrong text. I had tried removing %bytesd to test and see what happened but it showed me exactly the same screen but with %bytesd on the end. So I'm pretty sure I built the customformat properly. I can manually read & edit the conf files and everything with the permissions I've set Any other ideas?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:it_opswat
ID: 36490966
See same output with %bytsed in there as well.. I'm kind of at a loss. I don't ever use AWStats on Windows.

 C:\Program Files (x86)\AWStats\wwwroot\cgi-bin>perl awstats.pl -update -config=www.metascan-online.com
Create/Update database for config "./awstats.www.metascan-online.com.conf" by AW
Stats version 7.0 (build 1.971)
From data in log file "C:\Program Files (x86)\Apache Software Foundation\Apache2
.2\logs\access.log"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
AWStats did not find any valid log lines that match your LogFormat parameter, in
 the 50th first non commented lines read of your log.
Your log file C:\Program Files (x86)\Apache Software Foundation\Apache2.2\logs\a
ccess.log must have a bad format or LogFormat parameter setup does not match thi
s format.
Your AWStats LogFormat parameter is:
%host %time1 %methodurl %code %bytesd
This means each line in your web server log file need to have the following pers
onalized log format:
%host %time1 %methodurl %code %bytesd
And this is an example of records AWStats found in your log file (the record num
ber 50 in your log):
89.73.151.163 - - [18/Aug/2011:09:19:19 -0700] "GET /img/menu-bg.png HTTP/1.0" 2
00 3216
Setup ('./awstats.www.metascan-online.com.conf' file, web server or permissions)
 may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).
0
 
LVL 9

Accepted Solution

by:
parparov earned 500 total points
ID: 36491221
Your log format, in Apache, appears to be standard NCSA logging which corresponds to AWSTATS
LogFormat=4 # (frequent setting)
or for more detailed setting, to:
LogFormat="%host %other %logname %time1 %methodurl %code %bytesd"
Please note that the first two dashes that you probably missed, are the 'other' and the 'logname', that usually indicate the http session USER and GROUP being logged.
You may patch your Apache config file to log differently.

You may find more at:
http://awstats.sourceforge.net/docs/awstats_faq.html#PERSONALIZEDLOG
0
 
LVL 1

Author Closing Comment

by:it_opswat
ID: 36491313
That was it... Thank you very much my good sir!!
0

Featured Post

Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question