UNIX/LINUX

WINDOWS

 


 


Installation Guide for UNIX/LINUX Platform

 

1. STANDARDS

1.      The Webalizer Home Directory should be:

/html/webalizer

2.      The Web Hit Report Home Directory should be:

/html/webalizer/name_of_website

            or

            /location_of_document_root/report

3.      The Web Hit Report URL is:

 http://www.name_of_website.com/report

 

2. GUIDELINES

The Webalizer installation procedures:

 

  1. Create The Webalizer Home Directory and Extract The Webalizer program files downloaded from http://www.webalizer.com/ to The Webalizer Home Directory.

#cd /

#mkdir html

#cd /html

#mkdir webalizer

 

  1. Create the Web Hit Report Home Directory for the Web Site and copy the file msfree.gif,

            webalizer.gif from The Webalizer Home Directory to the Web Hit Report Home Directory.

#cd /html/webalizer                             or         #cd /location_of_document_root

#mkdir name_of_website                   or         #mkdir report

#cd name_of_website                         or         #cd report

#cp /html/webalizer/msfree.gif  .

#cp /html/webalizer/webalizer.gif  .

 

NOTE: name_of_website (example: www.yahoo.com --- yahoo is the name_of_website).

              location_of_document_root (example: /opt/apache-1.3.12/htdocs).

 

  1. Copy the webalizer file from The Webalizer Home Directory to /usr/bin and /usr/local/bin directory.

#cd /html/webalizer

#cp webalizer /usr/bin

#cp webalizer /usr/local/bin

 

  1. Edit the configuration file webalizer.conf from The Webalizer Home Directory.

#cd /html/webalizer

#vi webalizer.conf

 

 

 

 

Entries you need to change in the configuration file:

OutputDir       Type the Web Hit Report Home Directory.                                          

/html/webalizer/name_of_website

            or

            /location_of_document_root/report

HostName      Type the Web Site’s URL.

www.name_of_website.com

LogFile           Type the Web Server’s log file path appended by the log filename.

/web_server_logfile_location/access_logfile_name

 

NOTE: For Multiple Web Sites it should be save as webalizer1.conf and repeat procedure

 4 for each Web Site, change the OutputDir, HostName, and LogFile value for

 each Web Site and save it as webalizer$.conf (where: $ represents the number – 1,

 2, 3 ……).

 

5.   Create a Virtual Directory or Additional Document Directory for the Web Hit Report URL 

      page.

5.1 For Netscape Enterprise Server or iPlanet Web Server.

5.1.1    Access the Administration Server page.

Using UNIX/LINUX Shell:

#cd /web_server_admin_directory

#./start-admin or         #./start

* At user prompt: Type the Administrator Name and Password.

* Click “Ok”.

 

Using a Web Browser:

* At the web browser’s “URL Address” box, type the Administration URL.

               i.e. - http://www.name_of_website.com:admin_port_number

            * At user prompt: Type the Administrator Name and Password.

            * Click “Ok”.

 

5.1.2        Access the Web Site Directory from the Administration Server page.

*  Click “Servers” from the top menu.

* At the “Select a Server”, select the Web Site Name.

* Click “Manage“.

 

                        5.1.3    Create Additional Document Directory.

* Click “Content Management” from the top menu bar.

* Click “Additional Document Directory” from the side menu bar.

* At the “URL prefix” box, type report.

* At the “Map to directory” box, type the Web Hit Report Home Directory.

* Click “Ok”.

* Click “Save and Apply”.

* Click “Ok”.

 

NOTE: If you are using the /location_of_document_root/report as the Web

 Hit Report Home Directory, no need to do procedure 5.1.3.

 

 

 

 

 

5.1.4    Add Document Preferences.

* By default the Netscape Enterprise Server and iPlanet Web Server

   automatically displays the default index file as index.html.

* Exit the Administration Server page.

 

5.1.5        Establish Security (Not Recommended).

 

NOTE: This could be done only if the Web Server is connected to LDAP

 Server.

 

* Access the Administration Server page (see procedure 5.1.1).

* Access the Web Site Directory from the Administration Server page (see 

   procedure 5.1.2).

                                    * Click “Preferences” from the top menu bar.

                                    * Click “Restrict Access” from the side menu bar.

                                    * At the “A. Pick a resource” select “Browse”.

                                    * Click  “Options”.

                                    * At the “List from” type:

   /html/webalizer/name_of_website

                        or

   /location_of_document_root/report

                                    * Click “Ok”.

                                    * At the “Current directory” ------ select “(choose entire directory)”.

                                    * At the “A. Pick a resource” select “Edit Access Control”.

                                    * Check the “Access control is on” check box.

                                    * At the first line, select “Deny”.

                                    * At the “Allow/Deny” menu, select “Allow”.

                        * Click “Update”.

                                    * At the first line, select “anyone”.

                                    * At the “Users/Groups” menu, select “Only the following people”.

                                    * At the “Group” box, type the group name the user belongs to.

                                    * At the “User” box, type the username.

                                    * At the “Prompt for authentication” box, type “Access Denied”.

                                    * At the “Authentication methods”, select “Basic”.

                                    * At the “Authentication database”, select “Default”.

                                    * Click “Update”.

                                    * At the first line, select “all”.

                                    * At the “Access rights” menu, select “Only the following rights”.

                                    * Clear the “Write” and “Delete” check boxes.

* Check the “Read”, “Execute”, “List”, and “Info” check boxes.

                                    * Click “Submit”.

                                    * Click “Save and Apply”.

                                    * Click “Ok”.

                                    * Exit the Administration Server page.

                                   

NOTE: For Multiple Web Sites, repeat procedure 5.1.2/5.1.3/5.1.4/5.1.5 for

  each Web Site.

 

 

 

 

 

 

5.2  For Apache HTTP Server.

5.2.1        Establish Security (Not Recommended – remove the AuthUserFile line).

* At the UNIX/LINUX Shell, type the following command.

#cd /

#htpasswd –c /html/webalizer/name_of_website/.htaccess username

            or

#htpasswd -c /location_of_document_root/report/.htaccess username

 

* At the password prompt: type a password.

* At the password reentry prompt: type the password again.

 

5.2.2        Edit httpd.conf or access.conf from the /apache_http_server_directory/conf

directory.

* If you are using /html/webalizer/name_of_website as the Web Hit Report 

   Home Directory.

#cd /apache_http_server_directory/conf

#vi httpd.conf              or         #vi access.conf

 

Entries to be added:

Alias /report/ “/html/webalizer/name_of_website/

<Directory “/html/webalizer/name_of_website”>

  AllowOverride None

  Options FollowSymLinks

  AuthName “Webalizer Report”

  AuthType Basic

  AuthUserFile /html/webalizer/name_of_website/.htaccess

  require valid-user

</Directory>

                                   

* If you are using /location_of_document_root/report as the

   Web Hit Report Home Directory, no need to create an Alias.

#cd /apache_http_server_directory/conf

#vi httpd.conf              or         #vi access.conf

 

Entries to be added:

<Directory “/location_of_document_root/report”>

   AllowOverride None

   Options FollowSymLinks

   AuthName “Webalizer Report”

   AuthType Basic

   AuthUserFile /location_of_document_root/report/.htaccess

   require valid-user

</Directory>

 

   NOTE: For Multiple Web Sites, repeat procedure 5.2.1/5.2.2 for each Web

     Site.

 

 

 

 

 

 

5.2.3        Load the new configuration (Restart the Apache HTTP Server).

* To restart the Apache HTTP Server in UNIX.

#kill –HUP `cat /web_server_http_daemon_location/httpd.pid`

 

* To restart the Apache HTTP Server in LINUX.

#kill –SIGHUP `cat /web_server_http_daemon_location/httpd.pid`

 

  NOTE: The above are default path for httpd.pid file created by Apache

   HTTP Server during installation.

 

  1. Create a script file for the system to run The Webalizer automatically.

6.1  For UNIX/LINUX running Netscape Enterprise Server, iPlanet Web Server, or Apache HTTP Server.

6.1.1    Create a new crontab file or edit an existing crontab file for a user.

            Type the following command below at the UNIX/LINUX Shell to create or

edit a crontab file for the current user logon.

#crontab –e username

 

Entries to be added to the crontab file.

