1
0
mirror of https://github.com/php/web-php.git synced 2026-04-22 14:38:09 +02:00
Files
archived-web-php/stats

Adding A Stats Page To Your Mirror In Five Easy Steps
=====================================================

1. Get The Webalizer from http://www.mrunix.net/webalizer/

   The Webalizer is a web server log analysis program. It is designed to 
   scan web server log files in various formats and produce usage statistics 
   in HTML format for viewing through a browser. Note that Webalizer requires
   you have the GD library installed on your site.

2. Install The Webalizer

   There is a configure file in the distribution now, and other setup options
   are also available. Consult the INSTALL file included in the package.
   Copy the executable to somewhere accessible. I copied it into /usr/bin.
   Call me crazy.

3. Edit php.conf (copy it from php.conf-dist)

   This is the main conf file for Webalizer. Specifically, you will want to 
   change the lines which define where your log file sits, where the output
   should go, and the name of your host machine. Look for these settings:
   LogFile, OutputDir, HostName, HideSite, HideReferrer. The stats
   directory is not required to be in the webroot, it may be aliased 
   to be there (see http://php.net/mirroring).

4. Give it a test

   From the command line in the stats directory, type:

       webalizer -c php.conf

   You should get an index file, a usage file for the
   current month, some images, and a history file.

5. If all went well, in the previous step, add it to your cron. FWIW,
   I update things daily at 3 am:

   0 3 * * * (cd /u2/www/servers/lerdorf/php/stats;/usr/bin/webalizer -c php.conf) >/dev/null 2>&1

   Provide the path of the stats directory in the "cd".

If you have any questions, try to ask them on the PHP mirrors mailing list
(mirrors@php.net). We cannot guarantee, that we can solve your problem, of
course, but it is worth a try.

Originally written by Colin Viebrock in 1998 --- Last updated: 2002-Dec-22