Webstatistics with Webalizer
Who used my web server? When, How often? Which
sites are high frequency and what is the trend of the daily
visitor counter?
If you asked
yourself these questions or if you are just curious about how
your web server is used then webalizer is the right program for
you.
Webalizer not just counts the
visitors of one web site, but produces statistics of your entire
web server.
The Way It Works
Apache adds an entry for every viewing of a site or file of your web server into the file /var/log/httpd.access_log. This entry includes a lot of information about the visitor who visited the site. Webalizer uses the saved data and generates tables and plots which show the access to the server for every month and day using bar diagrams. In addition, the most frequented web sites are listed.
The data and plots are
included in an HTML page that can be published on the server, too.
Configuration
The configuration is not very complicated with SuSE distributions because the program exists as a pre-compiled version that was adjusted to SuSE.
Also, RedHat and Slackware special versions are accessible at the homepage of webalizer.
The configuration of webalizer happens in the file /etc/webalizer.conf . After the entry "OutputDir", you specify the path where the HTML page with the statistics will be saved. If you wanted to publish the sites in real time you should instead save the page in the web server directory. With SuSE 6.x this is a subdirectory in /usr/local/httpd/htdocs/ .
It is recommended to add a user who is just responsible for the web server (use YAST to create a user) e.g. with the name "wwwadmin". This user should create the subdirectory so he has permissions to write into it later. In addition, he needs the permissions to read the file /etc/webalizer.conf and /var/log/httpd.access_log (The permissions to read the files can be changed with chmod +r filename).
First you change to the user "wwwadmin" with
>> su wwwadmin
and then, after entering the password, you create the subdirectory with
>> mkdir /usr/local/httpd/htdocs/webalizer
(If you do not
want to add a new user this can be done by root, too.)
Then you change the corresponding
part in the file /etc/webalizer
| File /etc/webalizer.conf |
# OutputDir is where you want to put the output files. This should |
In addition, in this file you can set the appearance of the generated pages. The options are well documented. The default settings make sense and changes are not really necessary.
After the first start of webalizer
>> webalizer
the pages are generated and put
in the specified directory. You can have a look at them at http://localhost/webalizer.
Up-To-Date
For up-to-date data, webalizer has to be run regularly. Depending on the load of your server and the wish for real-time information, a refresh of every 24 hours down to 5 minutes make sense.
Cron is the best choice to
realize this. So we let the user who has the permissions to
write into /usr/local/httpd/htdocs/webalizer and the right to
read the files /var/log/httpd.access_log and /etc/webconf.conf
execute the command "/usr/bin/webalizer".
The configuration of cron can be
done with
>>crontab -e
or using graphical front-ends like "vcron" or "kcron" (also have a look at "Just on time: Vcron, Kcrontab")
With this
configuration, you always get informed about your web statistics.
Homepage: http://www.mrunix.net/webalizer/
Talkback Area
Enter Own Comment