* * * * * /html/webalizer/webalizer –c /html/webalizer/webalizer.conf

 

                        6.1.2    STAR representation.

                                    First STAR from left represents the Minute (0-59).

                                    Second STAR from left represents the Hour (0-23).

                                    Third STAR from left represents the Day of Month (1-31).

                                    Fourth STAR from left represents the Month (1-12).

                                    Fifth STAR from left represents the Day of Week (0-6) 0 represents Sunday.

                                    A STAR in place of any of the date/time fields means ALL.

 

                                    NOTE: For Multiple Web Sites, add another line and replace webalizer.conf

 with webalizer$.conf (where $ represents the number 1, 2, 3 ……).

 

                        6.1.3    Examples.

                                    To run a task every ten minutes every hour everyday.

                                    0,10,20,30,40,50 * * * *

                                    To run a task every hour everyday.

                                    0 * * * *

To run a task every twelve midnight everyday.

0 0 * * *

To run a task every two hours everyday.

                                    0 0,2,4,6,8,10,12,14,16,18,20,22 * * *

                                    To run a task every twelve midnight every first day of the month.

                                    0 0 1 * *

                                    To run a task every twelve midnight of the seventh day of February.

                                    0 0 7 2 *

                                    To run a task every twelve midnight Monday to Friday.

                                    0 0 * * 1-5

 

 

 

 

 

6.2  If you are running a script to automate Web Log Rotation and saves the old log file to other filename and directory.

                        * Change the value of LogFile in webalizer.conf in procedure 4 to point to the path

                           and filename of the old log file.

* Determine the time when the automatic Web Log Rotation runs,

   change the configuration in procedure 6.1.1 to run the automatic execution of 

   webalizer five minutes after the automatic Web Log Rotation.

 

6.3  If you are using Load Balancing for your Web Server (two or more server for one Web Server).

 

Example: In this configuration, the customer is using two servers to host its Web

                 Server.

 

                        * At the first server (FIRST_SERVER_NAME), create a work directory for the

   logfile synchronization.

#cd /html

#mkdir logfile

#mkdir oldlog

 

                        * Create a file name rotate1a at the /html/webalizer directory.

#cd /html/webalizer

#vi rotate1a

 

Enter the following line;

# !/bin/sh

 

# move files to archive directory

# mv /web_server_logfile_location/error_logfile_name /html/logfile

mv /web_server_logfile_location/access_logfile_name /html/logfile

 

# restart web server (APACHE-UNIX)

kill –HUP `cat /web_server_http_daemon_location/httpd.pid`

 

# restart web server (APACHE-LINUX)

kill –SIGHUP `cat /web_server_http_daemon_location/httpd.pid`

 

                          NOTE: No need to restart the Netscape Enterprise Server and iPlanet Web Server.

 

* Create a file name rotate1b at the /html/webalizer directory.

#cd /html/webalizer

#vi rotate1b

 

Enter the following line;

# !/bin/sh

 

# define backup names

# OLD_ERROR=/html/oldlog/error.`date +%y%m%d-%H%M%S`

OLD_ACCESS=/html/oldlog/access.`date +%y%m%d-%H%M%S`

 

 

 

# move files to backup directory

# mv /html/logfile/error_logfile_name `echo $OLD_ERROR`

mv /html/logfile/access_logfile_name `echo $OLD_ACCESS`

 

# compress the backup files

# /bin/gzip $OLD_ACCESS

# /bin/gzip $OLD_ERROR

 

*  Create a file name rotate1c at the /html/webalizer directory.

#cd /html/webalizer

#vi rotate1c

 

Enter the following line;

# !/bin/sh

 

# run the webalizer

webalizer -c /html/webalizer/webalizer.conf

 

# remove files from archive directory

# rm /html/logfile/error_logfile_name

rm /html/logfile/access_logfile_name

 

* Create a file name .netrc at the user home directory.

# cd /user_home_directory

#vi .netrc

 

Enter the following line;

machine SECOND_SERVER_NAME

login username

password password

 

macdef init

cd /html/logfile

lcd /html/logfile

append access_logfile_name  access_logfile_name

bye

<blank>

 

   NOTE: The <blank> means enter a blank line.

 

                        * Protect your .netrc file.

#chmod go-r .netrc

 

* Create a cron job.

#crontab –e username

 

Enter the following line;

0 0 * * * /html/webalizer/rotate1a

10 0 * * * ftp SECOND_SERVER_NAME

15 0 * * * /html/webalizer/rotate1b

25 0 * * * /html/webalizer/rotate1c

 

* At the second server (SECOND_SERVER_NAME), create a work directory for

   the logfile synchronization.

#cd /html

#mkdir logfile

#mkdir oldlog

 

                        * Create a file name rotate2a at the /html/webalizer directory.

#cd /html/webalizer

#vi rotate2a

 

Enter the following line;

# !/bin/sh

 

# move files to archive directory

# mv /web_server_logfile_location/error_logfile_name /html/logfile

mv /web_server_logfile_location/access_logfile_name /html/logfile

 

# restart web server (APACHE-UNIX)

kill –HUP `cat /web_server_http_daemon_location/httpd.pid`

 

# restart web server (APACHE-LINUX)

kill –SIGHUP `cat /web_server_http_daemon_location/httpd.pid`

 

                           NOTE: No need to restart the Netscape Enteprise Server and iPlanet Web Server.

 

* Create a file name rotate2b at the /html/webalizer directory.

#cd /html/webalizer

#vi rotate2b

 

Enter the following line;

# !/bin/sh

 

# define backup names

# OLD_ERROR=/html/oldlog/error.`date +%y%m%d-%H%M%S`

OLD_ACCESS=/html/oldlog/access.`date +%y%m%d-%H%M%S`

 

# copy files to backup directory

# cp /html/logfile/error_logfile_name `echo $OLD_ERROR`

cp /html/logfile/access_logfile_name `echo $OLD_ACCESS`

 

# compress the backup files

# /bin/gzip $OLD_ACCESS

# /bin/gzip $OLD_ERROR

 

* Create a file name rotate2c at the /html/webalizer directory.

#cd /html/webalizer

#vi rotate2c

 

 

 

 

 

Enter the following line;

# !/bin/sh

 

# run the webalizer

webalizer -c /html/webalizer/webalizer.conf

 

# remove files from archive directory

# rm /html/logfile/error_logfile_name

rm /html/logfile/access_logfile_name

 

* Create a file name .netrc at the user home directory.

#cd /user_home_directory

#vi .netrc

 

Enter the following line;

machine FIRST_SERVER_NAME

login username

password password

 

macdef init

cd /html/logfile

lcd /html/logfile

put access_logfile_name

bye

<blank>

 

   NOTE: The <blank> means enter a blank line.

 

* Protect your .netrc file.

#chmod go-r .netrc

 

* Create a cron job.

#crontab –e username

 

 Enter the following line;

0 0 * * * /html/webalizer/rotate2a

5  0 * * * /html/webalizer/rotate2b

20 0 * * * ftp FIRST_SERVER_NAME

25 0 * * * /html/webalizer/rotate2c

 

                        * Log File Synchronization Process.

 

 

6.4  Network Time Protocol Daemon (NTPD) configuration.  

 

NOTE: Installing NTPD is important in synchronizing files for multiple servers.

 

            Example 1: For Local Network Time Synchronizations of NTP Servers and Clients without

                                connection to the Internet using higher stratum numbers for servers as reference

                                time.

 

* Create a work directory for NTP installation.

#cd /

#mkdir ntpfiles

 

* Download the NTP package from the Internet for the appropriate machines.

                           SUN Solaris - http://www.sunfreeware.com/

   Red Hat Linux - http://www.redhat.com/

 

   NOTE: You can download all UNIX/LINUX platform from

     http://www.eecis.udel.edu/~ntp

 

* Extract the file that you downloaded.

a. If you download a ZIP file (i.e ntp-4.0.72j-machine-platform.gz)

#cd /ntpfiles

#gunzip ntp-4.0.72j-machine-platform.gz

 

 

 

 

b. If you download a TAR file (i.e ntp4.0.72j-machine-platform.tar)

#cd /ntpfiles

#tar –xvf ntp-4.0.72j-machine-platform.tar

 

* Add the package.

#cd /ntpfiles

#pkgadd –d ntp-4.0.72j-machine-platform

                                                                                                                                                  

* Edit the ntp.conf file(for version 4 it is usually located at /usr/local/doc/ntp/scripts/support/conf).

a. For Server.

#cd /ntp_configuration_file_location

#vi ntp.conf

 

Add the following lines:

server 127.127.1.0                             # Local  clock

fudge 127.127.1.0 stratum 13            # Not disciplined

 

b. For Client.

#cd /ntp_configuration_file_location

#vi ntp.conf

 

Add the following lines:

server server_ip_address

driftfile /ntp_configuration_file_location/ntp.drift

 

* On both Server and Client, run the NTP Daemon (for version 4 it is usually

   located at /usr/local/bin), run it on NTP Server first

#cd /ntp_daemon_location

#./ntpd –c /ntp_configuration_file_location/ntp.conf

 

