Electronic Manual - MagicStatistics
© SunnyScript - www.sunnyscript.com

 
Table of contents
 
Installation and configuration [go] Directory structure
[go] File transfer to the server
[go] Configuration
General information about the software [go] Log file basics
[go] Supported log formats
[go] Reports and statistics
Administration panel [go] Admin menu
[go] Edit software settings
[go] Show statistics
[go] Log file maintenance
[go] Parsing and analyzing of log file(s)
Scheduled parsing of logs [go] Task scheduling (using Cron)
[go] Trouble-shooting
Customer services [go] Need help ? Contact the SunnyScript service department !

Smart tip: This handbook is also designed to be printed... set your printer's page orientation to landscape format, so there is enough space to place hand-written notes on the left and right margin easily.
 


 
Installation and configuration
 
SunnyScript offers an optional available installation service, if you don't want to install the software yourself.
Please contact our customer service department by e-mail for detailed information and pricing.
 
Directory structure...

The software can be installed at any place that allows the execution of CGI software: Most server systems provide a special directory called "cgi-bin" where you have to install the application, while others are not limited to a particular location.

In a common environment, we recommend to create a new sub-directory within the existing "cgi-bin" folder to separate the software from other already installed products.

Required "template.en" directory:

Inside the directory you desired for installation, please create a new sub-directory called "template.en". It's used to hold the content of "template.en" directory delivered with your software package.

Adjust path to Perl:

Open all program files (*.pl and *.cgi) in a text editor and change the first line "#!/usr/bin/perl" that it reflects the correct path to Perl 5 (or higher version) on your system. This is required to let your server know where the Perl interpreter is located.

Usage note: On most systems, /usr/bin/perl is already the default path to Perl and so no modifications are required.
 

File transfer to the server...

Upload all files to the created directories. If a ftp client is used, ensure to set the "ASCII transfer mode" for file submissions.

Detailed file table: Scheme: [filename | suggested place to upload (short description); file permission]:
 
