ScoobyNet.com - Subaru Enthusiast Forum

ScoobyNet.com - Subaru Enthusiast Forum (https://www.scoobynet.com/)
-   Computer & Technology Related (https://www.scoobynet.com/computer-and-technology-related-34/)
-   -   awstats on an apache server.. (https://www.scoobynet.com/computer-and-technology-related-34/391029-awstats-on-an-apache-server.html)

ChristianR 31 December 2004 04:42 PM

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... ?

judgejules 01 January 2005 10:43 AM

http://awstats.sourceforge.net/docs/awstats_setup.html ?

ChristianR 03 January 2005 06:04 PM

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.

ozzy 04 January 2005 01:24 AM

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

ozzy 04 January 2005 05:06 AM

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

ChristianR 04 January 2005 11:58 AM

thanks for the help guys will give it a bash.. it might be my perl version, will try updating to the latest version.

ChristianR 04 January 2005 08:37 PM

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 :(

stevencotton 04 January 2005 09:50 PM

Tail your error_log while you test these things, you could be missing a whole load of error messages.

ozzy 04 January 2005 10:02 PM

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

ozzy 05 January 2005 12:00 AM

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

stevencotton 05 January 2005 10:20 AM


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.

ozzy 05 January 2005 10:23 AM

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 :confused:

Stefan

stevencotton 05 January 2005 11:09 AM

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.

ChristianR 07 January 2005 05:16 PM

so what do u want me to do ?

ChristianR 30 January 2005 12:39 PM

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?

stevencotton 30 January 2005 01:27 PM

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.


All times are GMT +1. The time now is 10:12 AM.


© 2024 MH Sub I, LLC dba Internet Brands