* To check the time synchronization of the NTP Server and clients, run the NTP

   Querry program.

#ntpq –p

 

On NTP Server you should see the following line similar to this.

remote                   refid                       st             t               when       poll         reach      delay       offset      disp

===============================================================================

*LOCAL (0)         LOCAL (0)           13           1              47           64           377         0.00        0.000      0.94

 

On NTP Clients you should see the following line similar to this.

remote                                   refid                       st             t               when       poll         reach      delay       offset      disp

=======================================================================================

*REMOTE_NAME            LOCAL (0)           14           u              601         1024       377         0.42        0.119      14.86

 

 

 

 

 

 

 

 

 

* On both Server and Client, create a script file so that the system will run the NTP  

   Daemon when it restarts. Make sure the file starts in capital ‘S’.

#cd /etc/rc2.d

#vi S168ntp

 

Add the following lines:

/ntp_daemon_location/ntpd –c /ntp_configuration_file_location/ntp.conf

 

Example 2: For Local Network Time Synchronizations of NTP Servers and Clients

        with connection to the Internet using Stratum 1 and 2 NTP Servers as

         reference time.

 

* Create a work directory for NTP installation.

#cd /

#mkdir ntpfiles

 

* Download the NTP package from the Internet for the appropriate machines.

                           SUN Solaris - http://www.sunfreeware.com/

   Red Hat Linux - http://www.redhat.com/

  

   NOTE: You can download all UNIX/LINUX platform from

     http://www.eecis.udel.edu/~ntp

 

* Extract the file that you downloaded.

a. If you download a ZIP file (i.e ntp-4.0.72j-machine-platform.gz)

#cd /ntpfiles

#gunzip ntp-4.0.72j-machine-platform.gz

 

b. If you download a TAR file (i.e ntp4.0.72j-machine-platform.tar)

#cd /ntpfiles

#tar –xvf ntp-4.0.72j-machine-platform.tar

 

* Add the package.

#cd /ntpfiles

#pkgadd –d ntp-4.0.72j-machine-platform

                                                                                                                                                  

* Edit the ntp.conf file(for version 4 it is usually located at /usr/local/doc/ntp/scripts/support/conf).

a. For Server.

#cd /ntp_configuration_file_location

#vi ntp.conf

 

Add the following lines:

server 127.127.1.0                             # Local clock

fudge 127.127.1.0 stratum 13            # Not disciplined

   

driftfile /ntp_configuration_file_location/ntp.drift

 

server ntp_server1                             # Stratum 1 Internet NTP Server

server ntp_server2                             # Stratum 2 Internet NTP Server

 

 

    NOTE: To see the list of Stratum 1 and 2 Internet NTP Server:

      http://www.ece.udel.edu/~mills/ntp/clock1.htm

      http://www.ece.udel.edu/~mills/ntp/clock2.htm

 

b. For Client.

#cd /ntp_configuration_file_location

#vi ntp.conf

 

Add the following lines:

server server_ip_address

driftfile /ntp_configuration_file_location/ntp.drift

 

* On both Server and Client, run the NTP Daemon (for version 4 it is usually

   located at /usr/local/bin), run it on NTP Server first

#cd /ntp_daemon_location

#./ntpd –c /ntp_configuration_file_location/ntp.conf

 

* To check the time synchronization of the NTP Server and clients, run the

   NTP Querry.

#ntpq –p

 

On NTP Server you should see the following line similar to this.

remote                   refid                       st             t               when       poll         reach      delay       offset      disp

================================================================================

*LOCAL (0)         LOCAL (0)           13           1              47           64           377         0.00        0.000     0.94

*ntp_server1        .PPS.                      1              u              45           64           377         1.306      -0.019    0.043

*ntp_server2        .PPS.                      2              u              36           64           377         1.306      -0.019    0.043

 

On NTP Clients you should see the following line similar to this.

remote                                   refid                       st             t               when       poll         reach      delay       offset      disp

=======================================================================================

*REMOTE_NAME            LOCAL (0)           14           u              601         1024       377         0.42        0.119      14.86

 

* On both Server and Client, create a script file so that the system will run the

   NTP Daemon when it restarts. Make sure the file starts in capital ‘S’.

#cd /etc/rc2.d

#vi S168ntp

 

Add the following lines:

/ntp_daemon_location/ntpd –c /ntp_configuration_file_location/ntp.conf

 

  1. Testing and Commissioning.

Test the installation by running the scripts and browsing the results using a web browser.

                       

* Type the following line below at UNIX/LINUX Shell and press “Enter” key.

#cd /

#webalizer –c /html/webalizer/webalizer.conf

           

            * If you are using Load Balancing run the script in order from Log File Synchronization

   Process (see the diagram).

* At the web browser’s “URL Address” box, type the Web Hit Report URL and press

   “Enter” key.

 

3. RECORDS     

The yearly (index) report shows statistics for a 12 Month period, and links to each month. The monthly report has detailed statistics for that month with additional links to any URL's and referrers found. The various totals shown are explained below.

 

Hits

Any request made to the server which is logged, is considered a 'hit'. The requests can be for anything... html pages, graphic images, audio files, cgi scripts, etc...  Each valid line in the server log is counted as a hit.  This number represents the total number of requests that were made to the server during the specified report period.

 

Files

Some requests made to the server, require that the server then send something back to the requesting client, such as a html page or graphic image.  When this happens, it is considered a 'file' and the files total is incremented.  The relationship between 'hits' and 'files' can be thought of as 'incoming requests' and 'outgoing responses'.

 

Pages

Pages are, well, pages!  Generally, any HTML document, or anything that generates an HTML document, would be considered a page.  This does not include the other stuff that goes into a document, such as graphic images, audio clips, etc...  This number represents the number of 'pages' requested only, and does not include the other 'stuff' that is in the page.  What actually constitutes a 'page' can vary from server to server.  The default action is to treat anything with the extension '.htm', '.html' or '.cgi' as a page.  A lot of sites will probably define other extensions, such as '.phtml', '.php3' and '.pl' as pages as well.  Some people consider this number as the number of  'pure' hits... I'm not sure if I totaly agree with that viewpoint. Some other programs (and people :) refer to this as 'Pageviews'.

 

Visits

Whenever a request is made to the server from a given IP address (site), the amount of time since a previous request by the address is calculated (if any).  If the time difference is greater than a pre-configured 'visit timeout' value (or has never made a request before), it is

considered a 'new visit', and this total is incremented (both for the site, and the IP address).  The default timeout value is 30 minutes (can be changed), so if a user visits your site at 1:00

in  the afternoon, and then returns at 3:00, two visits would be registered. Note: in the 'Top Sites' table, the visits total should be discounted on 'Grouped' records, and thought of as the "Minimum number of visits" that came from that grouping instead.  Note: Visits only occur on PageType requests, that is, for any request whose URL is one of the  'page' types defined with the PageType option.  Due to the limitation of the HTTP protocol, log rotations and other factors, this number should not be taken as absolutely accurate, rather, it should be considered a pretty close "guess".

 

Sites

Each request made to the server comes from a unique 'site', which can be referenced by a name or ultimately, an IP address.  The 'sites' number shows how many unique IP addresses made requests to the server during the reporting time period.  This DOES NOT mean the

number of unique individual users (real people) that visited, which is impossible to determine using just logs and the HTTP protocol (however, this number might be about as close as you will get).

 

 

 

KBytes

The KBytes (kilobytes) value shows the amount of data, in KB, which was sent out by the server during the specified reporting period.  This value is generated directly from the log file, so it is up to the web server to produce accurate numbers in the logs  (some web servers do stupid things when it comes to reporting the number of bytes).  In general, this should be a fairly accurate representation of the amount of outgoing traffic the server had, regardless of the web servers reporting quirks. (Note: A kilobyte is 1024 bytes, not 1000 bytes)

 

Top Entry and Exit Pages

The Top Entry and Exit Pages give rough estimates of what URL’s are used to enter your site, and what the last pages viewed are. Because of limitations in the HTTP protocol, log rotations, etc... This number should be considered a good "rough guess" of the actual

numbers, however will give a good indication of the overall trend in where users come into, and exit, your site.

 

The files produced,(default names) are:

index.html                                             - Main summary page (extension may be changed).

usage.png                                             - Yearly graph displayed on the main index page.

usage_YYYYMM.html                        - Monthly summary page (extension may be changed).

usage_YYYYMM.png             - Monthly usage graph for specified month/year.

daily_usage_YYYYMM.png                - Daily usage graph for specified month/year.

hourly_usage_YYYYMM.png  - Hourly usage graph for specified month/year.

site_YYYYMM.html                            - All sites listing (if enabled).

