Solved

Problem with AWStats for Apache in Windows

Posted on 2011-09-02
6
787 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
Comment Utility
could it be a permission problem can you explore the log file manually
0
 
LVL 9

Expert Comment

by:parparov
Comment Utility
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
Comment Utility
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:it_opswat
Comment Utility
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
Comment Utility
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
Comment Utility
That was it... Thank you very much my good sir!!
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

To effectively work with Diskpart on a Server Core, it is necessary to write some small batch script's, because you can't execute diskpart in a remote powershell session. To get startet, place the Diskpart batch script's into a share on your loca…
I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now