Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

awstats on an apache server..

Thread Tools
 
Search this Thread
 
Old 31 December 2004, 04:42 PM
  #1  
ChristianR
Scooby Regular
Thread Starter
iTrader: (1)
 
ChristianR's Avatar
 
Join Date: May 2001
Location: Europe
Posts: 6,329
Likes: 0
Received 1 Like on 1 Post
Default awstats on an apache server..

anyone ever installed it ?

if so, how did you go about installing it? just the instructions aren't quite what I am expecting.. i.e. no copy x files to webserver to this dir, run this script etc... ?

Last edited by ChristianR; 31 December 2004 at 04:48 PM.
Old 01 January 2005, 10:43 AM
  #2  
judgejules
Scooby Regular
 
judgejules's Avatar
 
Join Date: Nov 2000
Posts: 1,227
Likes: 0
Received 0 Likes on 0 Posts
Default

http://awstats.sourceforge.net/docs/awstats_setup.html ?
Old 03 January 2005, 06:04 PM
  #3  
ChristianR
Scooby Regular
Thread Starter
iTrader: (1)
 
ChristianR's Avatar
 
Join Date: May 2001
Location: Europe
Posts: 6,329
Likes: 0
Received 1 Like on 1 Post
Default

thanks, but have seen that already

I am having trouble getting it to run, so ideally want to speak to someone (via pm email whatever), about how to get it up and running on a win2k server with apache running.
Old 04 January 2005, 01:24 AM
  #4  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Default

Haven't tried it myself, but I noticed the .exe file on the main site was wrong. Only 14Kb, whereas the proper source is 812Kb - http://sourceforge.net/project/showf...group_id=13764

Stefan
Old 04 January 2005, 05:06 AM
  #5  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Default

Christian,

I got it working with my personal web site last night. I run the latest Apache on Windows 2000 workstation. Here's some notes I took:-

Apache already installed (my personal web site - www.stefanostadal.homedns.org)
Installed Perl (ActivePerl-5.8.6.811-MSWin32-x86-122208.msi)
Installed AWstat (awstats-62.exe)
Ran "awstats_configure.pl" from "C:\Program Files\AWStats\tools"
Creates a file awstats.yourwebsite.conf e.g. awstats.www.stefanostadal.homedns.org.conf in "C:\Program Files\AWStats\wwwroot\cgi-bin"
I edited this file and changed the following:-
Set LogFile= to location of my httpd access.log file
Set LogFormat=4 (Apache native log file format)
Set DNSLookup=1

NOTE: I noticed that the awstats config script didn't edit my httpd.conf file properly. At the end it adds a virtual directory to redirect the cgi-bin
access from the main website to the awstats folder. I had to edit the httpd.conf file and remove the incorrect carraige-return character.
I then restarted the Apache service.

Ran "awstats.pl -update -config=www.stefanostadal.homedns.org" from "C:\Program Files\AWStats\wwwroot\cgi-bin"

NOTE: Analysis database files stored by default in same location as the awstats.pl file (as above)

Ran "awstats.pl -config=www.stefanostadal.homedns.org -output -staticlinks > awstats.www.stefanostadal.homedns.org.html"

You can then view the generated static html file.

Docs suggest creating a cron job (you could use windows scheduler) to create a static html reports on a regular basis.

Other option is to use the dynamic cgi scripts:-

Ran this url in a browser "http://www.stefanostadal.homedns.org/awstats/awstats.pl?config=www.stefanostadal.homedns.org"

NOTE: This give me a 500 error and found that I had to add this line to the httpd.conf "ScriptInterpreterSource registry". I added it before the ErrorLog command.

Re-ran the above url and I can view all the stats. Obviously, you still need to have awstats run the analysis on your log file, so you could schedule the "awstats.pl -update -config=www.stefanostadal.homedns.org" command to run each day.

Finally, I modified the "AllowAccessFromWebToFollowingIPAddresses=" line in my "awstats.www.stefanostadal.homedns.org.conf" file and only entered my local IP address. if you try to access the cgi script url it should give you a permission denied error. If you tell me what your IP is (PM me) I can add this and let you view my stats.

Hope that helps,
Stefan
Old 04 January 2005, 11:58 AM
  #6  
ChristianR
Scooby Regular
Thread Starter
iTrader: (1)
 
ChristianR's Avatar
 
Join Date: May 2001
Location: Europe
Posts: 6,329
Likes: 0
Received 1 Like on 1 Post
Default

thanks for the help guys will give it a bash.. it might be my perl version, will try updating to the latest version.
Old 04 January 2005, 08:37 PM
  #7  
ChristianR
Scooby Regular
Thread Starter
iTrader: (1)
 
ChristianR's Avatar
 
Join Date: May 2001
Location: Europe
Posts: 6,329
Likes: 0
Received 1 Like on 1 Post
Default

updated perl and it seems to be working now.. phew!

however, i cant seem to get the update to work? so when i try and access the awstats area says please update..

running from a command prompt in the right directory awstats.pl -update -config=www.domain.com

just comes up with the standard messages that u would get if u run awstats.pl by itself