url_YYYYMM.html                             - All url’s listing (if enabled).

ref_YYYYMM.html                             - All referrers listing (if enabled).

agent_YYYYMM.html             - All user agents listing (if enabled).

search_YYYYMM.html                       - All search strings listing (if enabled).

webalizer.hist                                        - Previous month history (may be changed).

webalizer.current                                  - Incremental Data (may be changed).

site_YYYYMM.tab                             - tab delimited sites file.

url_YYYYMM.tab                               - tab delimited urls file.

ref_YYYYMM.tab                              - tab delimited referrers file.

agent_YYYYMM.tab                          - tab delimited user agents file.

user_YYYYMM.tab                            - tab delimited usernames file.

search_YYYYMM.tab             - tab delimited search string file.

 

4. REFERENCES

     http://www.webalizer.com

 


 

 

 

 


Installation Guide for Windows Platform

 

1.     STANDARDS

  1. The Webalizer Home Directory should be:

drive:\>html\webalizer

  1. The Web Hit Report Home Directory should be:

drive:\>html\webalizer\name_of_website

  1. The Web Hit Report URL is:

http://www.name_of_website.com/report

 

2.     GUIDELINES

The Webalizer installation procedures:

 

NOTE: I use MS-DOS commands in this example, you can use Microsoft Windows Explorer

 and Microsoft Wordpad.

 

  1. Create The Webalizer Home Directory and Extract or UnZIP The Webalizer program files

downloaded from http://www.webalizer.com/ to The Webalizer Home Directory.

drive:\>md \html\webalizer

 

  1. Create the Web Hit Report Home Directory for the Web Site and copy the file msfree.gif,

webalizer.gif from The Webalizer Home Directory to the Web Hit Report Home Directory.

drive:\>cd \html\webalizer

drive:\>html\webalizer\md name_of_website

drive:\>html\webalizer\cd name_of_website

drive:\>html\webalizer\name_of_website\copy drive:\html\webalizer\msfree.gif

drive:\>html\webalizer\name_of_website\copy drive:\html\webalizer\webalizer.gif

 

NOTE: name_of_website (example: www.yahoo.com --- yahoo is the name_of_website)

 

  1. Edit the configuration file webalizer.conf from The Webalizer Home Directory.

drive:\>cd \html\webalizer

drive:\>html\webalizer\edit webalizer.conf

 

Entries you need to change in the configuration file:

OutputDir       Type the Web Hit Report Home Directory.                                          

            drive:\html\webalizer\name_of_website

HostName      Type the Web Site’s URL.

www.name_of_website.com

 

            NOTE: For Multiple Web Sites it should be save as webalizer1.conf and repeat procedure

                         3 for each Web Site, change the OutputDir, and HostName value for each Web

 Site and save it as webalizer$.conf (where: $ represents the number – 1, 2, 3 ……).

 

 

 

  1. Create a Virtual Directory or Additional Document Directory for the Web Hit Report URL page.

4.1 For Microsoft Windows running Microsoft IIS.

4.1.1    Access the Internet Service Manager.

a. From Microsoft Windows NT:

   Select - Start + Programs + Windows NT 4.0 Option Pack + Microsoft 

   Internet Information Server + Internet Service Manager.

b. From Microsoft Windows 2000:

   Select - Start + Programs + Administrative Tools + Internet Service 

   Manager.

 

4.1.2        Access the Web Site Directory from the MMC (Microsoft Management Console).

* Expand the Console Root directory by double-clicking it.

* Expand the Internet Information Server directory by double-clicking it.

* Expand the Host Server Name or Host Server IP Address  (the one with

   a computer icon) by double-clicking it.

 

NOTE: Those with the globe and hand icon are the Web Sites Directories.

 

4.1.3        Create Virtual Directory.

* Right-click the Web Site Directory.

* Select - New + Virtual Directory.

* At the “Alias to be used to access virtual directory” box, type report

* Select  “Next” button.

* At the “Enter the physical path of the directory containing the content you

   want to publish”  box, type the Web Hit Report Home Directory

* Select “Next” button.

* Select  “Finish” button.

 

4.1.4        Add Default Document Name

* Right-click the report Virtual Directory.

* Select - Properties + Documents + Add.

* At the “Default Document Name” box, type index.html.

* Select “Ok” button.

* Select “Ok” button.

* Exit the Internet Service Manager.

 

                        4.1.5    Establish Security (Not Recommended).

* Access the Internet Service Manager (see procedure 4.1.1).

* Access the Web Site Directory (see procedure 4.1.2).

* Expand the Web Site Directory by double-clicking it.

* Right-click the report Virtual Directory.

* Select - Properties + Directory Security.

* At the “Anonymous Access and Authentication Control” select “Edit”   

   button.

* Clear the “Allow Anonymous Access” check box.

* Clear “Basic Authentication (Password is sent in Clear Text)” check box.

* Check the “Windows NT Challenge/Response” check box.

* Select “Ok” button.

* Select “Ok” button.

 

NOTE: For Multiple Web Sites, repeat procedure 4.1.3/4.1.4/4.1.5 for each

 Web Site. Only users in the Microsoft Windows NT User Manager

  for Domains will be able to access the Web Hit Report page using

  their username and password.

 

5. Create a script file for the system to run The Webalizer automatically.

5.1  For Microsoft Windows running IIS.

5.1.1    Create a synchronise.bat file.

drive:\>cd \html\webalizer

drive:\>html\webalizer\edit synchronise.bat

 

Enter the following entries:

@echo off

rem The directory containing the log files

SET LOGDIR=drive:\log_file_path\

           

rem The webalizer home directory

SET WEBALIZERHOME=drive:\html\webalizer\

                                   

rem The date delimiter character, put a space after the /.

SET DATEDELIM=/

                                   

rem Terminate the program if the webalizer home directory is not found

If not exist %WEBALIZERHOME%\. goto END

                                   

rem Extract the current date and store as environment variable cdate

for /f “tokens=2-4 delims=%DATEDELIM%” %%a in (‘DATE /T’) do set cdate=%%c%%a%%b

 

* For Microsoft IIS using NCSA Common Log File Format:

rem Remove first two digits from cdate, append “nc”, add “.log”

set logfile=nc%cdate:~2%.log

echo set logfile=%logfile% > drive:\html\webalizer\name_of_website\todaylog.bat

 

rem Run the webalizer program to generate output files

@call drive:\html\webalizer\name_of_website\todaylog.bat

%WEBALIZERHOME%\webalizer –c drive:\html\webalizer\webalizer.conf %logdir%\%logfile%

 

rem Cleanup – clear the environment variables

set logdir=

set webalizerhome=

set datedelim=

set cdate=

set logfile=

 

rem End the program

:END

 

 

 

 

* For Microsoft IIS using Microsoft IIS Log File Format:

rem Converting the Microsoft IIS Log File Format to NCSA CLF

set convert=in%cdate:~2%.log

set logfileA=%convert%.ncsa

convlog –ii %logdir%\%convert% -o %logdir%

del %logdir%\%logfile%

ren %logdir%\%logfileA% %logfile%

echo set logfile=%logfile% > drive:\html\webalizer\name_of_website\todaylog.bat

 

rem Run the webalizer program to generate output files

@call drive:\html\webalizer\name_of_website\todaylog.bat

%WEBALIZERHOME%\webalizer –c drive:\html\webalizer\webalizer.conf %logdir%\%logfile%

 

rem Cleanup – clear the environment variables

set logdir=

set webalizerhome=

set datedelim=

set cdate=

set logfile=

 

rem End the program

:END

 

* For Microsoft IIS using Microsoft IIS W3C Extended Format:

rem Converting the Microsoft IIS W3C Extended Format to NCSA CLF

set convert=ex%cdate:~2%.log

set logfileA=%convert%.ncsa

convlog –ie %logdir%\%convert% -o %logdir%

del %logdir%\%logfile%

ren %logdir%\%logfileA% %logfile%

echo set logfile=%logfile% > drive:\html\webalizer\name_of_website\todaylog.bat

 

rem Run the webalizer program to generate output files

@call drive:\html\webalizer\name_of_website\todaylog.bat

%WEBALIZERHOME%\webalizer –c drive:\html\webalizer\webalizer.conf %logdir%\%logfile%

 

rem Cleanup – clear the environment variables

set logdir=

set webalizerhome=

set datedelim=

set cdate=

set logfile=

 

rem End the program

:END

 

 

 

 

 

5.1.2    Automate the execution of synchronise.bat using the Scheduled Tasks program.

                                    a. From Microsoft Windows NT:

   Double-click My Computer icon from your desktop and double-click

   Scheduled Tasks icon.

 

