The following patch files:

    0.basic.patch
    1.64bit.patch
    2.hist.patch

should be applied to the base webalizer-2.01-10 (Webalizer v2.01-10) tree
as follows:

    cd /directory-above-the-webalizer-tree
    patch -p0 < 0.basic.patch
    patch -p0 < 1.64bit.patch
    patch -p0 < 2.hist.patch

After the 2.hist.patch has been applied, the track-hist tool:

    http://www.isthe.com/chongo/src/webalizer-patch/track_hist

should be run on a monthly basis.  See the comments on in 2.hist.patch
file as well as the track-hist tool itself for details.

If AND ONLY IF you use one the MaxMind (http://www.maxmind.com/) GeoIP
databases, then apply this patch as well:

    patch -p0 < 3.geolizer.patch

=-=-=

Solaris users:

Solaris uses u_longlong_t instead of u_int64_t.  So when you build and install, try:

	cd somepath/webalizer-2.01-10
	rm -f config.cache
	CFLAGS="$CFLAGS -Du_int64_t=u_longlong_t" ./configure [--optional_flags ...]
	make all
	make install

See:
	./configure --help

for a list of optional flags.

=-=-=

Here is a summary of the 0.basic.patch:

##################
# Allow webalizer on systems such as Linux to process very large log
# files (such as >2GB in size).
##################
# Some of the entries on the list are not countries.  In some cases the
# nation state status is contested.  In other cases the entry is related
# to a territory that does not claim to be a country.  In some cases
# what some claim is a country is in dispute by another country.  And
# things like .arpa are not a country.
#
# I recommend that one use the term 'location' instead of 'Nation' or
# 'Country' to avoid the whole mess.  ;-)
#
# Added are some missing locations (from the ISO UN codes and
# from GeoIP's list).  Some location names have been corrected
# or changed to their official name.  Added some more TLDs.
##################
# Spammers and other low-life forms have been stuffing the
# "top N referrer" table in order to get webalizer to generate
# links to their sites ... (perhaps because they think this
# will improve their search engine placement or perhaps because
# they wish to direct people to a poisoned web page in an effort
# to exploit some browser bug?).  Whatever the reason, we don't
# need to give them their links.
#
# This patch turns the "top N referrer" table into just values
# instead of A tags.
##################
# A number of Linux distributions need this change (because
# they do not ship with the DB compat headers and libs?).
#
# The POSIX time spec says that during a leap second, the seconds value
# may be 60.  And yes ... we had an entry that came in during a leap
# second that was rejected.  :-)
##################
# The URL, referrer and search frequently are a bit longer than
# what the original code wanted to deal with.  A 256 char limit
# seems to catch most of the longer values.
##################

Here is a summary of the 1.64bit.patch:

##################
# For very busy sites, 32 bit signed counters can overflow.  This
# is particularly when using webalizer to cover a long span of time.
# This patch converts a few values to be u_int64_t to avoid these
# numeric overflow problems.
#
# NOTE: While not required, it is recommened that you apply the
#	patch-0.basic.ptch before you apply this patch.
##################

Here is a summary of the 2.hist.patch:

##################
# By default, webalizer only keeps the last 12 months of data.  And at the 
# start of a month, the oldest month is discarded resulting in only 11+
# months of data.
#
# This code gets around the 12 month limit by maintaining a history of
# older months in a parallel directory ../history.  The summary file:
#
#	../history/summary
#
# contains lines, which of which descibes a row in the 'Summary by Month'
# table.  Each line as the following fields separated by a single space:
#
#	field  0: yyyy		    4 digit year (e.g., 2003)
#	field  1: MM		    2 digit month, with leading 0 (e.g., 08)
#	field  2: Mon		    3 Char month name (e.g., Aug)
#	field  3: ../history/usage_yyyyMM.html
#				    URL of the monthly stats.  In that same
#				    directory is the ctry_usage_yyyyMM.png,
#				    daily_usage_yyyyMM.png, and the
#				    hourly_usage_yyyyMM.png files.
#	field  4: summary_dhits	    Average daily hits
#	field  5: summary_dfiles    Average daily files
#	field  6: summary_dpages    Average daily pages
#	field  7: summary_dvisits   Average daily visits
#	field  8: summary_tsites    Monthly total sites
#	field  9: summary_tkbytes   Monthly total KBytes
#	field 10: summary_tvisits   Monthly total visits
#	field 11: summary_tpages    Monthly total pages
#	field 12: summary_tfiles    Monthly total files
#	field 13: summary_thits     Monthly total hits
#
# Example of a ../history/summary line:
#
#	2003 08 Aug ../history/usage_200308.html 13364 3634 10954 567 11138 3623829 17587 339601 112666 414304
#
# The ../history/summary file contains lines that prefer to completed webalizer
# month summaries.  Webalizer will process its 12 monthly as it does before.
# However with this patch it will look over into the ../history/summary file
# for even older months to append to the end of the 'Summary by Month' table.
#
# The file ../history/prehistory should contain a single line in the same
# form as ../history/summary except that the field 3 is just 'index.html'.
# Fields 0, 1 and 2 refer to the oldest month in the ../history/summary file.
# This is the total of the stats that have been lost / rolled off the
# end and are no longer available.  If you have no prehistory just use:
#
#	2004 07 Jul index.html 0 0 0 0 0 0 0 0 0 0
#
# where '2004 07 (Jul)' is the current month.
#
# Webalizer will produce a grand total that includes the 12 recent months,
# all of the history months mentioned in the ../history/summary file and
# the stats from the ../history/prehistory file.
#
# If ../history/summary or ../history/prehistory are not found, Webalizer
# will ignore them and just output the standard last 12 months.
#
# The track_hist tool will generate and update your ../history directory.
# All you need to do is once a month, run the track_hist
# script giving it the director(ies) under which webalizer works.
# So if your webalizer data is found in:
#
#	/var/www/html/webalizer/usage/index.html
#
# at the 1st of the month, after you run webalizer, run:
#
#	track_hist /var/www/html/webalizer
#
# NOTE: You should apply the patch-1.64bit.ptch before you apply
#	this patch.
#
# See:
#
#	http://www.isthe.com/site/isthe/webalizer/usage/index.html
#
# for an example if what an extended history looks like.
##################

Here is a summary of the optional 3.geolizer.patch:

##################
# If AND ONLY IF you use one the MaxMind (http://www.maxmind.com/) GeoIP
# databases, then apply this patch.  
# 
# This patch, on Un*x / Linux / GNU-Linux systems performs the same as the
# geolizer.patch file in geolizer_2.01-10-patch.20021107.tar.gz
# line adjusted to deal with the previous 0.basic.patch, 1.64bit.patch,
# and 2.hist.patch patches.
#
# When I apply this patch, I configure and build as follows:
#
#	cd webalizer-2.01-10
#	./configure --with-gdlib --enable-geoip
#	make all
#
# The important part is to add --enable-geoip to the configure line.
##################

=-=-=

Here are the SHA-1 hashes of the patch files:

5d4479cf0ed45512388a0e216ece60b923556bf5 0.basic.patch
5322fb9c08b559baf08e97d4b0d99da34e7cd948 1.64bit.patch
683761600bff931afc51e520feada4ee4dcbaa09 2.hist.patch
0f457d62156a8eb3eb13e60f73bb235eb4de2739 3.geolizer.patch
70e501c1e9be25e32843bc79eb32f13e050e646f track_hist

Here are the MD5 hashes of the patch files:

84ba5e29ab95944ca2f0d12304063a6e 0.basic.patch
d2fae782e2d54394f964022cf36a4788 1.64bit.patch
cdc06a6adef004c32c733d1bc9f16da2 2.hist.patch
9c7f942d48fe2aad17ad5140119eb75b 3.geolizer.patch
1d1fa6fc3ae19509f51f7e42aaea2fb7 track_hist

chongo (Landon Curt Noll, http://www.isthe.com/chongo/index.html) /\oo/\

Share and enjoy! :-)

=-=-=

# Copyright (c) 2004 by Landon Curt Noll.  All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that the above copyright, this permission notice and text
# this comment, and the disclaimer below appear in all of the following:
#
#       supporting documentation
#       source copies of this file
#
# LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
# EVENT SHALL LANDON CURT NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# chongo (Landon Curt Noll, http://www.isthe.com/chongo/index.html) /\oo/\
#
# Share and enjoy! :-)

# PLEASE NOTE: 
#
#	I do not support nor did I write webalizer, I just use it.
#       These patches are offered to you in the hopes that you
#       will find them useful and in the hopes that they might
#       make it into a webalizer release someday.
