Running the Webalizer

The Webalizer was designed to be run from a Unix or Windows command line prompt or as a cron job. There are several command line options which will modify the results it produces, and configuration files can be used as well. The format of the command line is:

webalizer [options ...] [logfile [[ logfile]...] | report-database]

Where 'options' can be one or more of the supported command line switches described below.

logfile is the name of the log file to process (see below for more detailed information). If a dash ("-") is specified for the log-file name, STDIN will be used. If more than one log file is specified, Stone Steps Webalizer will process log records from each file in their time stamp order.

report-database is the name of the database, not including file path or file extension, that will be used to generate a report.

Once executed, the general flow of the program follows:
  • Any command line arguments given to the program are parsed. This may include the specification of a configuration file (-c), which is processed at the time it is encountered.
  • If there was no configuration file specified on the command line with the -c option, the default configuration file is scanned for. The following directories are searched, in the specified order: current directory, the system directory (/etc on Unix or c:\windows on Windows), the directory where the executable (webalizer or webalizer.exe) is located.
  • If either of the configuration files contained Include directives, all included configuration files are processed as well.
  • If --prepare-report was specified on the command line, the last argument will be interpreted as a database file name. In this case a report will be generated from the data stored in the database and not log files will be processed.
  • If a log file was specified, it is opened and made ready for processing. If no log file was given, or the filename '-' is specified on the command line, STDIN is used for input.
  • If an output directory was specified, the program will generate output in this directory. If no output directory was given, the current directory is used.
  • If a non-zero number of DNS Children processes were specified, the corresponding number of DNS worker threads will be started, and IP addresses in the specified log file will be either resolved to host names or looked up in the GeoIP database, or both.
  • If no host name was given, the program attempts to get the host name using a uname system call. If that fails, 'localhost' is used.
  • A history file is searched for. This file keeps previous month totals used on the main index.html page. The default file is named webalizer.hist, kept in the specified output directory, However may be changed using the HistoryName configuration file keyword.
  • If incremental processing was specified, a database file containing the internal state data of the program at the end of a previous run is searched for and opened, if found. The default database file is webalizer.db and is kept in the directory specified using the DbPath configuration variable.
  • Main processing begins on the log file. If the log spans multiple months, a separate HTML document is created for each month.
  • After main processing, the main index.html page is created, which has totals by month and links to each months HTML document.
  • A new history file is saved to disk, which includes totals generated by The Webalizer during the current run.
  • If incremental processing was specified, the database file is updated to contain the internal state data at the end of this run.

Last edited Nov 17, 2014 at 4:49 AM by StoneSteps, version 1