b. From Microsoft Windows 2000:

   Select - Start + Programs + Administrative Tools + Scheduled Tasks

 

c. Both Microsoft Windows NT/2000:

* Double-click “Add Scheduled Task” icon from the “Scheduled Task 

   Wizard”.

* Select “Next” button.

* At the “Click the program you want Windows to run” select “Browse”

   button.

* Select “drive:\>html\webalizer\synchronise.bat”.

* At the “Type the name for the task”, type “synchronise”.

* Select “Daily”.

* Select “Next” button.

* At the “Start time”, select “12:00 AM”.

* At the “Perform this task”, select “Every Day”.

* Enter the username.

* Enter the user password.

* Confirm the user password.

* Select “Next” button.

* Check the “Open advanced properties for this task when I click finish”  

   check box.

* Select “Finish” button.

* Select “Settings” button.

* Clear the “Stop the task if it runs for” check box.

* Select “Apply” button.

* Select “Schedule” button.

* Select “Advanced” button.

* Check the “Repeat Task” check box.

* At the “Every”, enter the repetition in time (minutes or hours)

   synchronise.bat will run.

* Check the “Duration” radio box.

* At the “Duration”, enter 24 hours.

* Select “Ok” button.

* Select “Ok” button.

 

                        5.1.3    Automate the execution of synchronise.bat using the AT command.

drive:\>edit autoexec.bat

 

Entries to be added:

AT 00:00 /every:M,T,W,Th,F,S,Su drive:\html\webalizer\synchronise.bat

           

5.2  If you are running a script to automate Web Log Rotation and saves the old log file to other

                        filename and directory.

* Change the configuration of the synchronise.bat script file in procedure 5.1.1 to

   point to the path and filename of the old log file.

 

* Determine the time when the Web Log Rotation runs, change the configuration in

   procedure 5.1.2/5.1.3 to run the automatic execution of synchronise.bat five

   minutes after the automatic Web Log Rotation.

 

NOTE: You can play around with the DOS Scripting in procedure 5.1.1. The

              position of variables a, b, and c can be changed depends on the format of

              your systems date.

 

5.3  If you are using Load Balancing for your Web Servers (two or more server for one or more Web Site).

 

Example: In this configuration, you are using two servers to host your Web Site.

                You are also using the Web Server configured with multiple Web Sites.

                                        The logfile format for this example is Microsoft IIS W3C Extended

    Format.

 

NOTE: I use MS-DOS commands in this example, you can use Microsoft Windows

 Explorer and Microsoft Wordpad.

 

* At the first server (FIRST_SERVER_NAME), create a work directory for the

    logfile synchronization.

drive:\>md html

drive:\>cd \html

drive:\>html\md webalizer

drive:\>html\cd webalizer

drive:\>html\webalizer\md total

drive:\>html\webalizer\md name_of_first_website

drive:\>html\webalizer\md name_of_second_website

drive:\>html\webalizer\cd ..

drive:\>html\md newdir

drive:\>html\cd newdir

drive:\>html\newdir\md new_directory_of_first_website         (example: w3svc3 – default)

drive:\>html\newdir\md new_directory_of_second_website     (example: w3svc4 – default)

drive:\>html\newdir\cd ..

drive:\>html\md totallog

drive:\>html\cd totallog

drive:\>html\totallog\md total

drive:\>html\totallog\md name_of_first_website

drive:\>html\totallog\md name_of_second_website

drive:\>html\totallog\cd ..

drive:\>html\cd webalizer

 

NOTE: Download The Webalizer program from http://www.webalizer.com and run

 WinZIP or any application that will Extract or UnZIP The Webalizer program files

  to drive:\>html\webalizer directory. The drive:\>html\webalizer\total are for the

  total load the two Web Servers receive (if you are running multiple Web Sites in

  your Web Servers).

 

 

 

 

 

* Copy the file msfree.gif, webalizer.gif from The Webalizer Home Directory to the

   Web Hit Report Home Directories.

drive:\>cd html\webalizer\total

drive:\>html\webalizer\total\copy drive:\html\webalizer\msfree.gif

drive:\>html\webalizer\total\copy drive:\html\webalizer\webalizer.gif

drive:\>html\webalizer\total\cd \

drive:\>cd html\webalizer\name_of_first_website

drive:\>html\webalizer\name_of_first_website\copy drive:\html\webalizer\msfree.gif

drive:\>html\webalizer\name_of_first_website\copy drive:\html\webalizer\webalizer.gif

drive:\>html\webalizer\name_of_first_website\cd \

drive:\>cd html\webalizer\name_of_second_website

drive:\>html\webalizer\name_of_second_website\copy drive:\html\webalizer\msfree.gif

drive:\>html\webalizer\name_of_second_website\copy drive:\html\webalizer\webalizer.gif

drive:\>html\webalizer\name_of_second_website\cd \

 

* Edit the configuration file webalizer.conf from The Webalizer Home Directory.

drive:\>cd \html\webalizer

drive:\>html\webalizer\edit webalizer.conf

 

Entries you need to change in the configuration file:

OutputDir       Type the Web Hit Report Home Directory.                                          

            drive:\html\webalizer\total

HostName      Type the Web Site’s URL.

Total Web Hit Report

 

NOTE: Save a copy of webalizer.conf to webalizer1.conf and webalizer2.conf

 

drive:\>html\webalizer\edit webalizer1.conf

 

Entries you need to change in the configuration file:

OutputDir       Type the Web Hit Report Home Directory.                                          

            drive:\html\webalizer\name_of_first_website

HostName      Type the Web Site’s URL.

www.name_of_first_website.com

 

drive:\>html\webalizer\edit webalizer2.conf

 

Entries you need to change in the configuration file:

OutputDir       Type the Web Hit Report Home Directory.                                          

            drive:\html\webalizer\name_of_second_website

HostName      Type the Web Site’s URL.

www.name_of_second_website.com

 

* Follow Procedure Number Four (4) to create a Virtual Directory or Additional

   Document Directory for the Web Hit Report URL page.

 

NOTE: Remember to create a Virtual Directory named totalreport to one of the

 two Web Sites. At the  “Enter the physical path of the directory containing

 the content you want to publish” box, type

             drive:\>html\webalizer\total.

 

 

* Share the drive:\>html\newdir directory (Administrators and System should have

   full access, remove Everyone access).

* Map the shared directory from the second server to drive w.

* Create a script file to run The Webalizer program automatically.

drive:\>cd \html\webalizer

drive:\>html\webalizer\edit sync1a.bat

 

Enter the following entries:

@echo off

rem The directory containing the log files

SET OLDDIR1=drive:\log_file_path\

SET OLDDIR2=drive:\log_file_path\

 

rem The directory containing the copy of  log files from “OLDDIR$”

SET NEWDIR1=drive:\html\newdir\new_directory_of_first_website\

SET NEWDIR2=drive:\html\newdir\new_directory_of_second_website\

                                   

rem The date delimiter character, put a space after the /.

SET DATEDELIM=/

                                   

rem Extract the current date and store as environment variable cdate

for /f “tokens=2-4 delims=%DATEDELIM%” %%a in (‘DATE /T’) do set cdate=%%c%%a%%b

 

rem Remove first two digits from cdate, append “ex” to cdate, add “.log” to cdate

set oldlog=ex%cdate:~2%.log

echo set oldlog=%oldlog% > drive:\html\totallog\todaylog.bat

 

@call drive:\html\totallog\todaylog.bat

copy %olddir1%\%oldlog% %newdir1%\%oldlog%

@call drive:\html\totallog\todaylog.bat

copy %olddir2%\%oldlog% %newdir2%\%oldlog%

 

rem Cleanup – clear the environment variables

set olddir1=

set olddir2=

set newdir1=

set newdir2=

set oldlog=

set datedelim=

set cdate=

 

rem End the program

:END

 

 

 

 

 

 

 

 

drive:\>html\webalizer\edit sync1b.bat

 

Enter the following entries:

@echo off

rem The directory containing the log files

SET OLDDIR1=drive:\html\newdir\new_directory_of_first_website\

SET OLDDIR2=drive:\html\newdir\new_directory_of_second_website\

 

rem The directory containing the log files from the Second Server

SET SDIR1=w:\new_directory_of_first_website\

SET SDIR2=w:\new_directory_of_second_website\

 

rem The directory containing the total log files

SET TOTAL=drive:\html\totallog\total\

SET TOTAL1=drive\html\totallog\name_of_first_website\

SET TOTAL2=drive:\html\totallog\name_of_second_website\

 

rem The date delimiter character, put a space after the /.

SET DATEDELIM=/

 

rem Extract the current date and store as environment variable cdate

