adixon
06-22-2006, 01:41 PM
Following phppete's excellent installation instructions for awstats (http://www.aota.net/forums/showthread.php?t=20193&highlight=awstats), I've configured awstats for our site that we're migrating now to FQ. I hope it might be helpful to you. First, follow his instructions for installing the program, and then configure:
1. Create a subdirectory for the awstats data:
mkdir /big/dom/xdomain/www/awstats/data
2. Make changes in the awstats.domainname.conf file with your favorite editor,
e.g. pico awstats.yourdomainname.com.conf
as follows:
1) LogFile=”/big/dom/xdomain/logs/access.today”
2) LogFormat=4
3) SiteDomain=yourdomainname.com
4) HostAliases=" localhost 127.0.0.1 yourIPnumberHERE"
5) DNSLookup=1
6) DirData="/big/dom/xdomain/www/awstats/data"
7) DirCgi="/cgi-bin/awstats/"
8) DirIcons="/awstats/icon"
9) SaveDatabaseFilesWithPermissionsForEveryone=1
10) URLWithQuery=1 (optional, use with care)
11) URLReferrerWithQuery=1
12) UseFramesWhenCGI=0
3. Try a test run:
perl awstats.pl -config=mysite -update
where you replace”mysite” with what you have put in SiteDomain above.
The program will output something like this:
Update for config "./awstats.domainname.com.conf"
With data in log file "/big/dom/xdomain/logs/access.today"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 4
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 4 new qualified records.
And if you do a ls –l /big/dom/xdomain/www/awstats/data , you will see that awstats created some files (and their sizes, etc):
awstats062006.domainname.txt
dnscachelastupdate.domainname.txt
4. Create a cron job which will run awstats nightly for updates. Note that crontab uses vi as its default editor. If you would like to use a different editor, such as pico, run the following commands at the prompt first:
1) EDITOR=/usr/bin/pico
2) export EDITOR
Then, run the command to edit your cron jobs:
crontab –e
Insert this line into the cron, and then save and exit:
59 23 * * * /big/dom/xdomain/cgi-bin/awstats/awstats.pl
-config=domainname.com -update -logfile=/big/dom/xdomain/logs/access.today
5. Now you’re ready to set up HTML pages to display your results. You can do this in different ways, but I’ve created 2 files:
1) awstats-head.html -- has my site’s banner in it, a page header, and some text that cautions “(There will be a brief pause while loading)”
2) awstats.html – is the following (fill in your own domainname):
<html>
<head>
<title>My Site Statistics</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="190,*" frameborder="NO" border="0" framespacing="0">
<frame name="topFrame" scrolling="NO" noresize src="awstats-head.html" >
<frame name="mainFrame" src="/cgi-bin/awstats/awstats.pl?config=domainname">
</frameset>
<noframes><body bgcolor="#FFFFFF" text="#000000">
</body></noframes>
</html>
Enjoy!
1. Create a subdirectory for the awstats data:
mkdir /big/dom/xdomain/www/awstats/data
2. Make changes in the awstats.domainname.conf file with your favorite editor,
e.g. pico awstats.yourdomainname.com.conf
as follows:
1) LogFile=”/big/dom/xdomain/logs/access.today”
2) LogFormat=4
3) SiteDomain=yourdomainname.com
4) HostAliases=" localhost 127.0.0.1 yourIPnumberHERE"
5) DNSLookup=1
6) DirData="/big/dom/xdomain/www/awstats/data"
7) DirCgi="/cgi-bin/awstats/"
8) DirIcons="/awstats/icon"
9) SaveDatabaseFilesWithPermissionsForEveryone=1
10) URLWithQuery=1 (optional, use with care)
11) URLReferrerWithQuery=1
12) UseFramesWhenCGI=0
3. Try a test run:
perl awstats.pl -config=mysite -update
where you replace”mysite” with what you have put in SiteDomain above.
The program will output something like this:
Update for config "./awstats.domainname.com.conf"
With data in log file "/big/dom/xdomain/logs/access.today"...
Phase 1 : First bypass old records, searching new record...
Searching new records from beginning of log file...
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)...
Jumped lines in file: 0
Parsed lines in file: 4
Found 0 dropped records,
Found 0 corrupted records,
Found 0 old records,
Found 4 new qualified records.
And if you do a ls –l /big/dom/xdomain/www/awstats/data , you will see that awstats created some files (and their sizes, etc):
awstats062006.domainname.txt
dnscachelastupdate.domainname.txt
4. Create a cron job which will run awstats nightly for updates. Note that crontab uses vi as its default editor. If you would like to use a different editor, such as pico, run the following commands at the prompt first:
1) EDITOR=/usr/bin/pico
2) export EDITOR
Then, run the command to edit your cron jobs:
crontab –e
Insert this line into the cron, and then save and exit:
59 23 * * * /big/dom/xdomain/cgi-bin/awstats/awstats.pl
-config=domainname.com -update -logfile=/big/dom/xdomain/logs/access.today
5. Now you’re ready to set up HTML pages to display your results. You can do this in different ways, but I’ve created 2 files:
1) awstats-head.html -- has my site’s banner in it, a page header, and some text that cautions “(There will be a brief pause while loading)”
2) awstats.html – is the following (fill in your own domainname):
<html>
<head>
<title>My Site Statistics</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<frameset rows="190,*" frameborder="NO" border="0" framespacing="0">
<frame name="topFrame" scrolling="NO" noresize src="awstats-head.html" >
<frame name="mainFrame" src="/cgi-bin/awstats/awstats.pl?config=domainname">
</frameset>
<noframes><body bgcolor="#FFFFFF" text="#000000">
</body></noframes>
</html>
Enjoy!