altered the config to allow me to update it on the fly, i.e. via the website, by clicking on update now.. but this doesn't seem like it is working... refreshed the dir, and it created some temp files 10mins ago and that is it
Old 04 January 2005, 09:50 PM
  #8  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Default

Tail your error_log while you test these things, you could be missing a whole load of error messages.
Old 04 January 2005, 10:02 PM
  #9  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Default

Christian,

What do you see when you run the awstat.pl script?

Mine looks like this:-
C:\>"C:\Program Files\AWStats\wwwroot\cgi-bin\awstats.pl" -update -config=www.stefanostadal.homedns.org
Update for config "C:\Program Files\AWStats\wwwroot\cgi-bin/awstats.www.stefanostadal.homedns.org.conf"
With data in log file "C:/Program Files/Apache Group/Apache2/logs/access.log"...
Phase 1 : First bypass old records, searching new record...
Direct access after last parsed record (after line 706322)
Warning: awstats has detected that some hosts names were already resolved in your logfile C:/Program Files/Apache Group/Apache2/logs/access.log.
If DNS lookup was already made by the logger (web server), you should change your setup DNSLookup=1 into DNSLookup=0 to increase awstats speed.
Jumped lines in file: 706322
Found 706322 already parsed records.
Parsed lines in file: 17
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 17 new qualified records.

I've modified the file to create the data files in a sub-folder. Files are only a few '00Kb and there's one for each month. e.g.

awstats012005.www.stefanostadal.homedns.org
awstats122004.www.stefanostadal.homedns.org
awstats112004.www.stefanostadal.homedns.org
awstats102004.www.stefanostadal.homedns.org
etc ..

Stefan
Old 05 January 2005, 12:00 AM
  #10  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Default

Steve,

I've been speaking to Christian about this. basically, the awstats.pl script won't run from the command line. It doesn't matter what options he uses on the command line, it will always show just the usage syntax screen.

If I use the wrong -config= command, it shows me the syntax page but the reasons it failed at the bottom. Christian isn't getting that at all. It's like the script is defaulting to the syntax page all the time.

My Perl isn't hot, but what does this statement mean?

if ((! $ENV{'GATEWAY_INTERFACE'}) && (! $SiteConfig)) {

Stefan
Old 05 January 2005, 10:20 AM
  #11  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Default

Originally Posted by ozzy
if ((! $ENV{'GATEWAY_INTERFACE'}) && (! $SiteConfig)) {
%ENV is used to store (and retrieve) environment variables, so that statement says "if the environment var GATEWAY_INTERFACE isn't set, and the (I assume) hashref $SiteConfig isn't defined, then ... do whatever is in the block surrounded by {} afterwards.
Old 05 January 2005, 10:23 AM
  #12  
ozzy
Scooby Regular
 
ozzy's Avatar
 
Join Date: Nov 1999
Location: Scotland, UK
Posts: 10,504
Likes: 0
Received 1 Like on 1 Post
Default

OK, that's what I thought.

Seems that no matter what Christian types on the command line that statement is always true. The "-config=" parameter should set the $SiteConfig variable, but it can't be doing this on his system

Stefan
Old 05 January 2005, 11:09 AM
  #13  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Default

Yes it sounds like it's not parsing the command line options correctly. You can edit the perl quite freely, I'd do something like:

Near the use statements at the top, put a 'use Data::Dumper;' in the block, order doesn't matter. A bit lower down (I've never used awstats but it will be lower down ;) ) where it's parsing the config file options, you can use the Data::Dumper module to dump the data structures, so something like:

print Dumper $SiteConfig;

Dumper actually takes a reference, so if you pass a hash or array or scalar, prefix it with a \:

print Dumper \%ENV;

Then you can check what it's getting from the command line.

Steve.
Old 07 January 2005, 05:16 PM
  #14  
ChristianR
Scooby Regular
Thread Starter
iTrader: (1)
 
ChristianR's Avatar
 
Join Date: May 2001
Location: Europe
Posts: 6,329
Likes: 0
Received 1 Like on 1 Post
Default

so what do u want me to do ?
Old 30 January 2005, 12:39 PM
  #15  
ChristianR
Scooby Regular
Thread Starter
iTrader: (1)
 
ChristianR's Avatar
 
Join Date: May 2001
Location: Europe
Posts: 6,329
Likes: 0
Received 1 Like on 1 Post
Default

for some strange reason still will not run from command line, no worries though, just update it via the web seems to work fine.

Has anyone modified apache logs to add the extra information so you can see the "Connect to site from " area?
Old 30 January 2005, 01:27 PM
  #16  
stevencotton
Scooby Regular
 
stevencotton's Avatar
 
Join Date: Jan 2001
Location: behind twin turbos
Posts: 2,710
Likes: 0
Received 1 Like on 1 Post
Default

That is probably just HTTP_REFERER logging, not 100% reliable since it's client-supplied information.

Do you have shell access? if you like, I could go in and take a look at the command line problem.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Moonloops
Non Scooby Related
54
02 April 2007 08:29 AM
Kermit
Computer & Technology Related
3
04 November 2006 06:24 PM
ozzy
Computer & Technology Related
10
08 August 2002 04:34 PM



Quick Reply: awstats on an apache server..



All times are GMT +1. The time now is 03:24 AM.