for /f “tokens=2-4 delims=%DATEDELIM%” %%a in (‘DATE /T’) do set cdate=%%c%%a%%b

 

rem Remove first two digits from cdate, append “ex” to cdate, add “.log” to cdate

set oldlog=ex%cdate:~2%.log

echo set oldlog=%oldlog% > drive:\html\totallog\todaylog.bat

 

@call drive:\html\totallog\todaylog.bat

copy %olddir1%\%oldlog%+%sdir1%\%oldlog% %total1%\%oldlog%

@call drive:\html\totallog\todaylog.bat

copy %olddir2%\%oldlog%+%sdir2%\%oldlog% %total2%\%oldlog%

@call drive:\html\totallog\todaylog.bat

copy %total1%\%oldlog%+%total2%\%oldlog% %total%\%oldlog%

 

rem Cleanup – clear the environment variables

set olddir1=

set olddir2=

set sdir1=

set sdir2=

set total=

set total1=

set total2=

set oldlog=

set datedelim=

set cdate=

 

rem End the program

:END

 

 

 

drive:\>html\webalizer\edit sync1c.bat

 

Enter the following entries:

@echo off

rem The directory containing the log files

SET LOGDIR=drive:\html\totallog\total\

SET LOGDIR1=drive:\html\totallog\name_of_first_website\

SET LOGDIR2=drive:\html\totallog\name_of_second_website\

 

rem The webalizer home directory

SET WEBALIZERHOME=drive:\html\webalizer\

 

rem The date delimiter character, put a space after the /.

SET DATEDELIM=/

 

rem Extract the current date and store as environment variable cdate

for /f “tokens=2-4 delims=%DATEDELIM%” %%a in (‘DATE /T’) do set cdate=%%c%%a%%b

 

rem Remove first two digits from cdate, append “nc” to cdate, add “.log” to cdate

set logfile=nc%cdate:~2%.log

 

rem Converting the Microsoft IIS W3C Extended Format to NCSA CLF

set convert=ex%cdate:~2%.log

set logfileA=%convert%.ncsa

 

convlog –ie %logdir%\%convert% -o %logdir%

del %logdir%\%logfile%

ren %logdir%\%logfileA% %logfile%

echo set logfile=%logfile% > drive:\html\webalizer\total\today.bat

 

convlog –ie %logdir1%\%convert% -o %logdir1%

del %logdir1%\%logfile%

ren %logdir1%\%logfileA% %logfile%

echo set logfile=%logfile% > drive:\html\webalizer\name_of_first_website\today1.bat

 

convlog –ie %logdir2%\%convert% -o %logdir2%

del %logdir2%\%logfile%

ren %logdir2%\%logfileA% %logfile%

echo set logfile=%logfile% > drive:\html\webalizer\name_of_second_website\today2.bat

 

@call drive:\html\webalizer\total\today.bat

%WEBALIZERHOME%\webalizer -c drive:\html\webalizer\webalizer.conf %logdir%\%logfile%

@call drive:\html\webalizer\name_of_first_website\today1.bat

%WEBALIZERHOME%\webalizer -c drive:\html\webalizer\webalizer1.conf %logdir1%\%logfile%

@call drive:\html\webalizer\name_of_second_website\today2.bat

%WEBALIZERHOME%\webalizer -c drive:\html\webalizer\webalizer2.conf %logdir2%\%logfile%

 

 

rem Cleanup – clear the environment variables

set logdir=

set logdir1=

set logdir2=

set webalizerhome=

set datedelim=

set cdate=

set logfile=

set convert=

set logfileA=

 

rem End the program

:END

 

* At the second server (SECOND_SERVER_NAME), create a work directory for

   the logfile synchronization.

drive:\>md html

drive:\>cd \html

drive:\>html\md webalizer

drive:\>html\cd webalizer

drive:\>html\webalizer\md total

drive:\>html\webalizer\md name_of_first_website

drive:\>html\webalizer\md name_of_second_website

drive:\>html\webalizer\cd ..

drive:\>html\md newdir

drive:\>html\cd newdir

drive:\>html\newdir\md new_directory_of_first_website         (example: w3svc3 – default)

drive:\>html\newdir\md new_directory_of_second_website     (example: w3svc4 – default)

drive:\>html\newdir\cd ..

drive:\>html\md totallog

drive:\>html\cd totallog

drive:\>html\totallog\md total

drive:\>html\totallog\md name_of_first_website

drive:\>html\totallog\md name_of_second_website

drive:\>html\totallog\cd ..

drive:\>html\cd webalizer

 

NOTE: Download The Webalizer program from http://www.webalizer.com and run

 WinZIP or any application that will Extract or UnZIP The Webalizer program files

  to drive:\>html\webalizer directory. The drive:\>html\webalizer\total are for the

  total load the two Web Servers receive (if you are running multiple Web Sites in

  your Web Servers).

 

 

 

 

 

 

 

 

 

 

* Copy the file msfree.gif, webalizer.gif from The Webalizer Home Directory to the

   Web Hit Report Home Directories.

drive:\>cd html\webalizer\total

drive:\>html\webalizer\total\copy drive:\html\webalizer\msfree.gif

drive:\>html\webalizer\total\copy drive:\html\webalizer\webalizer.gif

drive:\>html\webalizer\total\cd \

drive:\>cd html\webalizer\name_of_first_website

drive:\>html\webalizer\name_of_first_website\copy drive:\html\webalizer\msfree.gif

drive:\>html\webalizer\name_of_first_website\copy drive:\html\webalizer\webalizer.gif

drive:\>html\webalizer\name_of_first_website\cd \

drive:\>cd html\webalizer\name_of_second_website

drive:\>html\webalizer\name_of_second_website\copy drive:\html\webalizer\msfree.gif

drive:\>html\webalizer\name_of_second_website\copy drive:\html\webalizer\webalizer.gif

drive:\>html\webalizer\name_of_second_website\cd \

 

* Edit the configuration file webalizer.conf from The Webalizer Home Directory.

drive:\>cd \html\webalizer

drive:\>html\webalizer\edit webalizer.conf

 

Entries you need to change in the configuration file:

OutputDir       Type the Web Hit Report Home Directory.                                          

            drive:\html\webalizer\total

HostName      Type the Web Site’s URL.

Total Web Hit Report

 

NOTE: Save a copy of webalizer.conf to webalizer1.conf and webalizer2.conf

 

drive:\>html\webalizer\edit webalizer1.conf

 

Entries you need to change in the configuration file:

OutputDir       Type the Web Hit Report Home Directory.                                          

            drive:\html\webalizer\name_of_first_website

HostName      Type the Web Site’s URL.

www.name_of_first_website.com

 

drive:\>html\webalizer\edit webalizer2.conf

 

Entries you need to change in the configuration file:

OutputDir       Type the Web Hit Report Home Directory.                                          

            drive:\html\webalizer\name_of_second_website

HostName      Type the Web Site’s URL.

www.name_of_second_website.com

 

* Follow Procedure Number Four (4) to create a Virtual Directory or Additional

   Document Directory for the Web Hit Report URL page.

 

NOTE: Remember to create a Virtual Directory named totalreport to one of the

  two Web Sites. At the  “Enter the physical path of the directory containing

  the content you want to publish” box, type

             drive:\>html\webalizer\total.

 

 

* Share the drive:\>html\newdir directory (Administrators and System should have

   full access, remove Everyone access).

* Map the shared directory from the first server to drive w.

* Create a script file to run The Webalizer program automatically.

drive:\>cd \html\webalizer

drive:\>html\webalizer\edit sync2a.bat

 

Enter the following entries:

@echo off

rem The directory containing the log files

SET OLDDIR1=drive:\log_file_path\

SET OLDDIR2=drive:\log_file_path\

 

rem The directory containing the copy of  log files from “OLDDIR$”

SET NEWDIR1=drive:\html\newdir\new_directory_of_first_website\

SET NEWDIR2=drive:\html\newdir\new_directory_of_second_website\

                                   

rem The date delimiter character, put a space after the /.

SET DATEDELIM=/

                                   

rem Extract the current date and store as environment variable cdate

for /f “tokens=2-4 delims=%DATEDELIM%” %%a in (‘DATE /T’) do set cdate=%%c%%a%%b

 

rem Remove first two digits from cdate, append “ex” to cdate, add “.log” to cdate

set oldlog=ex%cdate:~2%.log

echo set oldlog=%oldlog% > drive:\html\totallog\todaylog.bat

 

@call drive:\html\totallog\todaylog.bat

copy %olddir1%\%oldlog% %newdir1%\%oldlog%

@call drive:\html\totallog\todaylog.bat

copy %olddir2%\%oldlog% %newdir2%\%oldlog%

 

rem Cleanup – clear the environment variables

