






Setup
Every time you run MKStats, you are required to specify a configuration file that has various
settings in it. There is a 'config' directory where these configuration files should be stored,
and mkstats will look there and in the main directory for the file you specify. If you want to
put your config files elsewhere, just use the full path on the command line. There is an
example config file in the 'config' directory called 'mkstats.conf' which you can use as a
starting point. Most options should not need changed.
- $ACCESSLOG
- This is the location of your main log file. Using the -l command-line option
overrides this value.
- $log_format
- MKStats can support different log formats. This variable sets the format of the log file
specified in $ACCESSLOG. This extension is added to 'sub.readlog.' to find the log-reading
routine to import (such as sub.readlog.clf). The current available types are:
- clf = Common Log Format (standard - separate access_log, referer_log, agent_log)
- elf = Extended Log Format (CLF with referer and agent info added onto the end)
- ftp = Standard FTP xferlog.
- $REFERERLOG
- The location of your referer_log. If left blank, MKStats will not worry about it. The
-r command-line switch sets this to blank and will not process the referer_log.
- $ERRORLOG
- The location of your error_log. If left blank, MKStats will not worry about it. The
-e command-line switch sets this to blank and will not process the error_log.
- $AGENTLOG
- The location of your agent_log. If left blank, MKStats will not worry about it. The
-a command-line switch sets this to blank and will not process the agent_log.
- $TITLE
- The label to be used as the title for the main page and other reports.
- $BODY
- A full <BODY> statement which lets youspecify a background color or image for
all reports. If left blank, it defaults to <BODY BGCOLOR="#ffffff" TEXT="#000000">
(This option not present by default)
- $HEADER
- Anything you want inserted at the very top of every report. Defaults to nothing.
(This option not present by default)
- $FOOTER
- Anything you want inserted at the very boottom of every report. Deafults to
information about MKStats. (This option not present by default)
- $DEFAULT
- The default page that is loaded when a directory is loaded. Defaults to "index.html"
- $REPORT_DIR
- The directory where all reports will be written. Should be an html directory that can
be loaded in a browser. By default it is the 'output' directory, but you will probably
have to change this.
- $STATSFILE
- MKStats records all data each time it reads a file so all your stats are saved. All of
the stats are stored in the file you specify here. If this file doesnt exist, it will be
created.
- $PLUGINS
- This is the directory that will be searched for plug-in report routines. Any file of
the correct format that you place in here will be run as a report.
- $STRING [IMPORTANT]
- This lets you control which log entries get processed and which don't. By setting $STRING
to "mydirectory" for example, only URL's that contain the string "mydirectory" will be
processed. If your web page URL's begin with "/~username/", setting $STRING to "username" will
only include your files and ignore everyone elses. This also lets you create separate reports
for separate directories of your site. $STRING can be a full regular expression.
- $EXCLUDEFILE
- The file that should be read to determine which URL's to ignore when reading the log
file. The format of this file is a separate entry for each line. Any URL beginning with
a string found in the $EXCLUDEFILE will be ignored. This lets you keep secure, private,
or test areas of your server out of the reports.
- $IGNORESITE
- Lets you specify an expression to check against the site accessing the page. If the
site matches this variable, the line is completely ignored. Often used to ignore your own
accesses by excluding your site. Can be a regular expression.
- $IGNOREPAGE
- An expression that says which pages should be ignored. This lets you ignore URL's that
match a certain pattern that would not work inside of the $EXCLUDEFILE, for instance. For
example, setting $IGNOREPAGE to "test" would force MKStats to ignore any URL that contains
the string "test".
- @IGNORETYPES
- An array containing all file extensions to ignore. These should include things like
gif and jpg. Do not put a . before the extension - the program will handle that. These files
will still be counted in the byte count and total connections, but will not be counted as
hits or used in any of the other totals.
- $PAGE_MIN
- In order to make reports a little more compact, only pages with a minimum of $PAGE_MIN
accesses will be included. Defaults to 10.
- $RESOLVEIP
- If set to 1, MKStats will attempt to translate IP addresses into full host names to get
more informative statistics. Enabling this option slows down the program considerably, but
will give more accurate results for the domain and country information.
- $REF_IGNOREDOMAIN
- An expression that is used when reading the referer_log to decide whether or not to
keep a line. Any site matching $REF_IGNOREDOMAIN doesn't get counted. To ignore the internal
links visitors take, set this to your site.
- $REF_MINREFS
- When reporting on the referer_log, this specifies the minimum number of times an
external link must have been followed to be included. If you have lots of referring pages,
set this higher to only count those that are used most often. (After all, if a link to your
site is followed only once, it's usually not worth knowing about).
- $REF_MINWORDS
- The minimum number of times a search word must be used in order to be in the reports.
- $ERR_STRING
- Any errors found in the error_log are only included if they include this string. So if
you only want to know about your own pages that were requested that did not exist, you could
include your username or directory in this string. If left empty, all errors encountered by
the server will be included.
Report Options:
For all options below except $INDEXTYPE, setting the variable to 1 turns the report on, and setting it to 0
turns it off. This allows you to control exactly which type of reports to generate.
- $INDEXTYPE
- Controls which type of index that will be generated. The 'graphical' and 'text' types are
supported, and additional indexing styles may become available. This string is added to
'sub.index.' to decide which routine to import, for example 'sub.index.graphical'.
- $what_summary
- A summary of page accesses.
- $who_summary
- A summary of where people are coming from.
- $when_summary
- A summary of when requests are coming in.
- $separate_pages
- Separate reports will be generated for each individual page with information about that
page in particular. With a lot of pages on a site, this can create a lot of files (although
this is perhaps one of the most useful reports).
- $referer_summary
- A summary of all the information from the referer_log.
- $status_codes
- A page summarizing the HTTP status codes for the current log file so you can see what kind
of answers your server was giving.
- $daygraph
- A text graph showing the accesses for each separate day to track usage trends.
- $graphic_daygraph
- A graph showing the same information as $daygraph, but using graphical bar charts. This
report must be viewed with Netscape or a compatible browser.
- $gd_time
- Uses the GD libraries to create gif charts for various statistics. You must have
GD.pm properly installed for this to work! This is off by default.
- $tops
- A simple report summarizing the top pages, days, domains, etc.
- $agent_summary
- A summary of which browsers were used.
- $error_summary
- A summary of the errors that were encountered.
- $user_summary
- If you use authenticated logins, this will show you which users were most active for the
current month and overall.
Once you have a configuration file created, it is time to run the program. For instructions
on running the program from the command-line, go to Options.





