home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / webalizr.zip / README < prev    next >
Text File  |  1999-06-30  |  77KB  |  1,458 lines

  1. The Webalizer - A web server log file analysis tool
  2. Copyright 1997-1999 by Bradford L. Barrett (brad@mrunix.net)
  3.  
  4. Distributed under the GNU GPL.  See the files "COPYING" and
  5. "Copyright" supplied with the distribution for additional info.
  6.  
  7.  
  8. What is The Webalizer?
  9. ----------------------
  10.  
  11. The Webalizer is a web server log file analysis program which produces
  12. usage statistics in HTML format for viewing with a browser.  The results
  13. are presented in both columnar and graphical format, which facilitates
  14. interpretation.  Yearly, monthly, daily and hourly usage statistics are
  15. presented, along with the ability to display usage by site, URL, referrer,
  16. user agent (browser) and country (user agent and referrer are only
  17. available if your web server procduces Combined log format files).
  18.  
  19. The Webalizer supports CLF (common log format) log files, as well as
  20. Combined log formats as defined by NCSA and others, and variations
  21. of these which it attempts to handle intelligently.
  22.  
  23. This documentation applies to The Webalizer Version 1.30
  24.  
  25. Running the Webalizer
  26. ---------------------
  27.  
  28. The Webalizer was designed to be run from a Unix command line prompt or
  29. as a cron job.  There are several command line options which will modify
  30. the results it produces, and configuration files can be used as well.
  31. The format of the command line is:
  32.  
  33. webalizer [options ...] [log-file]
  34.  
  35. Where 'options' can be one or more of the supported command line
  36. switches described below.  'log-file' is the name of the log file
  37. to process (see below for more detailed information).
  38.  
  39.  
  40. Once executed, the general flow of the program follows:
  41.  
  42. o A default configuration file is scanned for.  A file named
  43.   'webalizer.conf' is searched for in the current directory, and if
  44.   found, it's configuration data is parsed.  If the file is not
  45.   present in the current directory,  the file '/etc/webalizer.conf'
  46.   is searched for and, if found, is used instead.
  47.  
  48. o Any command line arguments given to the program are parsed.  This
  49.   may include the specification of a configuration file, which is
  50.   processed at the time it is encountered.
  51.  
  52. o If a log file was specified, it is opened and made ready for
  53.   processing.  If no log file was given, STDIN is used for input.
  54.  
  55. o If an output directory was specified, the program does a 'chdir' to
  56.   that directory in prepration for generating output.  If no output
  57.   directory was given, the current directory is used.
  58.  
  59. o If no hostname was given, the program attempts to get the hostname
  60.   using a uname system call.  If that fails, 'localhost' is used.
  61.  
  62. o A history file is searched for.  This file keeps previous month
  63.   totals used on the main index.html page.  The default file is
  64.   named 'webalizer.hist', kept in the specified output directory,
  65.   however may be changed using the "HistoryName" configuration file
  66.   keyword.
  67.  
  68. o If incremental processing was specified, a data file is searched for
  69.   and loaded if found, containing the 'internal state' data of the
  70.   program at the end of a previous run.  The default file is named
  71.   'webalizer.current', kept in the specified output directory, however
  72.   may be changed using the "IncrementalName" configuration file keyword.
  73.  
  74. o Main processing begins on the log file.  If the log spans multiple
  75.   months, a seperate HTML document is created for each month.
  76.  
  77. o After main processing, the main 'index.html' page is created, which
  78.   has totals by month and links to each months HTML document.
  79.  
  80. o A new history file is saved to disk, which includes totals generated
  81.   by The Webalizer during the current run.
  82.  
  83. o If incremental processing was specified, a data file is written that
  84.   contains the 'internal state' data at the end of this run.
  85.  
  86.  
  87. Incremental Processing
  88. ----------------------
  89.  
  90. Version 1.2x of The Webalizer adds incremental run capability.  Simply
  91. put, this allows processing large log files by breaking them up into
  92. smaller pieces, and processing these pieces instead.  What this means
  93. in real terms is that you can now rotate your log files as often as you
  94. want, and still be able to produce monthly usage statistics without the
  95. loss of any detail.  This is accomplished by saving and restoring all
  96. relevant internal data to a disk file between runs.  Doing so allows the
  97. program to 'start where it left off' so to speak, and allows the
  98. preservation of detail from one run to the next.
  99.  
  100. Some special precautions need to be taken when using the incremental
  101. run capability of The Webalizer.  Configuration options should not be
  102. changed between runs, as that could cause corruption of the internal
  103. stored data.  For example, changing the MangleAgents level will cause
  104. different representations of user agents to be stored, producing invalid
  105. results in the user agents section of the report.  If you need to change
  106. configuration options, do it at the end of the month after normal
  107. processing of the previous month and before processing the current month.
  108. You may also want to delete the 'webalizer.current' file as well (or
  109. whatever name was specified using the "IncrementalName" configuration
  110. option).
  111.  
  112. The Webalizer also attempts to prevent data duplication by keeping
  113. track of the timestamp of the last record processed.  This timestamp
  114. is then compared to current records being processed, and any records
  115. that were logged previous to that timestamp are ignored.  This, in
  116. theory, should allow you to re-process logs that have already been
  117. processed, or process logs that contain a mix of processed/not yet
  118. processed records, and not produce duplication of statistics.  The
  119. only time this may break is if you have duplicate timestamps in two
  120. seperate log files... any records in the second log file that do have
  121. the same timestamp as the last record in the previous log file processed,
  122. will be discarded as if they had already been processed.  There are
  123. lots of ways to prevent this however, for example, stopping the web
  124. server before rotating logs will prevent this situation.  This setup
  125. also necessitates that you always process logs in chronological order,
  126. otherwise data loss will occur as a result of the timestamp compare.
  127.  
  128.  
  129. Output Produced
  130. ---------------
  131.  
  132. The Webalizer produces several reports (html) and graphics for each
  133. month processed.  In addition, a summary page is generated for the
  134. current and previous months (up to 12), a history file is created
  135. and if incremental mode is used, the current month's processed data.
  136. The exact location and names of these files can be changed using
  137. configuration files and command line options.  The files produced,
  138. (default names) are:
  139.  
  140. index.html              - Main summary page (extension may be changed)
  141. usage.gif               - Yearly graph displayed on the main index page
  142. usage_YYYYMM.html       - Monthly summary page (extension may be changed)
  143. usage_YYYYMM.gif        - Monthly usage graph for specified month/year
  144. daily_usage_YYYYMM.gif  - Daily usage graph for specified month/year
  145. hourly_usage_YYYYMM.gif - Hourly usage graph for specified month/year
  146. webalizer.hist          - Previous month history (may be changed)
  147. webalizer.current       - Incremental Data (may be changed)
  148.  
  149. The yearly (index) report shows statistics for a 12 month period, and
  150. links to each month.  The monthly report has detailed statistics for
  151. that month with additional links to any URL's and referrers found.
  152. The various totals shown are explained below.
  153.  
  154. Hits
  155.  
  156.   Any request made to the server which is logged, is considered a 'hit'.
  157. The requests can be for anything... html pages, graphic images, audio
  158. files, cgi scripts, etc...  Each valid line in the server log is
  159. counted as a hit.  This number represents the total number of requests
  160. that were made to the server during the specified report period.
  161.  
  162. Files
  163.  
  164.   Some requests made to the server, require that the server then send
  165. something back to the requesting client, such as a html page or graphic
  166. image.  When this happens, it is considered a 'file' and the files
  167. total is incremented.  The relationship between 'hits' and 'files' can
  168. be thought of as 'incoming requests' and 'outgoing responses'.
  169.  
  170. Pages
  171.  
  172.   Pages are, well, pages!  Generally, any HTML document, or anything
  173. that generates an HTML document, would be considered a page.  This
  174. does not include the other stuff that goes into a document, such as
  175. graphic images, audio clips, etc...  This number represents the number
  176. of 'pages' requested only, and does not include the other 'stuff' that
  177. is in the page.  What actually constitutes a 'page' can vary from
  178. server to server.  The default action is to treat anything with the
  179. extension '.htm', '.html' or '.cgi' as a page.  A lot of sites will
  180. probably define other extensions, such as '.phtml', '.php3' and '.pl'
  181. as pages as well.  Some people consider this number as the number of
  182. 'pure' hits... I'm not sure if I totaly agree with that viewpoint.
  183. Some other programs (and people :) refer to this as 'Pageviews'.
  184.  
  185. Sites
  186.  
  187.   Each request made to the server comes from a unique 'site', which can
  188. be referenced by a name or ultimately, an IP address.  The 'sites'
  189. number shows how many unique IP addresses made requests to the server
  190. during the reporting time period.  This DOES NOT mean the number of
  191. unique individual users (real people) that visited, which is impossible
  192. to determine using just logs and the HTTP protocol (however, this
  193. number might be about as close as you will get).
  194.  
  195. Visits
  196.  
  197.   Whenever a request is made to the server from a given IP address
  198. (site), the amount of time since a previous request by the address
  199. is calculated (if any).  If the time difference is greater than a
  200. preconfigured 'visit timeout' value (or has never made a request before),
  201. it is considered a 'new visit', and this total is incremented (both
  202. for the site, and the IP address).  The default timeout value is 30
  203. minutes (can be changed), so if a user visits your site at 1:00 in
  204. the afternoon, and then returns at 3:00, two visits would be registered.
  205. Note: in the 'Top Sites' table, the visits total should be discounted
  206. on 'Grouped' records, and thought of as the "Minimium number of visits"
  207. that came from that grouping instead.  Note: Visits only occur on
  208. PageType requests, that is, for any request whose URL is one of the
  209. 'page' types defined with the PageType option.  Due to the limitation
  210. of the HTTP protocol, log rotations and other factors, this number
  211. should not be taken as absolutely accurate,  rather, it should be
  212. considered a pretty close "guess".
  213.  
  214. KBytes
  215.  
  216.   The KBytes (kilobytes) value shows the amount of data, in KB, that
  217. was sent out by the server during the specified reporting period.  This
  218. value is generated directly from the log file, so it is up to the
  219. webserver to produce accurate numbers in the logs  (some web servers
  220. do stupid things when it comes to reporting the number of bytes).  In
  221. general, this should be a fairly accurate representation of the amount
  222. of outgoing traffic the server had, regardless of the web servers
  223. reporting quirks.
  224.  
  225. Note: A kilobyte is 1024 bytes, not 1000 :)
  226.  
  227. Top Entry and Exit Pages
  228.  
  229.   The Top Entry and Exit Pages give a rough estimate of what URL's
  230. are used to enter your site, and what the last pages viewed are.
  231. Because of limitations in the HTTP protocol, log rotations, etc...
  232. this number should be considered a good "rough guess" of the actual
  233. numbers, however will give a good indication of the overall trend in
  234. where users come into, and exit, your site.
  235.  
  236.  
  237. Command Line Options
  238. --------------------
  239.  
  240. The Webalizer supports many different configuration options that will
  241. alter the way the program behaves and generates output.  Most of these
  242. can be specified on the command line, while some can only be specified
  243. in a configuration file. The command line options are listed below,
  244. with references to the corresponding configuration file keywords.
  245.  
  246. --------------------------------------------------------------------------
  247.  
  248. General Options
  249. ---------------
  250.  
  251. -h        Display all available command line options and exit program.
  252.  
  253. -v        Display program version and exit program.
  254.  
  255. -d        Display additional 'debugging' information for errors and
  256.           warnings produced during processing.  This normally would
  257.           not be used except to determine why you are getting all those
  258.           errors and wanted to see the actual data.  Normally The
  259.           Webalizer will just tell you it found an error, not the
  260.           actual data.  This option will display the data as well.
  261.           Config file keyword: Debug
  262.  
  263. -F        Specify that the log being used is a ftp log.  Normally, the
  264.           Webalizer expects to find a valid CLF or Combined format
  265.           we server log file.  This option allows you to process wu-ftpd
  266.           xferlogs as well.
  267.           Config file keyword: LogType
  268.  
  269. -f        Fold out of sequence log records back into analysis, by
  270.           treating them as if they were the same date/time as the
  271.           last good record.  Normally, out of sequence log records
  272.           are ignored.  If you run apache, don't worry about this.
  273.           Config file keyword: FoldSeqErr
  274.  
  275. -g        Use GMT (UTC) time instead of local timezone.  Normally,
  276.           The Webalizer will display the time generated in the timezone
  277.           of the local machine, such as EDT or PST.  This switch will
  278.           cause the times to be displayed in GMT (UTC) time instead.
  279.           Config file keyword: GMTTime
  280.  
  281. -i        Ignore history file.  USE WITH CAUTION.  This causes The
  282.           Webalizer to ignore any existing history file produced from
  283.           previous runs and generate it's output from scratch.  The
  284.           effect will be as if The Webalizer is being run for the
  285.           first time and any previous statistics will be lost (although
  286.           the HTML documents, if any, will not be deleted) on the main
  287.           index.html (yearly) web page.
  288.           Config file keyword: IgnoreHist
  289.  
  290. -p        Preserve state (incremental processing).  This allows the
  291.           processing of partial logs in increments.  At the end of
  292.           the program, all relevant internal data is saved, so that
  293.           it may be restored the next time the program is run.  This
  294.           allows sites that must rotate their logs more than once a
  295.           month to still be able to use The Webalizer, and not worry
  296.           about having to gather and feed an entire months logs to
  297.           the program at the end of the month.  See the section on
  298.           "Incremental Processing" below for additional information.
  299.           The default is to not perform incremental processing.  Use
  300.           this command line option to enable the feature.
  301.           Config file keyword: Incremental
  302.  
  303. -q        Quiet mode.  Normally, The Webalizer will produce various
  304.           messages while it runs letting you know what it's doing.
  305.           This option will supress those messages.  It should be
  306.           noted that this WILL NOT supress errors and warnings, which
  307.           are output to STDERR.
  308.           Config file keyword: Quiet
  309.  
  310. -Q        ReallyQuiet mode.  This allows supression of _all_ messages
  311.           generated by The Webalizer, including warnings and errors.
  312.           Useful when The Webalizer is run as a cron job.
  313.           Config file keyword: ReallyQuiet
  314.  
  315. -T        Display timing information.  The Webalizer keeps track of the
  316.           time it begins and ends processing, and normally displays the
  317.           total processing time at the end of each run.  If quiet mode
  318.           (-q or 'Quiet yes' in configuration file) is specified, this
  319.           information is not displayed.  This option forces the display
  320.           of timing totals if quiet mode has been specified, otherwise
  321.           it is redundant and will have no effect.
  322.           Config file keyword: TimeMe
  323.  
  324. -c file   This option specifies a configuration file to use.  Configuration
  325.           files allow greater control over how The Webalizer behaves, and
  326.           there are several ways to use them.  As of version 0.98, The
  327.           Webalizer searches for a default configuration file in the
  328.           current directory named "webalizer.conf", and if not found,
  329.           will search in the /etc/ directory for a file of the same name.
  330.           In addition, you may specify a configuration file to use with
  331.           this command line option.
  332.  
  333. -n name   This option specifies the hostname for the reports generated.
  334.           The hostname is used in the title of all reports, and is also
  335.           prepended to URL's in the reports.  This allows The Webalizer
  336.           to be run on log files for 'virtual' web servers or web servers
  337.           that are different than the machine the reports are located on,
  338.           and still allows clicking on the URL's to go to the proper
  339.           location.  If a hostname is not specified, either on the
  340.           command line or in a configuration file, The Webalizer attempts
  341.           to determine the hostname using a 'uname' system call.  If this
  342.           fails, "localhost" will be used as the hostname.
  343.           Config file keyword: HostName
  344.  
  345. -o dir    This options specifies the output directory for the reports.
  346.           If not specified here or in a configuration file, the current
  347.           default directory will be used for output.
  348.           Config file keyword: OutputDir
  349.  
  350. -x name   This option allows the generated pages to have an extension
  351.           other than '.html', which is the default.  Do not include the
  352.           leading period ('.') when you specify the extension.
  353.           Config file keyword: HTMLExtension
  354.  
  355. -P name   Specify the file extensions for 'pages'.  Pages (sometimes
  356.           called 'PageViews') are normally html documents and cgi
  357.           scripts that display the whole page, not just parts of it.
  358.           Some system will need to define a few more, such as 'phtml',
  359.           'php3' or 'pl' in order to have them counted as well.  The
  360.           default is 'htm*' and 'cgi' for web logs and 'txt' for ftp.
  361.           Config file keyword: PageType
  362.  
  363. -t name   This option specifies the title string for all reports.  This
  364.           string is used, in conjunction with the hostname (if not blank)
  365.           to produce the actual title.  If not specified, the default of
  366.           "Usage Statistics for" will be used.
  367.           Config file keyword: ReportTitle
  368.  
  369. -Y        Supress Country graph.  Normally, The Webalizer produces
  370.           country statistics in both Graph and COlumnar forms.  This
  371.           option will supress the Country Graph from being generated.
  372.           Config file keyword: CountryGraph
  373.  
  374. -G        Supress hourly graph.  Normally, The Webalizer produces
  375.           hourly statistics in both Graph and Columnar forms.  This
  376.           option will supress the Hourly Graph only from being generated.
  377.           Config file keyword: HourlyGraph
  378.  
  379. -H        Supress Hourly statistics.  Normally, The Webalizer produces
  380.           hourly statistics in both Graph and Columnar forms.  This
  381.           option will supress the Hourly Statistics table only from
  382.           being generated.
  383.           Config file keyword: HourlyStats
  384.  
  385. -L        Disable Graph Legends.  The color coded legends displayed on
  386.           the inline graphs can be disabled with this option.  The
  387.           default is to display the legends.
  388.           Config file keyword: GraphLegend
  389.  
  390. -l num    Graph Lines.  Specify the number of background reference
  391.           lines displayed on the inline graphics produced.  The default
  392.           is 2 lines, however can range anywhere from zero ('0') for
  393.           no lines, up to 20 lines (looks funny!).
  394.           Config file keyword: GraphLines
  395.  
  396. -P name   Page type.  This is the extension of files you consider to
  397.           be pages for Pages calculations (sometimes called 'pageviews').
  398.           The default is 'htm*' and 'cgi' (plus whatever HTMLExtension
  399.           you specified if it is different).  Don't use a period!
  400.  
  401. -m num    Specify a 'visit timeout'.  Visits are calculatd by looking at
  402.           the time difference between the current and last request made
  403.           by a specific host.  If the difference is greater that the
  404.           visit timeout value, the request is considered a new visit.
  405.           This value must be formatted as HHMMSS, and you can suppress
  406.           leading zeros.  The default is 30 minutes (3000).
  407.           Config file keyword: VisitTimeout
  408.  
  409. -M num    Mangle user agent names.  Normally, The Webalizer will keep
  410.           track of the user agent field verbatim.  Unfortunately, there are
  411.           a ton of different names that user agents go by, and the field
  412.           also reports other items such as machine type and OS used. For
  413.           Example, Netscape 4.03 running on Windows 95 will report a
  414.           different string than Netscape 4.03 running on Windows NT, so even
  415.           though they are the same browser type, they will be considered
  416.           as two totally different browsers by The Webalizer.  For that
  417.           matter, Netscape 4.0 running on Windows NT will report different
  418.           names if one is run on an Alpha and the other on an Intel
  419.           processor!  Internet Exploder is even worse, as it reports itself
  420.           as if it were Netscape and you have to search the given string a
  421.           little deeper to discover that it is really MSIE!  In order to
  422.           consolidate generic browser types, this option will cause The
  423.           Webalizer to 'mangle' the user agent field, attempting to
  424.           consolidate generic browser types. There are 6 levels that can be
  425.           specified, each producing different levels of detail.  Level 5
  426.           displays only the browser name (MSIE or Mozilla) and the major
  427.           version number.  Level 4 will also display the minor version
  428.           number (single decimal place).  Level 3 will display the minor
  429.           version number to two decimal places.  Level 2 will add any
  430.           sub-level designation (such as Mozilla/3.01Gold or MSIE 3.0b).
  431.           Level 1 will also attempt to add the system type.  The default
  432.           Level 0 will disable name mangling and leave the user agent
  433.           field unmodified, producing the greatest amount of detail.
  434.           Configuration file keyword: MangleAgents
  435.  
  436.  
  437. Hide Options
  438. ------------
  439.  
  440. The following options take a string argument to use as a comparison
  441. for matching.  Except for the IndexAlias option, the string argument
  442. can be plain text, or plain text that either starts or ends with the
  443. wildcard character '*'.
  444.  
  445. For Example:
  446.  
  447. Given the string "yourmama/was/here", the arguments "was", "*here" and
  448. "your*" will all produce a match.
  449.  
  450.  
  451. -a name   This option allows hiding of user agents (browsers) from the
  452.           "Top User Agents" table in the report.  This option really
  453.           isn't too useful as there are a zillion different names that
  454.           current browsers go by, depending where they were obtained,
  455.           however you might have some particular user agents that hit
  456.           your site a lot that you would like to exclude from the list.
  457.           You must have a web server that includes user agents in it's
  458.           log files for this option to be of any use.  In addition, it
  459.           is also useless if you disable the user agent table in the
  460.           report (see the -A command line option or "TopAgents"
  461.           configuration file keyword). You can specify as many of these
  462.           as you want on the command line.  The wildcard character '*'
  463.           can be used either in front of or at the end of the string.
  464.           (ie: Mozilla/4.0* would match anything that starts with the
  465.           string "Mozilla/4.0").
  466.           Config file keyword: HideAgent
  467.  
  468. -r name   This option allows hiding of referrers from the "Top Referrer"
  469.           table in the report.  Referrers are URL's, either on your own
  470.           local site or a remote site, that refered the user to a URL
  471.           on your web server.  This option is normally used to hide
  472.           your own server from the table, as your own pages are usually
  473.           the top referrers to your own pages (well, you get the idea).
  474.           You must have a web server that includes referrer information
  475.           in the log files for this option to be of any use.  In addition,
  476.           it is also useless if you disable the referrers table in the
  477.           report (see the -R command line option or "TopReferrers"
  478.           configuration file keyword).  You can specify as many of these
  479.           as you like on the command line.
  480.           Config file keyword: HideReferrer
  481.  
  482. -s name   This option allows hiding of sites from the "Top Sites" table
  483.           in the report.  Normally, you will only want to hide your own
  484.           domain name from the report, as it usually is one of the top
  485.           sites to visit your web server.  This option is of no use if
  486.           you disable the top sites table in the report (see the -S
  487.           command line option or "TopSites" configuration file option).
  488.           Config file keyword: HideSite
  489.  
  490. -u name   This option allows hiding of URL's from the "Top URL's" table
  491.           in the report.  Normally, this option is used to hide images,
  492.           audio files and other objects your web server dishes out that
  493.           would otherwise clutter up the table.  This option is of no
  494.           use if you diable the top URL's table in the report (see the
  495.           -U command line option or "TopURLs" configuration file keyword).
  496.           Config file keyword: HideURL
  497.  
  498. -I name   This option allows you to specify additional index.html aliases.
  499.           The Webalizer usually strips the string 'index.' from URL's
  500.           before processing, which has the effect of turning a URL such
  501.           as /somedir/index.html into just /somedir/ which is really the
  502.           same URL and should be treated as such.  This option allows you
  503.           to specify _additional_ strings that are to be treated the same
  504.           way.  Use with care, improper use could cause unexpected resluts.
  505.           For example, if you specify the alias string of 'home', a URL
  506.           such as /somedir/homepages/brad/home.html would be converted
  507.           into just /somedir/ which probably isn't what was intended.
  508.           This option is useful if your web server uses a different default
  509.           index page other than the standard 'index.html' or 'index.htm',
  510.           such as 'home.html' or 'homepage.html'.  The string specified
  511.           is searched for _anywhere_ in the URL, so "home.htm" would
  512.           turn both "/somedir/home.htm" and "/somedir/home.html" into
  513.           just "/somedir/".  Go easy on this one, each string specified
  514.           will be scanned for in EVERY log record, so if you specify a
  515.           bunch of these, you will notice degraded performance.  Wildcards
  516.           are not allowed on this one.
  517.           Config file keyword: IndexAlias
  518.  
  519. Table Size Options
  520. ------------------
  521.  
  522. -e num    This option specifies the number of entries to display in the
  523.           "Top Entry Pages" table.  To disable the table, use a value of
  524.           zero (0).
  525.           Config file keyword: TopEntry
  526.  
  527. -E num    This option specifies the number of entries to display in the
  528.           "Top Exit Pages" table.  To disable the table, use a value of
  529.           zero (0).
  530.           Config file keyword: TopExit
  531.  
  532. -A num    This option specifies the number of entries to display in the
  533.           "Top User Agents" table.  To disable the table, use a value of
  534.           zero (0).
  535.           Config file keyword: TopAgents
  536.  
  537. -C num    This option specifies the number of entries to display in the
  538.           "Top Countries" table.  To disable the table, use a value of
  539.           zero (0).
  540.           Config file keyword: TopCountries
  541.  
  542. -R num    This option specifies the number of entries to display in the
  543.           "Top Referrers" table.  To disable the table, use a value of
  544.           zero (0).
  545.           Config file keyword: TopReferrers
  546.  
  547. -S num    This option specifies the number of entries to display in the
  548.           "Top Sites" table.  To disable the table, use a value of
  549.           zero (0).
  550.           Config file keyword: TopSites
  551.  
  552. -U num    This option specifies the number of entries to display in the
  553.           "Top URL's" table.  To disable the table, use a value of
  554.           zero (0).
  555.           Config file keyword: TopURLs
  556.  
  557. --------------------------------------------------------------------------
  558.  
  559.  
  560. CONFIGURATION FILES
  561. -------------------
  562.  
  563. The Webalizer allows configuration files to be used in order to simplify
  564. life for all.  There are several ways that configuration files are accessed
  565. by the Webalizer.  When The Webalizer first executes, it looks for a
  566. default configuration file named "webalizer.conf" in the current directory,
  567. and if not found there, will look for "/etc/webalizer.conf".  In addition,
  568. configuration files may be specified on the command line with the '-c'
  569. option.  There are lots of different ways you can combine the use of
  570. configuration files and command line options to produce various results.
  571. The Webalizer always looks for and reads configuration options from a
  572. default configuration file before doing anything else.  Because of this,
  573. you can override options found in the default file by use of additional
  574. configuration files specified on the command line or command line options
  575. themselves.  If you specify a configuration file on the command line, you
  576. can override options in it by additional command line options which follow.
  577. For example, most users will most likely want to create the default file
  578. /etc/webalizer.conf and place options in it to specify the hostname, log
  579. file, table options, etc...  At the end of the month when a different log
  580. file is to be used (the end of month log), you can run TheWebalizer as
  581. usual, but put the different filename on the end of the command line, which
  582. will override the log file specified in the configuration file.  It should
  583. be noted that you cannot override some configuration file options by the
  584. use of command line arguments.  For example, if you specify "Quiet yes" in
  585. a configuration file, you cannot override this with a command line argument,
  586. as the command line option only _enables_ the feature (-q option).
  587.  
  588. The configuration files are standard ASCII text files that may be created
  589. or edited using any standard editor.  Blank lines and lines that begin
  590. with a pound sign ('#') are ignored.  Any other lines are considered to
  591. be configurgation lines, and have the form "Keyword Value", where the
  592. 'Keyword' is one of the currently available configuration keywords defined
  593. below, and 'Value' is the value to assign to that particular option.  Any
  594. text found after the keyword up to the end of the line is considered the
  595. keyword's value, so you should not include anything after the actual value
  596. on the line that is not actually part of the value being assigned.  The
  597. file "sample.conf" provided with the distribution contains lots of useful
  598. documentation and examples as well.  It should be noted that you do not
  599. have to use any configuration files at all, in which case, default values
  600. will be used (which should be sufficent for most sites).
  601.  
  602. --------------------------------------------------------------------------
  603.  
  604. General Configuration Keywords
  605. ------------------------------
  606.  
  607. LogFile       This defines the logfile to use.  It should be a fully qualified
  608.               name (ie: contain the path), but relative names will work as
  609.               well.  If not specified, the logfile defaults to STDIN. 
  610.  
  611. LogType       This specifies the log file type being used.  Normally, The
  612.               Webalizer processes web logs in either CLF or Combined format.
  613.               If you run a ftp server (wu-ftpd or similar) that produces
  614.               an xferlog, you can analyze it as well by setting the LogType
  615.               to 'ftp'.  Values can be either 'web' or 'ftp', default is 'web'.
  616.               Command line argument: -F
  617.  
  618. OutputDir     This defines the output directory to use for the reports.  If
  619.               it is not specified, the current directory is used.
  620.               Command line argument: -o
  621.  
  622. HistoryName   Allows specification of a history path/filename if desired.
  623.               The default is to use the file named 'webalizer.hist', kept
  624.               in the normal output directory (OutputDir above).  Any name
  625.               specified is relative to the normal output directory unless
  626.               an absolute path name is given (ie: starts with a '/').
  627.  
  628. ReportTitle   This specifies the title to use for the generated reports.
  629.               It is used in conjunction with the hostname (unless blank)
  630.               to produce the final report titles.  If not defined, the
  631.               default of "Usage Statistics for" is used.
  632.               Command line argument: -t
  633.  
  634. HostName      This defines the hostname.  The hostname is used in the
  635.               report title as well as being prepended to URL's in the
  636.               "Top URL's" table.  This allows The Webalizer to be run
  637.               on "virtual" web servers, or servers that do not reside
  638.               on the local machine, and allows clicking on the URL to
  639.               go to the right place.  If not specified, The Webalizer
  640.               attempts to get the hostname via a 'uname' system call,
  641.               and if that fails, will default to "localhost".
  642.               Command line argument: -n
  643.  
  644. UseHTTPS      Causes the links in the 'Top URL's' table to use 'https://'
  645.               instead of the default 'http://' prefix.  Not much use if
  646.               you run a mix of secure/insecure servers on your machine.
  647.               Only useful if you run the analysis on a secure servers
  648.               logs, and want the links in the table to work properly.
  649.  
  650. Quiet         This allows you to enable or disable informational messages
  651.               while it is running.  The values for this keyword can be
  652.               either 'yes' or 'no'.  Using "Quiet yes" will supress these
  653.               messages, while "Quiet no" will enable them.  The default
  654.               is 'no' if not specified, which will allow The Webalizer
  655.               to display informational messages.  It should be noted that
  656.               this option has no effect on Warning or Error messages that
  657.               may be generated, as they go to STDERR.
  658.               Command line argument: -q
  659.  
  660. TimeMe        This allows you to display timing information regardless of
  661.               any "quiet mode" specified.  Useful only if you did in fact
  662.               tell the webalizer to be quiet either by using the -q command
  663.               line option or the "Quiet" keyword, otherwise timing stats
  664.               are normally displayed anyway.  Values may be either 'yes'
  665.               or 'no', with the default being 'no'.
  666.               Command line argument: -T
  667.  
  668. GMTTime       This keyword allows timestamps to be displayed in GMT (UTC)
  669.               time instead of local time.  Normally The Webalizer will
  670.               display timestamps in the timezone of the local machine
  671.               (ie: PST or EDT).  This keyword allows you to specify the
  672.               display of timestamps in GMT (UTC) time instead.  Values
  673.               may be either 'yes' or 'no'.  Default is 'no'.
  674.               Command line argument: -g
  675.  
  676. Debug         This tells The Webalizer to display additional information
  677.               when it encounters Warnings or Errors.  Normally, The
  678.               Webalizer will just tell you it found a bad record or
  679.               field.  This option will enable the display of the actual
  680.               data that produced the Warning or Error as well.  Useful
  681.               only if you start getting lots of Warnings or Errors and
  682.               want to determine the cause.  Values may be either 'yes'
  683.               or 'no', with the default being 'no'.
  684.               Command line argument: -d
  685.  
  686. IgnoreHist    This supresses the reading of a history file.  USE WITH
  687.               EXTREME CAUTION as the history file is how The Webalizer
  688.               keeps track of previous months.  The effect of this option
  689.               is as if The Webalizer was being run for the very first
  690.               time, and any previous data is discarded.  Values may be
  691.               either 'yes' or 'no', with the default being 'no'.
  692.               Command line argument: -i
  693.  
  694. FoldSeqErr    Allows log records that are out of sequence to be folded
  695.               back into the analysis, by treating them as if they had
  696.               the same date/time as the last good record.  Normally,
  697.               out of sequence log records are simply ignored.  If you
  698.               run apache, don't worry about this.
  699.  
  700. VisitTimeout  Set the 'visit timeout' value.  Visits are determined by
  701.               looking at the time difference between the current and last
  702.               request made by a specific site.  If the difference in time
  703.               is greater than the visit timeout value, the request is
  704.               considered a new visit.  The value must be in the form of
  705.               HHMMSS, leading zeros suppressed.  The default value of
  706.               30 minutes (3000) should be fine for most.
  707.               Command line argument: -m
  708.  
  709. PageType      Allows you to define the 'page' type extension.  Normally,
  710.               people consider HTML and cgi scripts as 'pages'.  This
  711.               option allows you to specify what extensions you consider
  712.               a page.  Default is 'htm*' and 'cgi' for web logs, and
  713.               'txt' for ftp logs.
  714.               Command line argument: -P
  715.  
  716. GraphLegend   Enable/disable the display of color coded legends on the
  717.               produced graphs.  Default is 'yes', to display them.
  718.               Command line argument: -L
  719.  
  720. GraphLines    Specify the number of background reference lines to display
  721.               on produced graphs.  The default is 2.  To disable the use
  722.               of background lines, use zero ('0').
  723.               Command line argument: -l
  724.  
  725. CountryGraph  This keyword is used to either enable or disable the creation
  726.               and display of the Country Usage graph.  Values may be either
  727.               'yes' or 'no', with the default being 'yes'.
  728.               Command line argument: -Y
  729.  
  730. HourlyGraph   This keyword is used to either enable or disable the creation
  731.               and display of the Hourly Usage graph.  Values may be either
  732.               'yes' or 'no', with the default being 'yes'.
  733.               Command line argument: -G
  734.  
  735. HourlyStats   This keyword is used to either enable or disable the creation
  736.               and display of the Hourly Usage statistics table.  Values may
  737.               be either 'yes' or 'no', with the default being 'yes'.
  738.               Command line argument: -H
  739.  
  740. IndexAlias    This allows additional 'index.html' aliases to be defined.
  741.               Normally, The Webalizer scans for and strips the string
  742.               "index." from URL's before processing them.  This turns a
  743.               URL such as /somedir/index.html into just /somedir/ which
  744.               is really the same URL.  This keyword allows _additional_
  745.               names to be treated in the same fashion for sites that use
  746.               different default names, such as "home.html".  The string
  747.               is scanned for anywhere in the URL, so care should be used
  748.               if and when you define additional aliases.  For example,
  749.               if you were to use an alias such as 'home', the URL
  750.               /somedir/homepages/brad/home.html would be turned into just
  751.               /somedir/ which probably isn't the intended result.  Instead,
  752.               you should have specified 'home.htm' which would correctly
  753.               turn the URL into /somedir/homepages/brad/ like intended.
  754.               It should also be noted that specified aliases are scanned
  755.               for in EVERY log record... A bunch of aliases will noticably
  756.               degrade performance as each record has to be scanned for
  757.               every alias defined.  You don't have to specify 'index.' as
  758.               it is always the default.
  759.               Command line argument: -I 
  760.  
  761. MangleAgents  The MangleAgents keyword specifies the level of user agent
  762.               name mangling, if any.  There are 6 levels that may be specified,
  763.               each producing a different level of detail displayed.  Level 5
  764.               displays only the browser name (MSIE or Mozilla) and the major
  765.               version number.  Level 4 adds the minor version (single
  766.               decimal place).  Level 3 adds the minor version to two decimal
  767.               places.  Level 2 will also add any sub-level designation
  768.               (such as Mozilla/3.01Gold or MSIE 3.0b).  Level 1 will also
  769.               attempt to add the system type.  The default level 0 will
  770.               leave the user agent field unmodified and produces the
  771.               greatest amount of detail.
  772.               Command line argument: -M
  773.  
  774. Incremental   This allows incremental processing to be enabled or disabled.
  775.               Incremental processing allows processing partial logs without
  776.               the loss of detail data from previous runs in the same month.
  777.               This feature saves the 'internal state' of the program so that
  778.               it may be restored in following runs.  See the section above
  779.               titled "Incremental Processing" for additional information.
  780.               The value may be 'yes' or 'no', with the default being 'no'.
  781.               Command line argument: -p
  782.  
  783. IncrementalName
  784.               Allows specification of the incremental data filename if
  785.               desired.  Normally, the file named "webalizer.current' is
  786.               used, kept in the standard output directory.  If specified,
  787.               filenames are relative to the standard output directory,
  788.               unless an absolute name is given (ie: starts with '/').
  789.  
  790.  
  791. Top Table Keywords
  792. ------------------
  793.  
  794. TopAgents     This allows you to specify how many "Top" user agents are
  795.               displayed in the "Top User Agents" table.  The default
  796.               is 15.  If you do not want to display user agent statistics,
  797.               specify a value of zero (0).  The display of user agents
  798.               will only work if your web server includes this information
  799.               in its log file (ie: a combined log format file).
  800.               Command line argument: -A 
  801.  
  802. TopCountries  This allows you to specify how many "Top" countries are
  803.               displayed in the "Top Countries" table.  The default is
  804.               50.  If you want to disable the countries table, specify
  805.               a value of zero (0).
  806.               Command line argument: -C 
  807.  
  808. TopReferrers  This allows you to specify how many "Top" referrers are
  809.               displayed in the "Top Referrers" table.  The default is
  810.               30.  If you want to disable the referrers table, specify
  811.               a value of zero (0).  The display of referrer information
  812.               will only work if your web server includes this information
  813.               in its log file (ie: a combined log format file).
  814.               Command line argument: -R 
  815.  
  816. TopSites      This allows you to specify how many "Top" sites are
  817.               displayed in the "Top Sites" table.  The default is 30.
  818.               If you want to disable the sites table, specify a value
  819.               of zero (0).
  820.               Command line argument: -S 
  821.  
  822. TopKSites     Identical to TopSites, except for the 'by KByte' table.
  823.               Default is 10.  No command line switch for this one.
  824.  
  825. TopURLs       This allows you to specify how many "Top" URL's are
  826.               displayed in the "Top URL's" table.  The default is 30.
  827.               If you want to disable the URL's table, specify a value
  828.               of zero (0).
  829.               Command line argument: -U 
  830.  
  831. TopKURLs      Identical to TopURLs, except for the 'by KByte' table.
  832.               Default is 10.  No command line switch for this one.
  833.  
  834. TopEntry      Allows you to specify how many "Top Entry Pages" are
  835.               displayed in the table.  The default is 10.  If you
  836.               want to disable the table, specify a value of zero (0).
  837.               Command line argument: -e
  838.  
  839. TopExit       Allows you to specify how many "Top Exit Pages" are
  840.               displayed in the table.  The default is 10.  If you
  841.               want to disable the table, specify a value of zero (0).
  842.               Command line argument: -E
  843.  
  844. TopSearch     Allows you to specify how many "Top Search Strings" are
  845.               displayed in the table.  The default is 20.  If you
  846.               want to disable the table, specify a value of zero (0).
  847.               Only works if using combined log format (ie: contains
  848.               referrer information).
  849.  
  850.  
  851. Hide Object Keywords
  852. --------------------
  853.  
  854. These keywords allow you to hide user agents, referrers, sites and
  855. URL's from the various "Top" tables.  The value for these keywords
  856. are the same as those used in their command line counterparts.  You
  857. can specify as many of these as you want without limit.  Refer to the
  858. section above on "Command Line Options" for a description of the string
  859. formatting used as the value.  Values cannot exceed 80 characters in
  860. length.
  861.  
  862. HideAgent     This allows specified user agents to be hidden from the
  863.               "Top User Agents" table.  Not very useful, since there
  864.               a zillion different names by which browsers go by today,
  865.               but could be useful if there is a particular user agent
  866.               (ie: robots, spiders, realaudio, etc..) that hits your
  867.               site frequently enough to make it into the top user agent
  868.               listing.  This keyword is useless if 1) your log file does
  869.               not provide user agent information or 2) you disable the
  870.               user agent table.
  871.               Command line argument: -a 
  872.  
  873. HideReferrer  This allows you to hide specfied referrers from the
  874.               "Top Referrers" table.  Normally, you would only specify
  875.               your own web server to be hidden, as it is usually the
  876.               top generator of references to your own pages.  Of course,
  877.               this keyword is useless if 1) your log file does not include
  878.               referrer information or 2) you disable the top referrers
  879.               table.
  880.               Command line argument: -r 
  881.  
  882. HideSite      This allows you to hide specified sites from the "Top
  883.               Sites" table.  Normally, you would only specify your own
  884.               web server or other local machines to be hidden, as they
  885.               are usually the highest hitters of your web site, especially
  886.               if you have their browsers home page pointing to it.
  887.               Command line argument: -s 
  888.  
  889. HideURL       This allows you to hide URL's from the "Top URL's" table.
  890.               Normally, this is used to hide items such as graphic files,
  891.               audio files or other 'non-html' files that are transferred
  892.               to the visiting user.
  893.               Command line argument: -u 
  894.  
  895. Group Object Keywords
  896. ---------------------
  897.  
  898. The Group* keywords allow object grouping based on Site, URL, Referrer
  899. and User Agent.  Combined with the Hide* keywords, you can customize
  900. exactly what will be displayed in the 'Top' tables.  For example, to
  901. only display totals for a particular directory, use a GroupURL and HideURL
  902. with the same value (ie: '/help/*').  Group processing is only done after
  903. the individual record has been fully processed, so name mangling and
  904. site total updates have already been peformed.  Because of this, groups
  905. are not counted in the main site total (as that would cause duplication).
  906. Groups can be displayed in bold and shaded as well.  Grouped records are
  907. not, by default, hidden from the report.  This allows you to display a
  908. grouped total, while still being able to see the individual records, even
  909. if they are part of the group.  If you want to hide the detail records,
  910. follow the Group* directive with a Hide* one using the same value.  There
  911. are no command line switches for these keywords.  The Group* keywords also
  912. accept an optional label to be displayed instead of the actual value used.
  913. This label should be seperated from the value by at least one whitespace
  914. character, such as a space or tab character.  See the sample.conf file
  915. for examples.
  916.  
  917. GroupReferrer Allows grouping Referrers.  Can be handy for some of the
  918.               major search engines that have multiple host names a
  919.               referral could come from.
  920.  
  921. GroupURL      This keyword allows grouping URL's. Useful for grouping
  922.               complete directory trees.
  923.  
  924. GroupSite     This keywords allows grouping Sites.  Most used for
  925.               grouping top level domains and unresolved IP address
  926.               for local dial-ups, etc...
  927.  
  928. GroupAgent    Groups User Agents.  A handy example of how you could use
  929.               this one is to use "Mozilla" and "MSIE" as the values for
  930.               GroupAgent and HideAgent keywords.  Make sure you put the
  931.               "MSIE" one first.
  932.  
  933. GroupShading  Allows shading of table rows for groups.  Value can be
  934.               'yes' or 'no', with the default being 'yes'.
  935.  
  936. GroupHighlight Allows bolding of table rows for groups.  Value can be
  937.                'yes' or 'no', with the default being 'yes'.
  938.  
  939.  
  940. Ignore/Include Object Keywords
  941. ----------------------
  942.  
  943. These keywords allow you to completely ignore log records when generating
  944. statistics, or to force their inclusion regardless of ignore criteria.
  945. Records can be ignored or included based on site, URL, user agent and
  946. referrer.  Be aware that by choosing to ignore records, the accuracy of
  947. the generated statistics become skewed, making it impossible to produce
  948. an accurate representation of load on the web server.  These keywords
  949. behave identical to the Hide* keywords above, where the value can have
  950. a leading or trailing wildcard '*'.  These keywords, like the Hide* ones,
  951. have an absolute limit of 80 characters for their values.  These keywords
  952. do not have any command line switch counterparts, so they may only be
  953. specified in a configuration file.  It should also be pointed out that
  954. using the Ignore/Include combination to selectivly exclude an entire
  955. site while including a particular 'chunk' is _extremely_ inefficent,
  956. and should be avoided.  Try grep'ing the records into a seperate file
  957. and process it instead.
  958.  
  959. IgnoreSite    This allows specified sites to be completely ignored from
  960.               the generated statistics.
  961.  
  962. IgnoreURL     This allows specified URL's to be completely ignored from
  963.               the generated statistics.  One use for this keyword would
  964.               be to ignore all hits to a 'temporary' directory where
  965.               development work is being done, but is not accessable to
  966.               the outside world.
  967.  
  968. IgnoreReferrer This allows records to be ignored based on the referrer
  969.                field.
  970.  
  971. IgnoreAgent   This allows specified User Agent records to be completely
  972.               ignored from the statistics.  Maybe useful if you really
  973.               don't want to see all those hits from MSIE :)
  974.  
  975. IncludeSite   Force the record to be processed based on hostname.  This
  976.               takes precedence over the Ignore* keywords.
  977.  
  978. IncludeURL    Force the record to be processed based on URL.  This takes
  979.               precedence over the Ignore* keywords.
  980.  
  981. IncludeReferrer Force the record to be processed based on referrer.
  982.                 This takes precedence over the Ignore* keywords.
  983.  
  984. IncludeAgent  Force the record to be processed based on user agent.
  985.               This takes precedence over the Ignore* keywords.
  986.  
  987.  
  988. HTML Generation Keywords
  989. ------------------------
  990.  
  991. These keywords allow you to customize the HTML code that The Webalizer
  992. produces, such as adding a corporate logo or links to other web pages.
  993. You can specify as many of these keywords as you like, and they will be
  994. used in the order that they are found in the file.  Values cannot exceed
  995. 80 characters in length, so you may have to break long lines up into two
  996. or more lines.  There are no command line counterparts to these keywords.
  997.  
  998. HTMLExtension  Allows generated pages to use something other than the
  999.                default 'html' extension for the filenames.  Do not
  1000.                include the leading period ('.') when you specify the
  1001.                extension.
  1002.                Command line argument: -x
  1003.  
  1004. HTMLPre        Allows code to be inserted at the very beginning of the
  1005.                HTML files.  Defaults to the standard HTML 3.2 DOCTYPE
  1006.                record.  Be careful not to include any HTML here, as it
  1007.                is inserted _before_ the <HTML> tag in the file.  Use it
  1008.                for server-side scripting capabilities, such as php3, to
  1009.                insert scripting files and other directives.
  1010.  
  1011. HTMLHead       Allows you to insert HTML code between the <HEAD></HEAD>
  1012.                block.  There is no default.  Useful for adding scripts
  1013.                to the HTML page, such as Javascript or php3, or even
  1014.                just for adding a few META tags to the document.
  1015.  
  1016. HTMLBody       This keyword defines HTML code to be placed immediately
  1017.                after the <HEAD> section of the report, just before the
  1018.                title and "summary period/generated on" lines.  If used,
  1019.                the first HTMLHead line MUST include a <BODY> tag.  Put
  1020.                whatever else you want in subsequent lines, but keep in
  1021.                mind the placement of this code in relation to the title
  1022.                and other aspcects of the web page.  Some typical uses
  1023.                are to change the page colors and posibly add a corporate
  1024.                logo (graphic) in the top right.  If not specified, a
  1025.                default <BODY> tag is used that defines page color, text
  1026.                color and link colors (see "sample.conf" file for example).
  1027.  
  1028. HTMLPost       This keyword defines HTML code that is placed after the
  1029.                title and "summary period/generated on" lines, just before
  1030.                the initial horizontal rule <HR> tag.  Normally this keyword
  1031.                isn't needed, but is provided in case you included a large
  1032.                graphic or some other weird formatting tag in the HTMLHead
  1033.                section that needs to be cleaned up or terminated before the
  1034.                main report section.
  1035.  
  1036. HTMLTail       This keyword defines HTML code that is placed at the bottom
  1037.                right side of the report.  It is inserted in a <TABLE> section
  1038.                between table data <TD>..</TD> tags, and is top and right
  1039.                aligned within the table.  Normally this keyword is used to
  1040.                provide a link back to your home page or insert a small
  1041.                graphic at the bottom right of the page.
  1042.  
  1043. HTMLEnd        This allows insertion of closing code, at the very end of
  1044.                the page.  The default is to put the closing </BODY> and
  1045.                </HTML> tags.  If specified, you _must_ specify these tags
  1046.                yourself.
  1047.  
  1048. --------------------------------------------------------------------------
  1049.  
  1050.  
  1051. Notes on Web Log Files
  1052. ----------------------
  1053.  
  1054. The Webalizer supports CLF log formats, which should work for just
  1055. about everyone.  If you want User Agent or Referrer information, you
  1056. need to make sure your web server supplies this information in it's
  1057. log file, and in a format that the Webalizer can understand.  While
  1058. The Webalizer will try to handle many of the subtle variations in
  1059. log formats, some will not work at all.   Most web servers output
  1060. CLF format logs by default.  For Apache, in order to produce the
  1061. proper log format, add the following to the httpd.conf file:
  1062.  
  1063. LogFormat "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\""
  1064.  
  1065. This instructs the Apache web server to produce a 'combined' log
  1066. that includes the referrer and user agent information on the end of
  1067. each record, enclosed in quotes (This is the standard recommended
  1068. by both Apache and NCSA).   Netscape and other web servers have
  1069. similar capabilities to alter their log formats.  (note: the above
  1070. works for apache servers up to V1.2.  V1.3 and higher now have additonal
  1071. ways to spcify log formats... refer to included documentation).
  1072.  
  1073. Notes on FTP Log Files
  1074. ----------------------
  1075.  
  1076. The Webalizer now supports ftp logs produced by wu-ftpd and others, as
  1077. a standard 'xferlog'.  To process an ftp log, you must either use the
  1078. -F command line option or have "LogType ftp" in your configuration file.
  1079. Support for additional formats may be forthcoming, however a future
  1080. version of the Webalizer is in the works that will allow user defined
  1081. log formats, so this will become a non-issue.  It is recommended that
  1082. you create a seperate configuration file for ftp analysis, since the
  1083. values used for your web server will most likely not be suited for ftp
  1084. log analysis (ie: page types, hostname, etc.. should be different).
  1085.  
  1086. Because of the difference in web and ftp logs, there are a few limitations:
  1087.  
  1088. o Because there is no concept of a 'response code' in ftp world, response
  1089.   codes are restricted to either 200 (OK) or 206 (Partial Content), based
  1090.   on the completion status found in xferlog (for wu-ftpd, 'i'=incomplete
  1091.   and will generate a 206, 'c'=complete and will generate a 200).  If your
  1092.   ftp server doesn't supply the completion status, all requests will be
  1093.   assigned a response code of 200.  This allows the usage graph to display
  1094.   all transfer requests (hits), and how many of those completed in success
  1095.   (files - ie: 200 response codes).
  1096.  
  1097. o Page totals won't accurately reflect reality, since there isn't really
  1098.   the concept of a 'page' in regards to ftp services.  I have found that
  1099.   setting the PageType value to "README", "FIRST", etc... seems to work
  1100.   fairly well however,  and will give a pretty good indication of how
  1101.   many 'non-binary' files were requested.  Of course, the content of your
  1102.   ftp site will be different, so your results may vary.
  1103.  
  1104. o Visit totals also won't acccurately reflect reality, since visits are
  1105.   triggered on PageType requests (see above).  What you usually wind up
  1106.   with is visits=sites in most cases.
  1107.  
  1108. o Entry/Exit pages will not be calculated for ftp logs.
  1109.  
  1110. o For obvious reasons, referrers and user agents are not supported.
  1111.  
  1112. o You _cannot_ analyze both web and ftp logs at the same time.. they must
  1113.   be done seperately in different runs.
  1114.  
  1115.  
  1116. Notes on Referrers
  1117. ------------------
  1118.  
  1119. Referrers are weird critters... They take many shapes and forms, which makes
  1120. it much harder to analyze than a typical URL, which at least has some
  1121. standardization.  What is contained in the referrer field of your log
  1122. files varies depending on many factors, such as what site did the referral,
  1123. what type of system it comes from and how the actual referal was generated.
  1124. Why is this?  Well, because a user can get to your site in many ways... They
  1125. may have your site bookmarked in their browser, they may simply type your
  1126. sites URL field in their browser, they could have clicked on a link on some
  1127. remote web page or they may have found your site from one of the many search
  1128. engines and site indexes found on the web.  The Webalizer attempts to deal
  1129. with all this variation in an intelligent way by doing certain things to
  1130. the referrer string which makes it easier to analyze.  Of course, if your
  1131. web server doesn't provide referrer information, you probably don't really
  1132. care and are asking yourself why you are reading this section...
  1133.  
  1134. Most referrer's will take the form of "http://somesite.com/somepage.html",
  1135. which is what you will get if the user clicks on a link somewhere on the
  1136. web in order to get to your site.  Some will be a variation of this, and
  1137. look something like "file:/some/such/sillyname", which is a reference from
  1138. a HTML document on the users local machine.  Several variations of this can
  1139. be used, depending on what type of system the user has, if he/she is on
  1140. a local network, the type of network, etc...  To complicate things even
  1141. more, dynamic HTML documents and HTML documents that are generated by
  1142. cgi scripts or external programs produce lots of extra information which
  1143. is tacked on to the end of the referrer string in an almost infinate number
  1144. of ways.  If the user just typed your URL into their browser or clicked on
  1145. a bookmark, there won't be any information in the referrer field and will
  1146. take the form "-".
  1147.  
  1148. In order to handle all these variations, The Webalizer parses the referrer
  1149. field in a certain way.  First, if the referrer string begins with "http",
  1150. it assumes it is a normal referral and converts the "http://" and following
  1151. hostname to lowercase in order to simplify hiding if desired.  For example,
  1152. the referrer "HTTP://WWW.MyHost.Com/This/Is/A/HTML/Document.html" will become
  1153. "http://www.myhost.com/This/Is/A/HTML/Document.html".  Notice that only the
  1154. "http://" and hostname are converted to lower case... The rest of the
  1155. referrer field is left alone.  This follows standard convention, as the
  1156. actuall method (HTTP) and hostname are always case insensitive, while the
  1157. document name portion is case sensitive.
  1158.  
  1159. Referrers that came from search engines, dynamic HTML documents, cgi
  1160. scripts and other external programs usually tack on additional information
  1161. that it used to create the page.  A common example of this can be found
  1162. in referrals that come from search engines and site indexes common on the
  1163. web.  Sometimes, these referrers URL's can be several hundred characters
  1164. long and include all the information that the user typed in to search for
  1165. your site.  The Webalizer deals with this type of referrer by stripping
  1166. off all the query information, which starts with a question mark '?'.
  1167. The Referrer "http://search.yahoo.com/search?p=usa%26global%26link" will
  1168. be converted to just "http://search.yahoo.com/search".
  1169.  
  1170. When a user comes to your site by using one of their bookmarks or by
  1171. typing in your URL directly into their browser, the referrer field is
  1172. blank, and looks like "-".  Most sites will get more of these referrals
  1173. than any other type.  The Webalizer converts this type of referral into
  1174. the string "- (Direct Request)".  This is done in order to make it easier
  1175. to hide via a command line option or configuration file option.  This is
  1176. because the character "-" is a valid character elsewhere in a referrer
  1177. field, and if not turned into something unique, could not be hidden without
  1178. possibly hiding other referrers that shouldn't be.
  1179.  
  1180.  
  1181. Notes on Character Escaping
  1182. ---------------------------
  1183.  
  1184. The HTTP protocol defines certain ways that URL's can look and behave.  To
  1185. some extent, referrer fields follow most of the same conventions.  Character
  1186. escaping is a technique by which non-printable or other non-ASCII (and even
  1187. some ASCII) characters can be used in a URL.  This is done by placing the
  1188. Hexdecimal value of the character in the URL, preceeded by a percent sign '%'.
  1189. Since Hex values are made up of ASCII characters, any character can be
  1190. escaped to ensure only printable ASCII characters are present in the URL.
  1191. Some systems take this concept to the extreme and escape all sorts of stuff,
  1192. even characters that don't need to be escaped.  To deal with this, The
  1193. Webalizer will un-escape URL's and referrers before being processed. For
  1194. Example, the URL "/www.mrunix.net/%7Ebrad/resume.html" is the same URL as
  1195. "/www.mrunix.net/~brad/resume.html", a very common form of a URL to access
  1196. users web pages.  If the URL's were not un-escaped, they would be treated as
  1197. two seperate documents, even though they are really one and the same.
  1198.  
  1199.  
  1200. Random thoughts on DNS lookups
  1201. ------------------------------
  1202.  
  1203. A lot of people have asked for the ability to do DNS lookups within
  1204. The Webalizer, as their servers don't do the reverse mapping.  My
  1205. usual response is that there are far too many such programs and
  1206. scripts that will process a log file doing just that.  One such
  1207. program is 'logresolve' that comes with the Apache distribution
  1208. (in the /support directory of the source distribution).  On my
  1209. machines, there are several programs that process log files at
  1210. the end of each month, and it is much easier to do the reverse
  1211. DNS lookups one time only, instead of multiple times in seperate
  1212. places.  Reverse DNS lookups may be included in a future release,
  1213. but I don't guarantee it.
  1214.  
  1215. Update: Sasha Pachev submitted a reverse DNS patch that adds DNS
  1216.         lookups.  Because of compatability problems across multiple
  1217.         platforms, it's being currently kept seperate.  It will
  1218.         most likely be merged into the main code base sometime in
  1219.         the future.  You can find it at all the usual places, and
  1220.         is named webalizer-x.xx-xx-reverse_dns.patch (x's are the
  1221.         version level the patch applies to).
  1222.  
  1223.  
  1224. Search String Analysis
  1225. ----------------------
  1226.  
  1227.   The Webalizer will do a minimal analysis on referrer strings that
  1228. it finds, looking for well known search string patterns.  Most of
  1229. the major search engines are supported, such as yahoo, altavista,
  1230. lycos, etc...  Unfortunately, search engines are always changing
  1231. their internal/CGI query formats, new search engines are coming on
  1232. line every day, and the ability to detect _all_ search strings is
  1233. nearly impossible.  However, it should be accurate enough to give
  1234. a good indication of what users were searching for when they stumbled
  1235. across your site.
  1236.  
  1237.  
  1238. Notes on Visits/Entry/Exit Figures
  1239. ----------------------------------
  1240.  
  1241. The majority of data analyzed and reported on by The Webalizer is
  1242. as accurate and correct as possible based on the input log file.
  1243. However, due to the limitation of the HTTP protocol, the use of
  1244. firewalls, proxy servers, multi-user systems, the rotation of your
  1245. log files, and a myriad of other conditions, some of these numbers
  1246. cannot, without absolute accuracy, be calculated.  In particular,
  1247. Visits, Entry Pages and Exit Pages are suspect to random errors
  1248. due to the above and other conditions.  The reason for this is
  1249. twofold, 1) Log files are finite in size and time interval, and
  1250. 2) There is no way to distinguish multiple individual users apart
  1251. given only an IP address.  Because log files are finite, they have
  1252. a begining and ending, which can be represented as a fixed time
  1253. period.  There is no way of knowing what happened previous to this
  1254. time period, nor is it possible to predict future events based on
  1255. it.  Also, because it is impossible to distinguish individual users
  1256. apart, multiple users that have the same IP address all appear to
  1257. be a single user, and are treated as such.  This is most common where
  1258. corporate users sit behind a proxy/firewall to the outside world,
  1259. and all requests appear to come from the same location (the address
  1260. of the proxy/firewall itself).  Dynamic IP assignment (used with
  1261. dial-up internet accounts) also present a problem, since the same
  1262. user will appear as to come from multiple places.
  1263.  
  1264. For example, suppose two users visit your server from XYZ company,
  1265. which has their network connected to the internet by a proxy server
  1266. 'fw.xyz.com'.  All requests from the network look as though they
  1267. originated from 'fw.xyz.com', even though they were really initiated
  1268. from two seperate users on different PC's.  The Webalizer would
  1269. see these requests as from the same location, and would record only
  1270. 1 visit, when in reality, there were two.  Because entry and exit
  1271. pages are calculated in conjunction with visits, this situation
  1272. would also only record 1 entry and 1 exit page, when in reality,
  1273. there should be 2.
  1274.  
  1275. As another example, say a single user at XYZ company is surfing
  1276. around your website..  They arrive at 11:52pm the last day of
  1277. the month, and continue surfing until 12:30am, which is now a
  1278. new day (in a new month).  Since a common practice is to rotate
  1279. (save then clear) the server logs at the end of the month, you
  1280. now have the users visit logged in two different files (current
  1281. and previous months).  Because of this (and the fact that the
  1282. Webalizer clears history between months), the first page the
  1283. user requests after midnight will be counted as an entry page.
  1284. This is unavoidable, since it is the first request seen by that
  1285. particular IP address in the new month.
  1286.  
  1287. For the most part, the numbers shown for visits, entry and exit
  1288. pages are pretty good 'guesses', even though they may not be 100%
  1289. accurate.  They do provide a good indication of overall trends,
  1290. and shouldn't be that far off from the real numbers to count much.
  1291. You should probably consider them as the 'minimum' amount possible,
  1292. since the actual (real) values should always be equal or greater
  1293. in all cases.
  1294.  
  1295.  
  1296. Log files and The Webalizer
  1297. ---------------------------
  1298.  
  1299. Most sites will choose to have The Webalizer run from cron at specified
  1300. intervals.  Care should be taken to ensure that data is not lost as a
  1301. result of log file rotations.  A suggested practice is to rotate your
  1302. web server logs at the end of each month as close to midnight as possible,
  1303. then have The Webalizer process the 'end of month' log file before running
  1304. statistics on the new, current log.  On our systems, a shell script called
  1305. 'rotate_logs' is run at midnight, the end of each month.  This script file
  1306. looks like:
  1307.  
  1308. ------------------------- file: rotate_logs ------------------------------
  1309. #!/bin/sh
  1310.  
  1311. # halt the server
  1312. kill `cat /var/lib/httpd/logs/httpd.pid`
  1313.  
  1314. # define backup names
  1315. OLD_ACCESS_LOG=/var/lib/httpd/logs/old/access_log.`date +%y%m%d-%H%M%S`
  1316. OLD_ERROR_LOG=/var/lib/httpd/logs/old/error_log.`date +%y%m%d-%H%M%S`
  1317.  
  1318. # make end of month copy for analyzer
  1319. cp /var/lib/httpd/logs/access_log /var/lib/httpd/logs/access_log.backup
  1320.  
  1321. # move files to archive directory
  1322. mv /var/lib/httpd/logs/access_log `echo $OLD_ACCESS_LOG`
  1323. mv /var/lib/httpd/logs/error_log  `echo $OLD_ERROR_LOG`
  1324.  
  1325. # restart web server
  1326. /usr/sbin/httpd
  1327.  
  1328. # compress the archived files
  1329. /bin/gzip $OLD_ACCESS_LOG
  1330. /bin/gzip $OLD_ERROR_LOG
  1331. ------------------------- end of file ------------------------------------
  1332.  
  1333. This script first stops the web server using a 'kill' command.  Apache
  1334. keeps the PID of the server in the file httpd.pid, so we use it as the
  1335. argument for the kill.  Next, it defines some names for the backup files,
  1336. which are basically the name of the files with the date and time appended
  1337. to the end of them.  It then makes a copy of the log file, appended with
  1338. '.backup' in the log directory, moves the current log files to an archive
  1339. directory (/var/lib/httpd/logs/old) and restarts the server.  This setup 
  1340. allows the web server to be down for the minimum amount of time needed,
  1341. which is important for busy sites.  If you don't want to stop the server,
  1342. you can remove the inital 'kill' command, and replace the '/usr/sbin/httpd'
  1343. line with "kill -1 `cat /var/lib/httpd/logs/httpd.pid`" command instead,
  1344. On most web servers, this will cause a restart of the server and create
  1345. the new log files in the process...
  1346.  
  1347. At this point, we have made copies of the previous months logs,  the web
  1348. server is going about it's business as usual, and we have all the time in
  1349. the world to do any other additional processing we want.  The last two
  1350. lines of the script compress the archived logs using the GNU zip program
  1351. (gzip).  Remember, we still have a copy of the log which we can now run
  1352. The Webalizer on without having to do any further processing.
  1353.  
  1354. Next, we define two crontab entries.  The first runs the above 'rotate_logs'
  1355. script at midnight at the end of the month.  The second runs The Webalizer
  1356. on the '.backup' log file created above at 5 minutes after midnight.  This
  1357. gives other end of month processing jobs a chance to run so we don't bog
  1358. the system down too much.  If you have lots of end of month stuff going on,
  1359. you can change the timing to suit your needs.  The crontab entries look
  1360. something like:
  1361.  
  1362. ------------------------- crontab entries --------------------------------
  1363. # Rotate web server logs and run monthly analysis
  1364. 0 0 1 * *       /usr/local/adm/rotate_logs
  1365. 5 0 1 * *       /usr/bin/webalizer -Q /var/lib/httpd/logs/access_log.backup
  1366. ------------------------- end of crontab ---------------------------------
  1367.  
  1368. As you can see, the log rotations occur at midnight, and the analysis
  1369. is done at 5 minutes after.  Once you verify that The Webalizer ran
  1370. successfully, the access_log.backup file can be deleted as it isn't
  1371. needed any more.  If you need to re-run the analysis, you still have
  1372. the compressed archive copy that the shell script created.  In order
  1373. for the above analysis to work properly, you should have already
  1374. created an /etc/webalizer.conf configuration file sutable for your
  1375. site, or otherwise specify configuration options or a configuration
  1376. file on the crontab command line above.
  1377.  
  1378. If you want The Webalizer to be run more often than once a month, you
  1379. can specify additional crontab entries to do this as well.  Care should
  1380. be taken however to ensure that The Webalizer is not running when the
  1381. end of month processing above occurs, or unpredictable results may
  1382. happen (such as an inability to rotate the logs due to a file lock). 
  1383. The easiest way is to run it on the half hour with a crontab entry like:
  1384.  
  1385. 30 * * * *      /usr/bin/webalizer
  1386.  
  1387.  
  1388. Language Support
  1389. ----------------
  1390.  
  1391. Version 1.0x of The Webalizer added language support.  This
  1392. support is only provided at compile time in the form of an
  1393. include file containing all the strings used by The Webalizer.
  1394. The source distribution contains all language files that were
  1395. available at the time, with English being the default as
  1396. that is the only human language I speek fluently, and me
  1397. Espanol es muy malo.  Several people have already indicated
  1398. the desire to do translations into various languages, and as
  1399. I receive the language files, will make them available via
  1400. ftp at ftp://ftp.mrunix.net/pub/webalizer/lang.  Unless there
  1401. happens to be a binary distribution in the language you need,
  1402. you will need to grab the source distribution and compile the
  1403. program yourself. See the file INSTALL that comes in the source
  1404. distribution for information on how to use a language other than
  1405. English.
  1406.  
  1407. It should also be noted that the GD graphics library, used to
  1408. produce the inline graphics in the output HTML,  doesn't
  1409. support extended character sets, so if you are translating
  1410. the language file, you will no doubt encounter this problem.
  1411.  
  1412. New: You can now specify the language to use when you are building
  1413.      program from source, using the configure script.  Just add
  1414.      --with-language=language_name   , where 'language_name' is the
  1415.      name of a valid language file in the /lang/ directory.  For
  1416.      example, --with-language=french  will build using french as
  1417.      the default language.  You should consuld the INSTALL file
  1418.      for additional information on building the program from source.
  1419.  
  1420.  
  1421. Known Issues
  1422. ------------
  1423.  
  1424.  o Memory Usage.  The Webalizer makes liberal use of memory for internal
  1425.     data structures during analysis.  Lack of real physical memory will
  1426.     noticably degrade performance by doing lots of swapping between memory
  1427.     and disk.  One user who had a rather large log file noticed that The
  1428.     Webalizer took over 7 hours to run with only 16 Meg of memory.  Once
  1429.     memory was increased, the time was reduced to a few minutes.
  1430.  
  1431.  o Proxy servers.  The Webalizer does not know how to deal with proxy
  1432.     records, which can cause some rather unexpected results.  If you
  1433.     do run the stats on a proxy servers log file, you get to see where
  1434.     your users have been visiting, as well as who has visited your
  1435.     server.  If someone knows of a reliable way to differentiate
  1436.     between normal log records and proxy ones, please let me know.
  1437.  
  1438.  o Performance.  The Hide*, Group*, Ignore*, Include*  and IndexAlias
  1439.     configuration options can cause a performance decrease if lots of
  1440.     them are used.  The reason for this is that every log record must
  1441.     be scanned for each item in each list.  For example, if you are
  1442.     Hiding 20 objects, Grouping 20 more, and Ignoring 5,  each record
  1443.     is scanned, at most, 46 times (20+20+5 + an IndexAlias scan).
  1444.     On really large log files, this can have a profound impact.  It
  1445.     is recommended that you use the least amount of these configuration
  1446.     options that you can, as it will greatly improve performance.
  1447.  
  1448.  
  1449. Final Notes
  1450. -----------
  1451.  
  1452. A lot of time and effort went into making The Webalizer, and to ensure that
  1453. the results are as accurate as possible.  If you find any abnormalities or
  1454. inconsistant results, bugs, errors, ommisions or anything else that doesn't
  1455. look right, please let me know so I can investigate the problem or correct
  1456. the error.  This goes for the minimal documentation as well.  Suggestions
  1457. for future versions are also welcome and apperciated.
  1458.