set olddir1=

set olddir2=

set newdir1=

set newdir2=

set oldlog=

set datedelim=

set cdate=

 

rem End the program

:END

 

 

 

 

 

 

 

 

drive:\>html\webalizer\edit sync2b.bat

 

Enter the following entries:

@echo off

rem The directory containing the log files

SET OLDDIR1=drive:\html\newdir\new_directory_of_first_website\

SET OLDDIR2=drive:\html\newdir\new_directory_of_second_website\

 

rem The directory containing the log files from the Second Server

SET FDIR1=w:\new_directory_of_first_website\

SET FDIR2=w:\new_directory_of_second_website\

 

rem The directory containing the total log files

SET TOTAL=drive:\html\totallog\total\

SET TOTAL1=drive\html\totallog\name_of_first_website\

SET TOTAL2=drive:\html\totallog\name_of_second_website\

 

rem The date delimiter character, put a space after the /.

SET DATEDELIM=/

 

rem Extract the current date and store as environment variable cdate

for /f “tokens=2-4 delims=%DATEDELIM%” %%a in (‘DATE /T’) do set cdate=%%c%%a%%b

 

rem Remove first two digits from cdate, append “ex” to cdate, add “.log” to cdate

set oldlog=ex%cdate:~2%.log

echo set oldlog=%oldlog% > drive:\html\totallog\todaylog.bat

 

@call drive:\html\totallog\todaylog.bat

copy %olddir1%\%oldlog%+%fdir1%\%oldlog% %total1%\%oldlog%

@call drive:\html\totallog\todaylog.bat

copy %olddir2%\%oldlog%+%fdir2%\%oldlog% %total2%\%oldlog%

@call drive:\html\totallog\todaylog.bat

copy %total1%\%oldlog%+%total2%\%oldlog% %total%\%oldlog%

 

rem Cleanup – clear the environment variables

set olddir1=

set olddir2=

set sdir1=

set sdir2=

set total=

set total1=

set total2=

set oldlog=

set datedelim=

set cdate=

 

rem End the program

:END

 

 

 

drive:\>html\webalizer\edit sync2c.bat

 

Enter the following entries:

@echo off

rem The directory containing the log files

SET LOGDIR=drive:\html\totallog\total\

SET LOGDIR1=drive:\html\totallog\name_of_first_website\

SET LOGDIR2=drive:\html\totallog\name_of_second_website\

 

rem The webalizer home directory

SET WEBALIZERHOME=drive:\html\webalizer\

 

rem The date delimiter character, put a space after the /.

SET DATEDELIM=/

 

rem Extract the current date and store as environment variable cdate

for /f “tokens=2-4 delims=%DATEDELIM%” %%a in (‘DATE /T’) do set cdate=%%c%%a%%b

 

rem Remove first two digits from cdate, append “nc” to cdate, add “.log” to cdate

set logfile=nc%cdate:~2%.log

 

rem Converting the Microsoft IIS W3C Extended Format to NCSA CLF

set convert=ex%cdate:~2%.log

set logfileA=%convert%.ncsa

 

convlog –ie %logdir%\%convert% -o %logdir%

del %logdir%\%logfile%

ren %logdir%\%logfileA% %logfile%

echo set logfile=%logfile% > drive:\html\webalizer\total\today.bat

 

convlog –ie %logdir1%\%convert% -o %logdir1%

del %logdir1%\%logfile%

ren %logdir1%\%logfileA% %logfile%

echo set logfile=%logfile% > drive:\html\webalizer\name_of_first_website\today1.bat

 

convlog –ie %logdir2%\%convert% -o %logdir2%

del %logdir2%\%logfile%

ren %logdir2%\%logfileA% %logfile%

echo set logfile=%logfile% > drive:\html\webalizer\name_of_second_website\today2.bat

 

@call drive:\html\webalizer\total\today.bat

%WEBALIZERHOME%\webalizer -c drive:\html\webalizer\webalizer.conf %logdir%\%logfile%

@call drive:\html\webalizer\name_of_first_website\today1.bat

%WEBALIZERHOME%\webalizer -c drive:\html\webalizer\webalizer1.conf %logdir1%\%logfile%

@call drive:\html\webalizer\name_of_second_website\today2.bat

%WEBALIZERHOME%\webalizer -c drive:\html\webalizer\webalizer2.conf %logdir2%\%logfile%

 

 

rem Cleanup – clear the environment variables

set logdir=

set logdir1=

set logdir2=

set webalizerhome=

set datedelim=

set cdate=

set logfile=

set convert=

set logfileA=

 

rem End the program

:END

 

* Automate the execution of sync1a, sync1b, sync1c, sync2a, sync2b, and sync2c

   either using the AT command or Task Scheduler. Please follow Procedure Number

   5.1.2 and 5.1.3.

 

NOTE: If IIS configured to generate a log once a day, run the script once a day also

  (5 minutes before the new rotation). If IIS is configured to generate a log

  every hour, run the scripts every hour also (5 minutes before the new

  rotation).

 

Example: IIS generates a log once a day.

sync1a.bat                  11:45 PM                    sync2a.bat

sync1b.bat                  11:50 PM                    sync2b.bat

sync1c.bat                   11:55 PM                    sync2c.bat

 

5.4  Network Time Protocol (NTP) configuration.  

 

NOTE: Installing NTP is important in synchronizing files for multiple servers.

 

Example 1: For Local Network Time Synchronizations of NTP Servers and Clients

                    without connection to the Internet using higher stratum numbers for

                    servers as reference time.

 

NOTE: I use MS-DOS commands in this example, you can use Microsoft Windows

 Explorer and Microsoft Notepad.

 

* Create a work directory for NTP installation.

drive:\>mkdir ntpfiles

  

* Download the NTP package from the Internet, to drive:\>ntpfiles directory.

   Choose a site below.

   http://www.trimble.com/oem/ntp

   http://www.meinberg.de/english

 

   NOTE: You can download it from any NTP Website that you know.

 

 

 

 

* Install the  file that you downloaded.

a. If you download it from http://www.trimble.com/oem/ntp.

drive:\>ntpfiles\ntp.exe

   Double-click the ntp.exe file from Windows Explorer and follow the

   procedure from the Installation Wizard.

 

b. If you download it from http://www.meinberg.de/english extract the ZIP

    files to drive:\>ntpfiles directory.

drive:\>ntpfiles\setup.exe

    Double-click the setup.exe file from Windows Explorer and follow the

    procedure from the Installation Wizard.

 

* Edit the ntp.conf file (it is usually located at drive:\>%systemroot%\system32\drivers\etc).

a. For Server.

drive:\>cd ntp_configuration_file_location

drive:\>ntp_configuration_file_location\edit ntp.conf

 

Add the following lines:

server 127.127.1.0                             # Local  clock

fudge 127.127.1.0 stratum 13            # Not disciplined

 

b. For Client.

drive:\>cd ntp_configuration_file_location

drive:\>ntp_configuration_file_location\edit ntp.conf

 

Add the following lines:

server server_ip_address

driftfile drive:\ntp_configuration_file_location\ntp.drift

 

* On both Server and Client, stop and start the Network Time Protocol service

   from the Services Manager (stop and start it on NTP Server first).

            a. From Microsoft Windows NT.

                Click Start + Settings + Control Panel

                Double-click the Services icon.

 

            b. From Microsoft Windows 2000

                Click Start + Programs + Administrative Tools + Services

 

* To check the time synchronization of the NTP Server and clients, run the NTP

   Querry program (it is usually located at drive:\>Program Files\Network Time

   Protocol).

drive:\>cd ntpq_program_file_location

drive:\>ntpq_program_file_location\ntpq -p

 

On NTP Server you should see the following line similar to this:

remote                   refid                       st             t               when       poll         reach      delay       offset      jitter

===============================================================================

*LOCAL (0)         LOCAL (0)           13           1              47           64           377         0.00        0.000      0.94

 

 

 

 

On NTP Clients you should see the following line similar to this:

remote                                   refid                       st             t               when       poll         reach      delay       offset      jitter

=======================================================================================

*REMOTE_NAME            LOCAL (0)           14           u              601         1024       377         0.42        0.119      14.86

 

Example 2: For Local Network Time Synchronizations of NTP Servers and Clients

        with connection to the Internet using Stratum 1 and 2 NTP Servers as

        reference time.

 

NOTE: I use MS-DOS commands in this example, you can use Microsoft Windows

             Explorer and Microsoft Notepad.

 

* Create a work directory for NTP installation.

drive:\>mkdir ntpfiles

 

* Download the NTP package from the Internet, to drive:\>ntpfiles directory.

   Choose a site below.

   http://www.trimble.com/oem/ntp

   http://www.meinberg.de/english

 

   NOTE: You can download it from any NTP Website that you know.

 