Filename...
Description...
Filename...
Description...
* cgi-bin (program & data files); 755 template.en/* template.en (templates); 666

Important notes: Please double-check file permissions and transfer mode, otherwise the software may not work as intended. Depending upon the server configuration, different file permissions than the ones stated above may be necessary.

Smart tip: Our installation helper install.cgi makes it easier... just call it from your web browsing software (requires correct installation of this script) and it automatically checks your entire installation, adjusts permissions and fixes typical errors.
 

Configuration...

After you have uploaded all files, you may wish to start the admin panel first time to initialize the system parameters. In order to do so, please call admin.cgi with your favorite web browsing software:
 
Action to perform...
URL to call (location varies on your system, of course)...
Open admin panel http://www.sunnyscript.com/cgi-bin/ms/admin.cgi

Before you proceed, it is highly recommended to set an administration password. After this is done, access to the admin panel is granted only by authenticating yourself with the chosen password.

Now click on the button "Edit system parameters" and configure the shown parameters according your needs.

Usage note: Since all parameters are automatically filled with correct values, modifications on your side may not be required.

Directories and files:
 
Name of parameter to set...
Description...
CGI files directory
Example: /usr/www/cgi-bin/ms
Absolute path to the location of MagicStatistics on your server.

Platform specific settings:
 
Name of parameter to set...
Description...
Mailing program (for Unix only)
Example: /usr/bin/sendmail
Absolute path to Sendmail (or compatible) application on your server.
SMTP server
Example: smtp.sunnyscript.com
SMTP server for handling mails; when left blank, default mail application is used. This setting is required for non-Unix systems, otherwise optional.
Don't use flock
Example: Unchecked
"flock" is normally supported directly by the operating system; should it be unavailable for any reason (e.g. on Win9x, WinMe), mark this checkbox.
Admin e-mail address
Example: admin@sunnyscript.com
E-mail address of the system administrator (e.g. webmaster).

Compression settings:
 
Name of parameter to set...
Description...
Use internal gzip compression
Example: Checked
Use the internal compression utility (to pack statistical reports) or unmark this checkbox and specify external utility as followed.

Technical note: This choice is only available, if there is the Perl module "Compress::Zlib" installed.

External compression utility command
Example 1: gzip -fq $file_from
Example 2: c:\winrar.exe a $file_to $file_from
Absolute path to a file compression application on your server.

Technical note: In some cases, the variables $file_to and $file_from are required to determine source and target files (see available literature).

External compressed file extension
Example: gz
File extension used by the external compression utility.

URLs:
 
Name of parameter to set...
Description...
URL of CGI files directory
Example: http://www.sunnyscript.com/cgi-bin/ms
URL to the location of MagicStatistics on your server.

After you have verified all settings carefully, click on the button "Save parameters" to take over modifications to the system. It is also possible to bring back previous values with the "Let the script restore defaults" button.
 

Congratulations - you have successfully installed the software :-)

 
General information about the software
Log file basics...

What are log files ?

The server's raw log file(s) - also called server log - stores records of all accesses made to your website. So the logs are like a diary which contains all actions done by the server within a given time period.

These raw log(s) are the basis for MagicStatistics to create reports and usage statistics for your website and server.

Where are the server log files located ?

The location of the server logs depends upon the used operating system and server software. Normally you find the raw logs placed in a directory called "logs", "accesslogs" or a similar one.

In any case, it is recommended to ask your webhosting provider regarding the correct location. Sometimes your webhoster also needs to enable access to these raw log files before they are useable.

What happens with the log data ?

Each time you start the "Parse log file(s)" function from the admin panel or a scheduled log parsing runs, MagicStatistics will read in the raw log data (server logs) and analyzes their content.

The analyzed raw log data - now called parsed log data - is saved in a special database format, which allows MagicStatistics to access the collected information quickly at any time (more details follows in later chapters).

Whenever you request a report from MagicStatistics, the data is taken from these special report data files. So the server log doesn't need to be analyzed again, which saves much time, disk space and CPU resources.

During log file parsing, additional tasks may be also performed, like DNS lookups, mailing of statistics and log maintenance.
 

Supported log formats...

MagicStatistics supports the following log file formats by using intelligent scanning routines:
 
All standard log formats (Common NCSA; W3C Extended, custom formats of W3C)
NCSA/CERN Common
NCSA/CERN Combined
Simple
Split log files (daily, weekly, monthly splits supported) and non-split log files

Technical note: Each log file line is scanned for matching format prior parsing. If you should decide to switch your log format, you don't need to take care about MagicStatistics.

Important note: Custom log formats are also supported. But please note that some of them may lack of specific information, which leads into missing report types (the ones which would base upon these non-existing data).
 

Reports and statistics...

What kinds of statistics are available ?
 
Report type...
Description...
Accesses Overview report: All most important statistics at a glance.
Top requests (with timing): Top-visited URLs (pages) of your website.
Top directories: Top-visited directories of your website.
OS info: Operating system platforms used to access your website.
Top entry/exit pages, ways: First & last pages viewed, routes through your website.
Visitor information Top referring domains: Domain names from which people came to your website.
Top referrers: URLs from which people came to your website.
Search engines tracking: Search engines and keywords used to find your website.
User agent info: Web browsing software used to access your website.
IP tracking: IP addresses of your website's visitors.
Countries report: Countries, your website's visitors lives in.
Continents report: Same as the countries report, but sorted by continents.
Web pages and referring URLs: Pages and referring information.
"Stay on page" time: URLs with top viewing duration ("most interesting" pages).
Server performance Daily load: Number of hits per day and calculated server load.
Hourly load: Average hourly server load (entire time period).
Least active hours: Time periods of very less accesses (server down ?).
Peak hours: Time periods of very high server loads.
Hourly break-down: Average hourly server load (for each day).
Errors Access errors: Client or server-sided errors (e.g. file not found).
Status codes report: Returned status codes of errors and successful actions.
Development by time Daily visitors: Changes in visitor activity during a particular time period.
Daily server load: Changes in server load during a particular time period.

How reliable are statistics based upon server logs ?

Statistics based upon the raw log files are the most exact ones, because each single access is surely registered by the server without the risk of missing accesses and incomplete or erroneous data.

All website usage reports generated by MagicStatistics are absolutely reliable and can be used for professional applications, like the creation of visitor profiles and marketing research (e.g. target group analyses).
 


 
Administration panel

The administration panel is a convenient way to work interactively with MagicStatistics. You can start the admin panel by calling admin.cgi with your favorite web browsing software:
 
Action to perform...
URL to call (location varies on your system, of course)...
Open admin panel http://www.sunnyscript.com/cgi-bin/ms/admin.cgi
 
Admin menu...

This screen allows the following actions:
 
Main menu options...
Description...
Choose action
 
Available selection...
Description...
Edit software settings Adjust the software settings according your needs.
Show statistics Create a website usage report and access stats.
Log file maintenance Clear all log files.
Parse log file(s) Read in and analyze new raw log data.
 
Change password Change admin password.

Important note: If you forgot the admin password, please remove admin.pass file located in "auth" directory (see software directory of MagicStatistics). Then you can set a new password next time accessing the admin panel.

Edit system parameters Click on this button to modify system related parameters.

Usage note: The top menu line provides links to all menu entries regardless on which page you are currently. This will help you to navigate more convenient through the software.
 

Edit software settings...

In order to do so, please select "Edit software settings" from the main menu. Alternatively you can click on "Settings" in the upper left corner of the screen.

General settings:
 

MagicStatistics asks...
Description...
Name of site Name of the website for which statistics are generated.
Domain of site Domain name of the website for which statistics are generated (in case of multiple domains, use one that has access to the entire website).
Relative or absolute path
to log file(s)
Relative (from software location) or absolute (from server root) path to the raw log file(s) of the server; these raw log files will be used for parsing.

Usage note: If your server supports split logs, this parameter must contain the path to the directory holding the logs. MagicStatistics will try to parse all files in this directory.

Sample paths:
../../logfile/logs.txt
/usr/home/logs/access.log
/usr/web/mylogs/

Page extensions
(separated by comma)
File extensions recognized by MagicStatistics. It is recommended, to keep at least these entries for common applications: htm,html,cgi,pl
Exclude spider accesses
(separated by comma)
Most search engines (or other Internet services) are using automated robots to read the content of your website.

In order not to track these spiders as real visitors, you may type in strings used as parts of "user agent info" to detect such robots. If a spider is detected, the concerned visit will be excluded entirely from statistics.

Sample keywords: spider,bot/,slurp,crawler

Maximum data transfer (bytes)
of server per minute
Maximum data transfer of the server / hosting account handled per minute. This value is used to calculate server loads in reports.

Technical note: If no information is available from your webhoster, you may use 3932160 bytes (3840 KB) as a good average value.

Do DNS lookup for clients Marked to resolve the numeric IP addresses within the raw log(s) into host names.

Usage note 1: MagicStatistics doesn't use DNS lookups for determination of countries and continents, so you can simply turn off them without losing these reports.

Usage note 2: Some servers are able to automatically perform DNS lookups of their own; for performance reasons, this way should be preferred.

Date format in reports Specify the date format used within generated reports.

Default setting: DD. MMMM YYYY
Example for default: 01. January 2525

Available components for this parameter:
 

Component...
Description...
Date format parts
D 2-digit day (without leading zero).
DD 2-digit day (with leading zero).
DDD Abbreviation of the weekday.
DDDD Complete name of the weekday.
M 2-digit month (without leading zero).
MM 2-digit month (with leading zero).
MMM Abbreviation of the month.
MMMM Complete name of the month.
YY 2-digit year.
YYYY 4-digit year.
Time format parts
h 2-digit hour (without leading zero).
hh 2-digit hour (with leading zero).
m 2-digit minute (without leading zero).
mm 2-digit minute (with leading zero).
s 2-digit second (without leading zero).
ss 2-digit second (with leading zero).
AM Flag to activate 12-hour time scheme. By default, the 24-hour time scheme is enabled.

Some sample combinations:

DD. MMM YYYY, hh:mm.ss AM  -> 01. Jan. 2525, 01:30.59 PM
DDD, MM. D. YYYY           -> Wed., 01. 1. 2010
YY-MM-DD                   -> 25-01-01

Usage note: Additional text is taken over unmodified (e.g. "Today, DD. MM YYYY").

Show report form at
the end of reports
If enabled, a new "request report" form appears at the end of each generated report (disable this parameter to save paper when printing reports).

Auto-mailing options:
 

MagicStatistics asks...
Description...
Reports auto-mailing settings
Click on "edit e-mail message" to alter the default message content.
Send daily reports
Send weekly reports
Send bi-weekly reports
Send monthly reports
Mark the appropriate checkboxes to select the time periods of mailed reports. Reports are sent after completed log parsing.

Technical note: In order to disable mailing of reports, simply uncheck all options.

Usage note 1: Reports are mailed during the log parsing process; e.g. weekly parsing will lead into receiving daily reports delayed (but for each day, as intended).

Usage note 2: Bi-weekly reports are calculated for 1st and 15th of each month.

Default # of top values in report Number of entries shown for each report; recommended range: 10 to 50 entries.
Include these reports in mailing Select the desired reports you wish to include in mailings.
Compress report Marked to enable compressing of reports; recommended when sending all report types by e-mail and/or showing a high number of entries per report.

Important note: This feature requires correctly configured compression parameters (see "System parameters"); otherwise reports will be sent uncompressed.

Raw log files mailing In order to keep a backup copy of raw log files, you can decide to mail the raw logs each time parsing is done.

Enable sending of raw log files by e-mail to specified recipient(s) each time log parsing is performed. Submitted log data is compressed first automatically.

Click on "edit" to alter the default message content.

Important note: It's strongly advised to correctly configure compression parameters (see "System parameters"), otherwise raw log files will be sent uncompressed.

Automatic data cleanup
Whenever running data cleanup, all parsed log data becomes removed till the specified time period. The server's raw log file(s) however are not touched (they can be cleared by "Erase parsed log entries..." option or when performing logfile maintenance).
Time period (days) before
statistics files are deleted
Number of days to keep parsed log data; recommended range: 90 to 1095 days.

Usage note: Leaving the field empty or using the value "0" disables this feature.

Important notes: Removed data is unavailable for reports and cannot be recovered.

Erase parsed log entries
from server log
Determine whether or not to erase parsed log entries from the server's raw log file(s) as soon as the entries have been processed and converted into log data.

Keep this option enabled to prevent uncontrolled growing of the raw log file(s), unless there is a reason to hold parsed entries (e.g. logs are also required by other software).

You can also decide to keep the empty log files alive or to delete them completely (last option may cause problems on some servers).

Search engine settings:

MagicStatistics is able to detect visitors coming from search engines and other web directories to your site. Within the report "Search engines tracking" (report type "Visitor information"), search engines and even the used keywords are listed.

In order to do so, MagicStatistics needs information about the referring URLs and keyword variables (URL is used to determine the search engine, the keyword variable is used to extract the search string). This is done at "Search engine settings".

Helpful hint: Modifications made here take effect also to already processed log data - so you can analyze search engine usage based upon your new settings even for previously parsed log file information.

How to add a new search engine:

Type in the name of the search engine in the appropriate field and click on the "Create new" button. Now the screen "Search engine settings" appears:
 

MagicStatistics asks...
Description...
Search engine name Label of the search engine or database provider as it should appear in the reports.
Search engine domain name Domain name (also partial) to recognize the search engine / database provider.
Keywords variable Name of the variable holding keywords or categories used for search operations. You may contact the search engine or database provider to get this information.

Important note: Keyword detection works only when the concerned database application uses the GET submission method for handling search queries.

Integration of EasyData powered applications:

Please refer to the search engine "MaxJump" for details regarding implementation of EasyData powered search engines.

Smart tip: Have a look at SunnyScript's EasyData - reliable database system for versatile applications.

How to delete an existing search engine:

Select the engine you wish to remove from the list and click on the "Delete" button. However please note, that once an engine is removed, their settings cannot be recovered.

How to edit a search engine:

Select the engine you wish to modify and click on the "Edit" button. Now the screen "Search engine settings" appears (see details in the sub-part "How to add a new search engine" above).
 

Show statistics...

Choose "Show statistics" from the main admin menu or click on "Statistics" found in the upper left corner of the screen to access the statistics report request form.
 
MagicStatistics asks...
Description...
Report types Select the reports you wish to show. Use CTRL key (or appropriate) in order to mark multiple entries within the list.

Usage note: Click on a main report type in order to select all connected sub-reports (this feature requires JavaScript to be enabled).

Time period The following selections are available:
 
Selection...
Description...
Show entire log data Display data for the entire time period available.
Show latest complete day Display data of the last completely parsed day.
Date range Type in a start and end date of the time period you wish to receive reports from.
Month Display data for the selected month (the available selections bases upon parsed logs).
Year Display data for the selected year (the available selections bases upon parsed logs).
 
Advanced settings
Display ... top values /
Display all reports
Number of entries shown per report. Alternatively you may select "Display all records" in order to get a listing of all available entries for each report.

Usage note: Choosing a high number of top values may lead into reception of very large reports. If you decide so, it is recommended to select only a few reports at once.

Popular pre-set report collections Beside of selecting the desired reports from the report types list, you can simply mark one or more pre-defined report collections here.

Usage note: It is also possible to select additional reports by pressing the CTRL (or appropriate) key while doing so.

After you have set all preferences, click on the button "Show report now...".

Smart tip 1: The generated reports can be printed easily: Depending upon the used paper size, you may need to set the printer's page orientation to landscape format. In this case, there is also space for placing hand-written notes at the margins.

Smart tip 2: Since MagicStatistics doesn't use image files to create bar graphs, you can simply copy the report to a disk and carry it to other computers, still keeping the layout (reports are generated in HTML language).

Export reports to 3rd-party applications:

When showing a report, click on "Download" available in the upper right corner of the screen. A "save file" dialog appears to save the report to your local computer in an easy-to-export format understandable by most spreadsheet and database apps.

Such an exported report can be used in software of your choice to develop complex statistic analyses or write presentations on the base of generated reports.

Technical note: At the target application, try to choose "HTML format" or "text format" import type to achieve best results.
 

Log file maintenance...

In order to do so, please select the appropriate link from the main menu. Alternatively you can click on "Logfile maintenance" in the upper right corner of the screen.
 
MagicStatistics asks...
Description...
Log file statistics "Parsed logs size" reflects the size of the log data already analyzed by MagicStatistics (on which reports basing on).

"Server logs size" reflects the size of the raw log file(s) on the system (data may be already parsed, but not cleared from these files).

Clear log file partially Date till you wish to clear all log information. You can decide either to clear the server's raw log file and/or the statistics file the report data bases on.

Usage note: Once the logs are cleared, they cannot be recovered and all statistical information they contained is lost.

Clear entire log file Click on this button in order to clear all logs (report data and server's raw logs).

Usage note: Once the logs are cleared, they cannot be recovered and all statistical information they contained is lost.

Upload log file Select a log file available on your local computer for being uploaded and processed.

Update available statistics with this log file:

Mark this button to add the processed data to the reports already stored on the system.

Use "Overwrite same-dated statistical data files" to replace conflicting dates with the processed data of the uploaded log file (freshen existing data).

Process this logfile separately from available statistics:

Mark this button to show the processed data on its own separate report.

As soon as a log file has been uploaded in this way, you can use links in the near of this option to view the reports and to delete the parsed log again.

Technical note: Uploading a new file with this option removes an existing one.

Expert note: If your server software uses own log files for different dates (split logs), concerned dates' log files are removed instead of being cleared to keep the log directory free from empty files.

How to keep the report data, but clear server logs ?

If you wish to keep the report data and just want to clear the server's raw log files automatically after they got processed, please refer to "Edit software settings" as described above and enable "Erase parsed log entries from server log".
 

Parsing and analyzing of log file(s)...

What is parsing of log file(s) ?

MagicStatistics analyzes the raw logs, performs complex operations on its data and saves the results in an internal database system - the "parsed" log file(s); this procedure allows fast access when requesting a report.

Which kinds of log files are detected ?

Please refer to the chapter "General information about the software" for more details.

How is log parsing done ?

Either select "Parse log file(s)" from the admin menu or configure your server to run MagicStatistics automatically for log parsing (explained in the following). If you use the admin panel to parse logs, you can watch MagicStatistics while being "in action".

Please note that parsing of log files takes some time and CPU resources. For this reason, it is recommended to parse logs at a time of low general system usage (e.g. at midnight or early morning).

Technical note: MagicStatistics uses NPH method (non-parsed headers) to prevent timeouts caused by the server or web browsing software (even if your browser crashes for any reason, the process is kept in the background and should be finished).

What happens with parsed raw log data ?

Depending upon your settings, parsed raw log data is either cleared or kept until you do log file maintenance.

When are report mails sent ?

Each time you parse log files, MagicStatistics will also process the selected e-mail reports.

Usage note: You don't need to parse log files daily, just because you have set receiving report mails daily. Each time you parse log files, MagicStatistics sends all pending mail reports automatically.

Technical note: If there were no accesses, reports are skipped for the concerned period (when running a low traffic website, it is recommended to generate report mails on a weekly, bi-weekly and/or monthly basis).

Some technical notes:

Parsed log files can be found within the "parsed_logs" directory at the location of MagicStatistics:
 

Filename (named by dates)...
Description...
YYYY-MM-DD.stat "Report data" log files in the special internal data format of MagicStatistics. Based upon these logs, all reports are generated.
 

 
Scheduled parsing of logs

Although raw log parsing can be done very comfortable via the admin panel, it may not be the desired way in some situations:

Imagine that you just wish to receive reports by e-mail without caring about parsing logs and other technical stuff - or you simply don't have the time to parse logs regularly (and if you have, you may forget it ;-)

The following chapter will describe how to use Cron (Unix platforms) to schedule log parsing and report mailing.

Important note: The scheduling tool of your server (depending upon the used operating system) can be different. In this case, please contact your webhoster's support department for more details.
 

Task scheduling (using Cron)...

General information:

The file to schedule is nph-cron.cgi of MagicStatistics (this works also with other scheduling tools).

Each time this program is executed, it will parse all raw log files according the settings made in the admin panel and also takes care about sending report mails (if enabled).

Usage note: For detailed information about Cron and how to manage scheduling on your server, please refer to available literature or contact your webhoster's support department.

Direct editing of Cron file:

Some possible Cron entries may look like the following:
 

Sample setting...
Cron entry...
Run MagicStatistics daily at midnight * 0 0 * * * <perl> /<path>/nph-cron.cgi
Run MagicStatistics Mondays at 15:00 0 15 * * 1 <perl> /<path>/nph-cron.cgi
* recommended scheduling

Technical note: <perl> must be replaced with your Perl interpreter; <path> means the path to the MagicStatistics installation (location of nph-cron.cgi). Multiple entries are possible (e.g. to parse logs at different times).

Command line Cron scheduler:

If you're new at Cron scheduling, you can use our command line scheduler to add a new entry to your Cron file. The scheduler will be called from the command line...
 

Action to perform...
URL to call (location varies on your system, of course)...
Call Cron scheduler <perl> cron_edt.pl

Technical note: <perl> must be replaced with your Perl interpreter; ensure that you're in the MagicStatistics directory.

Now follow the provided instructions. After configuration, the matching entry will be added to your Cron file automatically.
 

Trouble-shooting...

Please follow these instructions only when experiencing problems with log file parsing:

Very few servers may experience problems when having "Erase parsed entries from server log" feature enabled. The reason is, that the server may keep the log files always open and so may show unusual behavior, like stopping to log accesses.

If you experience problems, please add a command to restart the web server software into your Cron and configure it to be ran each time after the logs were parsed. Alternatively you may just disable "Erase parsed entries from server log" and clear the logs from time to time by using the log file maintenance (see admin panel) or a special command of your web server software.

Should just restarting the web server software not show the desired result, then you may need to contact your webhoster and ask them about a shell script inserted into your Cron file: Copy locked log file to an unlocked one, delete locked log file, instruct the server to re-load configuration and re-open log file, let MagicStatistics process the (copied) unlocked log file.
 


 
Customer services

Depending upon your license type, this software package includes various support services. Please refer to the license document or visit our website for more information about available services.

Before you contact our customer service department, please read this manual first. In most cases you find the answer here. However if you still experience problems, we will be more than happy to help you...

For all support inquiries, please contact support@sunnyscript.com and provide the following information:

* The license number of the concerned product.
* A close description of the problem or question you have (no file attachments, please).
* For technical inquiries: Used server environment, URL of admin panel & admin password.
 

Now we wish you a great time with our software products :-)

 
© SunnyScript - A subsidiary of Star Enterprise. Visit the SunnyScript website.
Please read our terms of business located at... http://www.sunnyscript.com/terms.htm