Current User: Guest Login
Please consider registering


Lost Your Password?

Search Forums:


 






Minimum search word length is 4 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Having problems with Awstats reading the log file.

Reply to Post Add a New Topic
UserPost

3:35 pm
October 13, 2008


albert_newton

Member

posts 30

I  am trying to set up Awstats but when I run the awstats.pl command, it is giving me the error:

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:/WebSphere/AppServer/profiles/AppSrv01/logs/activity.log must have a bad format or LogFormat parameter setup does not match this format
.
Your AWStats LogFormat parameter is:
1
This means each line in your web server log file need to have “combined log format” like this:
111.22.33.44 – - [10/Jan/2001:02:14:14 +0200] “GET / HTTP/1.1″ 200 1234 “http://www.fromserver.com/from.htm” “Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)”
And this is an example of records AWStats found in your log file (the record number 50 in your log):
[invalid characters removed by forum admin]

Setup ('./awstats.AppSrv01.conf' file, web server or permissions) may be wrong.
Check config file, permissions and AWStats documentation (in 'docs' directory).

I am unable to figure out how to solve this problem even after googling around for a solution in that direction. Please point me in the right direction and I will be grateful.

3:57 pm
October 13, 2008


Jean-Luc

Admin

posts 1125

The LogFormat definition in your AWStats config file must match the log format in your web server log file. It seems that AWStats found invalid characters in the file that you designated as log file.

This can be caused by a compressed log file. What is the name of your log file and can you read its content with a standard text editor ?

4:18 pm
October 13, 2008


albert_newton

Member

posts 30

Thanks for the reply. Yeah… it seems like my log file is not in the right format…. I can read it using Notepad, but it is not in a very attractive format.  The name of my log file is activity.log and it is under the folder: 'C:\\WebSphere\\AppServer\\profiles\\AppSrv01\\logs'. The contents of this file get filled by Websphere when I run some tests.

I deleted the file contents ( of activity.log) and now when I run the awstats.pl command( after re-running the tests), it gives me the output:

Update for config “./awstats.AppSrv01.conf”
With data in log file “C:/WebSphere/AppServer/profiles/AppSrv01/logs/activity.log” …
Phase 1 : First bypass old records, searching new record…
Searching new records from beginning of log file…
Jumped lines in file: 0
Parsed lines in file: 2
 Found 0 dropped records,
 Found 2 corrupted records,
 Found 0 old records,
 Found 0 new qualified records.

Which is some improvement, but which reinforces the fact that my log file is not in the correct format since it found 2 corrupted records. Any way around this, so that it can read the records as new records instead of corrupted… ( would I have to change the format of the log file to match the log format definition, and if so is there a way to do that)?

4:28 pm
October 13, 2008


Jean-Luc

Admin

posts 1125

Please paste here a few rows from the log file.

4:41 pm
October 13, 2008


albert_newton

Member

posts 30

This is going to be very unattractive…. here we go:

[activity log file content removed]

5:19 pm
October 13, 2008


Jean-Luc

Admin

posts 1125

You posted lines from the activity log file. As far as I know, this file cannot be analyzed by AWStats.

If you intended to monitor the activity of th web server, you should look for the HTTP server logs (also called Apache log file or access log file).

11:05 am
October 14, 2008


albert_newton

Member

posts 30

Awesome… that was exactly that I needed to do. Now I am able to get it to read the log files ( the access log file for the HTTP server) and generate the statistics by  running from the command window. But I am unable to get the statistics page to display from the web browser. Here are the things that I did:

1.  I set: AllowToUpdateStatsFromBrowser=1 in my awstats.mysite.conf file

2.  I set: SaveDatabaseFilesWithPermissionsForEveryone=1

I tried changing the permission of the C:\\awstats-6.5\\wwwroot directory too but not sure it works. 

Is there something that I am missing?

And this is the url that I am trying to hit from my browser:

http://localhost/awstats/awstats.pl?config=AppSrv01

12:21 pm
October 14, 2008


Jean-Luc

Admin

posts 1125

What error message do you get when you visit this URL ? Can you paste it here ?

You might want to try a very simple Perl script in the same directory first, to determine if the problem is related to AWStats or not.

3:19 pm
October 14, 2008


albert_newton

Member

posts 30

Here's the message:

Not Found

The requested URL /awstats/awstats.pl was not found on this server.

_____________________________________________

IBM_HTTP_Server Server at localhost Port 80

Not sure that I quite have the knowledge or expertise yet to write a sample perl script.

As I mentioned earlier, I was able to build the report in a static HTML page from the command window using the command:

perl awstats.pl -config=mysite -output -staticlinks > awstats.mysite.html

10:35 pm
October 14, 2008


Jean-Luc

Admin

posts 1125

This is a sample Perl script :

#!/usr/bin/perl
print "Content-type: text/html\\n\\n";
print "<H1>Hello World</H1>\\n";

It can be used to check that your  web server is properly configured to run Perl script. On many servers, scripts must tbe located in a cgi-bin  directory.

10:52 am
October 15, 2008


albert_newton

Member

posts 30

I wrote the sample perl script and it runs well from the command window again and gives the output: “<H1>Hello World</H1>\\n”

but running it from the url browser again gives the same error: ( I hope this is how it is to be run):

The url I use is: http://localhost/awstats/sample.pl?config=AppSrv01

The error I get is:

Not Found

The requested URL /awstats/sample.pl was not found on this server.

____________________________________________

IBM_HTTP_Server Server at localhost Port 80

And I put the above mentioned sample script in the C:\\awstats-6.5\\wwwroot\\cgi-bin directory.

2:39 pm
October 15, 2008


Jean-Luc

Admin

posts 1125

If the sample.pl  file is in the cgi-bin directory, the correct URL could be http://localhost/cgi-bin/sample.pl .

8:41 am
October 16, 2008


albert_newton

Member

posts 30

Even though the sample file is in the C:\\awstats-6.5\\wwwroot\\cgi-bin directory,

putting the URL http://localhost/cgi-bin/sample.pl  still gives the following error:

Not Found

The requested URL /cgi-bin/sample.pl was not found on this server.

________________________________________

IBM_HTTP_Server Server at localhost Port 80

I was wondering if there is a special configuration required for the web server to be properly configured to run perl script.

9:18 am
October 16, 2008


Jean-Luc

Admin

posts 1125

This is more a question for your hosting company or for your system administrator than an AWStats question.

Check if a script alias is defined in the control panel of the web server or in httpd.conf  (Apache configuration file).

Reply to Post

Reply to Topic:
Having problems with Awstats reading the log file.

Guest Name (Required):

Guest Email (Required):

NOTE: New Posts are subject to administrator approval before being displayed

Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
12 + 5
   


About the InternetOfficer.com Forum

Forum Timezone: UTC 1

Most Users Ever Online: 302

Currently Online:
15 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 2
Forums: 9
Topics: 639
Posts: 2710

Membership:

There are 257 Members
There have been 304 Guests

There is 1 Admin
There is 1 Moderator

Top Posters:

cssfsu – 55
deepakgupta – 34
albert_newton – 30
cosminpana – 20
DTNMike – 19
ahtshun83 – 17

Recent New Members: raju, todd2taylor, sbdcunha, mansigill1987, ThomasDuh, ThomasKic

Administrators: Jean-Luc (1125 Posts)

Moderators: Jean-Luc (1125 Posts)