awstats on an apache server..
#1
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... ?
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.
#2
#4
Scooby Regular
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
Stefan
#5
Scooby Regular
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
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
#7
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
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
Trending Topics
#9
Scooby Regular
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
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
#10
Scooby Regular
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
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
#11
Scooby Regular
Originally Posted by ozzy
if ((! $ENV{'GATEWAY_INTERFACE'}) && (! $SiteConfig)) {
#12
Scooby Regular
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
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
#13
Scooby Regular
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.
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.
#16
Scooby Regular
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.
Do you have shell access? if you like, I could go in and take a look at the command line problem.
Thread
Thread Starter
Forum
Replies
Last Post