Solved

Problem with AWStats for Apache in Windows

Posted on 2011-09-02
6
794 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

[Webinar] Disaster Recovery and Cloud Management

Learn from Unigma and CloudBerry industry veterans which providers are best for certain use cases and how to lower cloud costs, how to grow your Managed Services practice in IaaS clouds, and how to utilize public cloud for Disaster Recovery

Question has a verified solution.

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

In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
OfficeMate Freezes on login or does not load after login credentials are input.
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 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…

863 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

26 Experts available now in Live!

Get 1:1 Help Now