Koozali.org: home of the SME Server

AwStats 5.x and SME

Jesper

AwStats 5.x and SME
« on: November 30, 2002, 06:09:23 PM »
Hi there,

Does anyone have an easy way to use AWStats 5.x with an SME 5.5 server ? I have used the contributed RPMs provided by Neddix (http://www.neddix.de/e-smith/misc/awstats.php) with great pleassure but would like to use/see the new features in 5.x.

Any clues ?

Thanks,
Jesper

Nathan Fowler

Re: AwStats 5.x and SME
« Reply #1 on: December 02, 2002, 11:51:44 PM »
Compile it from source code.  It's easy and very effortless.

Jesper

Re: AwStats 5.x and SME
« Reply #2 on: December 03, 2002, 02:04:48 AM »
Did you create and RPM that you would like to share or did you just know where to place the various updated perl files ?

/Jesper

Nathan Fowler

Re: AwStats 5.x and SME
« Reply #3 on: December 03, 2002, 06:30:21 AM »
I just read the installation instructions and didn't have a problem.

Nathan Fowler

Re: AwStats 5.x and SME
« Reply #4 on: December 03, 2002, 06:32:56 AM »
Note I did have to install perl-gd and libpng.  From what I remember, I got most of these from the links listed in the installation documentation, or I was able to apply the necessary RPMs from http://www.rpmfind.net using the correct RH base for my SME box.

Jesper Knudsen

Re: AwStats 5.x and SME
« Reply #5 on: December 03, 2002, 05:10:44 PM »
I have now tried it out an reached the stage where I have to issue the update command. I have configured similar to the old versions that I found in the Admin's home dir. The old conf file states that the LogFile is ="-" !!??

It reached to:
[root@server cgi-bin]# perl awstats.pl -config=www.swerts-knudsen.com -update
Update for config 'awstats.www.swerts-knudsen.com.conf'
With data in log file '-'...
Phase 1 : First bypass old records...

And never gets any further (even after 1 hour)

I am a little in doubt on where the log file is located. I have tried the /var/log/httpd/access_log file but AWStats complain about the format.

[root@server cgi-bin]# perl awstats.pl -config=www.swerts-knudsen.com -update
Update for config 'awstats.www.swerts-knudsen.com.conf'
With data in log file '/var/log/httpd/access_log'...
Phase 1 : First bypass old records...
AWStats did not found any valid log lines that match your LogFormat parameter, in the 50th first non
 commented lines read of your log.
Your log file /var/log/httpd/access_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/f
rom.htm" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
And this is a sample of records AWStats found in your log file (the record number 50 in your log):
www.swerts-knudsen.dk 192.168.212.65 - - [01/Dec/2002:01:44:03 +0100] "GET /mrtg/system/kontor.cpu.h
tml HTTP/1.1" 304 - "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
Setup ('awstats.www.swerts-knudsen.com.conf' file, web server or permissions) may be wrong.
See AWStats documentation in 'docs' directory for informations on how to setup awstats.

Any good suggestions ?

Thanks,
Jesper

Nathan Fowler

Re: AwStats 5.x and SME
« Reply #6 on: December 03, 2002, 06:36:38 PM »
If you don't want to modify your logformat values in httpd.conf then you can try this program instead:  http://www.analog.cx/

Use this logformat directive with analog:
APACHELOGFORMAT (%v %h %l %u %t \"%r\" %>s %b\"%{Referer}i\" \"%{User-Agent}i\")

You may also be able to translate that analog logformat directive to AwStats, by referencing http://awstats.sourceforge.net/docs/awstats_config.html#LogFormat

According to the AwStats documentation, you will need to change your LogFormat directive in apache to have NCSA combined/XLF/ELF log format, or pass a custom declaraction for your logformat syntax.  Look in your httpd.conf and create a custom log format directive.

Jesper Knudsen

Re: AwStats 5.x and SME
« Reply #7 on: December 04, 2002, 02:03:32 PM »
I finally figured out what to state in the LogFormat paramter to use the log format which is in e-smith by default.

Running Awstars as a CGI script does everything that I wanted.

Thanks a lot for your help.

I think I will generate a small HowTo on this. I am sure I cannot be the only one liking AWStats.

Thanks,
Jesper

Jesper Knudsen

Re: AwStats 5.x and SME
« Reply #8 on: December 07, 2002, 12:35:18 AM »
Did the HowTo if anyone would like it. I recommend removing the RPM before (not that they conflict).

http://www.swerts-knudsen.dk/sme.htm#How to Install AWStats Web Statistics

/Jesper

lowell

Re: AwStats 5.x and SME
« Reply #9 on: December 20, 2002, 09:48:46 PM »
Jasper,

What version of AWStats are you currently running.  I have spent the last day working at the latest version - 5.1 - trying to make it work, and it is just not happening.
It's like it's not reading the log file, and not finding the icon's either.  I have made every possible change I  could think of.  I used to run webalizer, but the upgrade to SME 5.5 shut it down, and I'd rather see what AW Stats has to show.
Thanks for any help.

Lowell

Jesper Knudsen

Re: AwStats 5.x and SME
« Reply #10 on: December 20, 2002, 10:10:32 PM »
I am actually using 5.3 beta right now but the HowTo was made by use of 5.2 (the latest stable when I installed).

Have you followed the Howto and installed it in an Ibay ?

Rgds,
Jesper

lowell

Re: AwStats 5.x and SME
« Reply #11 on: December 20, 2002, 10:39:29 PM »
Yes, it is in an Ibay.  Followed the install instructions to the letter.  
Could we have a permissions problem?  Or maybe a bad download of the zip?
Lowell -  

Tom Carroll

Re: AwStats 5.x and SME
« Reply #12 on: December 22, 2002, 08:13:00 AM »
Lowell, I looked over Jasper's how-to and it looks fine except one line:

DirIcons="/awstats/icon"

I think, according to the instructions provided higher up in the how-to it should read:

DirIcons="/awstats/html/icon"

Now this will only fix the icon problem, if you were having that problem.  I am not running awstats, but thought I would point that out.  It could be that the perl script is stopping because the icon directory doesn't exist.

Do you have anything showing up in the error log?

What are the file perms on the access_log?

Tom

Tom Carroll

Re: AwStats 5.x and SME
« Reply #13 on: December 22, 2002, 09:41:01 AM »
I just installed AWStats 5.2 on my SME 5.1.2 server and it works.

I did install the icon directory under the ibay html directory, so that could be the problem causing your setup to not work, unless you did like me and not notice the "Update now" link at the top right. :-)  I had no data when I first brought the page up, but upon clicking the link at the top right and after several minutes it had compiled the data.

One thing I noticed is that it does not go through previous logs, so it looks like it only uses the current log for it's data...

I went through and cat'ed all my log files into one big temporary file called access_log_tmp, changed the entry in the awstats config file, and then deleted the awstats data files and clicked the "Update now" link to compile data from all my logs.

It took *a lot longer* to compile the data, but it reflected everything I had logs for.  I then changed the awstats config file to point to the correct log file.

Hope this helps!

Tom

lowell

Re: AwStats 5.x and SME
« Reply #14 on: December 22, 2002, 06:12:08 PM »
Here is what I found, two things.  The icon's were not showing up because of an FTP transfer problem, simple fix.  The script would not work because of a breakdown somewhere within the server's permissions.  As soon as I ran the script from a command line, and added the "perl" instruction in the front of the command line it worked, but I must do that each and every time.  I believe this - as well as other troubles - results from a disastrous attempt at installing squidguard many months ago.  I have been doing "work arounds" .  What I need to do is a total clean install.  6 I-bays, 5 web sites, and 60+ email addresses has kept me from taking that plunge.

Thanks to you all,
Blessings and the Season's Best to Each and Every One.
Lowell

Tom Carroll

Re: AwStats 5.x and SME
« Reply #15 on: December 22, 2002, 11:07:11 PM »
Hmmm...  Here is what my directories for the ibay, cgi-bin, html show:

[root@server ibays]# ls -al

drwxr-xr-x    10    root    root    4096    Nov 8  22:34    awstats

[root@server awstats]# ls -al

drwxrwsr-x    5    root    shared    4096    Dec 21  22:39    cgi-bin
drwxrwsr-x    3    root    shared    4096    Dec 21  21:25    html

[root@server cgi-bin]# ls -al

-rw-rw-rw-      1    www  shared      44312    Dec 21  22:35    awstats112002.....txt
-rw-rw-rw-      1    www  shared      31209    Dec 21  22:39    awstats122002.....txt
-rwxr-xr-x      1    root   shared     420941    Dec  3  20:54    awstats.pl
-rw-rw-rw-      1    www  shared       9318    Dec 21  22:39    dnscachelastup.....txt

Also the perms for my access_log in /var/log/httpd/

[root@server httpd]# ls -al

lrwxrwxrwx     1   root    root              25    Dec 22  01:12    access_log -> access...

All my access logs have the same perms.

I have not modified any of the permissions and it worked out of the box.

Tom