Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Problem with AWStats for Apache in Windows

Posted on 2011-09-02
6
Medium Priority
?
880 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
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
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 2000 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

Industry Leaders: 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!

Question has a verified solution.

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

A safe way to clean winsxs folder from your windows server 2008 R2 editions
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…

885 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