* Install the  file that you downloaded.

a. If you download it from http://www.trimble.com/oem/ntp.

drive:\>ntpfiles\ntp.exe

   Double-click the ntp.exe file from Windows Explorer and follow the

   procedure from the Installation Wizard.

 

b. If you download it from http://www.meinberg.de/english extract the ZIP 

    files to drive:\>ntpfiles directory.

drive:\>ntpfiles\setup.exe

    Double-click the setup.exe file from Windows Explorer and follow the

    procedure from the Installation Wizard.

 

* Edit the ntp.conf file (it is usually located at drive:\>%systemroot%\system32\drivers\etc).

a. For Server.

drive:\>cd ntp_configuration_file_location

drive:\>ntp_configuration_file_location\edit ntp.conf

 

Add the following lines:

server 127.127.1.0                             # Local  clock

fudge 127.127.1.0 stratum 13            # Not disciplined

 

driftfile drive:\ntp_configuration_file_locationntp.drift

 

server ntp_server1                             # Stratum 1 Internet NTP Server

server ntp_server2                             # Stratum 2 Internet NTP Server

 

 

 

 

NOTE: To see the list of Stratum 1 and 2 Internet NTP Server:

  http://www.ece.udel.edu/~mills/ntp/clock1.htm

              http://www.ece.udel.edu/~mills/ntp/clock2.htm

 

b. For Client.

drive:\>cd ntp_configuration_file_location

drive:\>ntp_configuration_file_location\edit ntp.conf

 

Add the following lines:

server server_ip_address

driftfile drive:\ntp_configuration_file_location\ntp.drift

 

* On both Server and Client, stop and start the Network Time Protocol service

   from the Services Manager (stop and start it on NTP Server first).

            a. From Microsoft Windows NT.

                Click Start + Settings + Control Panel

                Double-click the Services icon.

 

            b. From Microsoft Windows 2000

                Click Start + Programs + Administrative Tools + Services

 

* To check the time synchronization of the NTP Server and clients, run the NTP

   Querry program (it is usually located at drive:\>Program Files\Network Time

   Protocol).

drive:\>cd ntpq_program_file_location

drive:\>ntpq_program_file_location\ntpq -p

 

On NTP Server you should see the following line similar to this.

remote                   refid                       st             t               when       poll         reach      delay       offset      jitter

================================================================================

*LOCAL (0)         LOCAL (0)           13           1              47           64           377         0.00        0.000     0.94

*ntp_server1        .PPS.                      1              u              45           64           377         1.306      -0.019    0.043

*ntp_server2        .PPS.                      2              u              36           64           377         1.306      -0.019    0.043

 

On NTP Clients you should see the following line similar to this.

remote                                   refid                       st             t               when       poll         reach      delay       offset      jitter

=======================================================================================

*REMOTE_NAME           LOCAL (0)            14            u              601        1024        377         0.42        0.119     14.86

 

6. Testing and Commissioning.

Test the installation by running the scripts and browsing the results using a web browser.

 

* If you are using the AT command to automate the execution of synchronise.bat, type the

   parameters you enter in the autoexec.bat file.

drive:\>AT 00:00 /every:M,T,W,Th,F,S,Su drive:\html\webalizer\synchronise.bat

 

* If you are using the Scheduled Task program to automate the execution of

   synchronise.bat,  type the following line below at MS-DOS Shell and press “Enter” key.

drive:\>cd \html\webalizer 

drive:\>html\webalizer\synchronise.bat

 

 

 

             * If you are using Load Balancing, type sync1a.bat at the first server, then type sync2a.bat

   at the second server, then type sync1b.bat and sync1c.bat at the first server, lastly type

   sync2b.bat and sync2c.bat at the second server.

            * At the web browser’s “URL Address” box, type the Web Hit Report URL and press

   “Enter” key.

 

            * At the web browser’s “URL Address” box, type the Web Hit Report URL and press “Enter” key.

 

3.  RECORDS    

 

The yearly (index) report shows statistics for a 12 Month period, and links to each month. The monthly report has detailed statistics for that month with additional links to any URL's and referrers found. The various totals shown are explained below.

 

Hits

Any request made to the server which is logged, is considered a 'hit'. The requests can be for anything... html pages, graphic images, audio files, cgi scripts, etc...  Each valid line in the server log is counted as a hit.  This number represents the total number of requests that were made to the server during the specified report period.

 

Files

Some requests made to the server, require that the server then send something back to the requesting client, such as a html page or graphic image.  When this happens, it is considered a 'file' and the files total is incremented.  The relationship between 'hits' and 'files' can be thought of as 'incoming requests' and 'outgoing responses'.

 

Pages

Pages are, well, pages!  Generally, any HTML document, or anything that generates an HTML document, would be considered a page.  This does not include the other stuff that goes into a document, such as graphic images, audio clips, etc...  This number represents the number of 'pages' requested only, and does not include the other 'stuff' that is in the page.  What actually constitutes a 'page' can vary from server to server.  The default action is to treat anything with the extension '.htm', '.html' or '.cgi' as a page.  A lot of sites will probably define other extensions, such as '.phtml', '.php3' and '.pl' as pages as well.  Some people consider this number as the number of  'pure' hits... I'm not sure if I totaly agree with that viewpoint. Some other programs (and people :) refer to this as 'Pageviews'.

 

Visits

Whenever a request is made to the server from a given IP address (site), the amount of time since a previous request by the address is calculated (if any).  If the time difference is greater than a pre-configured 'visit timeout' value (or has never made a request before), it is

considered a 'new visit', and this total is incremented (both for the site, and the IP address).  The default timeout value is 30 minutes (can be changed), so if a user visits your site at 1:00

in  the afternoon, and then returns at 3:00, two visits would be registered. Note: in the 'Top Sites' table, the visits total should be discounted on 'Grouped' records, and thought of as the "Minimum number of visits" that came from that grouping instead.  Note: Visits only occur on PageType requests, that is, for any request whose URL is one of the  'page' types defined with the PageType option.  Due to the limitation of the HTTP protocol, log rotations and other factors, this number should not be taken as absolutely accurate, rather, it should be considered a pretty close "guess".

 

Sites

Each request made to the server comes from a unique 'site', which can be referenced by a name or ultimately, an IP address.  The 'sites' number shows how many unique IP addresses made requests to the server during the reporting time period.  This DOES NOT mean the

number of unique individual users (real people) that visited, which is impossible to determine using just logs and the HTTP protocol (however, this number might be about as close as you will get).

 

KBytes

The KBytes (kilobytes) value shows the amount of data, in KB, which was sent out by the server during the specified reporting period.  This value is generated directly from the log file, so it is up to the web server to produce accurate numbers in the logs  (some web servers do stupid things when it comes to reporting the number of bytes).  In general, this should be a fairly accurate representation of the amount of outgoing traffic the server had, regardless of the web servers reporting quirks. (Note: A kilobyte is 1024 bytes, not 1000 bytes)

 

Top Entry and Exit Pages

The Top Entry and Exit Pages give rough estimates of what URL’s are used to enter your site, and what the last pages viewed are. Because of limitations in the HTTP protocol, log rotations, etc... This number should be considered a good "rough guess" of the actual

numbers, however will give a good indication of the overall trend in where users come into, and exit, your site.

 

The files produced,(default names) are:

index.html                                             - Main summary page (extension may be changed).

usage.png                                             - Yearly graph displayed on the main index page.

usage_YYYYMM.html                        - Monthly summary page (extension may be changed).

usage_YYYYMM.png             - Monthly usage graph for specified month/year.

daily_usage_YYYYMM.png                - Daily usage graph for specified month/year.

hourly_usage_YYYYMM.png  - Hourly usage graph for specified month/year.

site_YYYYMM.html                            - All sites listing (if enabled).

url_YYYYMM.html                             - All url’s listing (if enabled).

ref_YYYYMM.html                             - All referrers listing (if enabled).

agent_YYYYMM.html             - All user agents listing (if enabled).

search_YYYYMM.html                       - All search strings listing (if enabled).

webalizer.hist                                        - Previous month history (may be changed).

webalizer.current                                  - Incremental Data (may be changed).

site_YYYYMM.tab                             - tab delimited sites file.

url_YYYYMM.tab                               - tab delimited urls file.

ref_YYYYMM.tab                              - tab delimited referrers file.

agent_YYYYMM.tab                          - tab delimited user agents file.

user_YYYYMM.tab                            - tab delimited usernames file.

search_YYYYMM.tab             - tab delimited search string file.

 

4.  REFERENCES

http://www.webalizer.com