Web
Server Manual
| Frames
Format
Webalizer Multi Stats FAQ | About Webalizer | top
Howto Obtain Stats for
Pointed Domains
This is a mini-howto for those interested in setting up additional Webalizer
statistics for pointed domains.
Summary:
1. Create the Stats directory
2. Configuring webalizer.conf
3. Obtaining log info
4. Running webalizer
5. Viewing stats from the web
********************
IMPORTANT NOTES
Substitute "vsxxxxx" with your own username
Substitute "foo" with the name of your customer's domain
********************
All commandline typing examples assume that you are in /home/vsxxxxx.
********************
Create the Stats directory:
All you need to do is make a Stats directory under your user's home directory.
For customer foo it would be: /home/vsxxxxx/public_html/foo/Stat
From ssh/telnet type:
mkdir -p /home/vsxxxxx/public_html/foo/Stats
Configuring webalizer.conf:
You will need to make a copy of your original webalizer.conf file.
From ssh/telnet, type:
cp webalizer.conf foo.webalizer.conf
You will need to edit the following
lines in foo.webalizer.conf:
LogFile /home/vsxxxxx/foo.access.log
OutputDir /home/vsxxxxx/public_html/foo/Stats/
HistoryName foo.webalizer.hist
IncrementalName foo.webalizer.current
HostName foo.com
HideSite *foo.com
********************
IMPORTANT NOTE
You do not need to rename, nor edit your own webalizer.conf file.
********************
Obtaining log info:
All pointed domains share one logfile. In order to obtain all log entries for
a particular domain, invoke the following command from an ssh/telnet session:
cat /var/log/httpd/access_log | grep -i foo.com | grep `date '+%d/%b/%Y'` >>
~/foo.access.log
Running webalizer:
Now that you have:
1. Created the Stats directory,
2. Edited foo.webalizer.conf
3. Obtained logs for foo.com
You are now ready to run webalizer.
You can type the following command from your /home/vsxxxxx directory:
"cat /var/log/httpd/access_log | grep -i foo.com | grep `date '+%d/%b/%Y'`
>> ~/foo.access.log; webalizer -c ~/foo.webalizer.conf"
NOTE: The entire string above is
on one line.
The date string will help to provide accurate stats.
Viewing stats from the web:
http://foo.com/Stats
Topic of interest would be automating
this process.
This is where crontab comes in. The folowing example would run this process
once a day at 13:30:
30 13 * * * cat /var/log/httpd/access_log | grep `date '+%d/%b/%Y'` | grep foo.com
>> ~/foo.access.log; webalizer -c ~/foo.webalizer.conf
Yes. This is one string.
If you do not know how to run cron, please see our tutorial, or contact your service manager for costs of installation respectively.