Murty's X Watcher

(Right Click, Save Target as. to save file)


This program processes web server / proxy server access logs and generates a report on a web page providing details of hits to X Rated web sites. This can be used either on a web server or on a proxy server to investigate X Rated web site hits. Several companies treat use of company property for X Rated usage as abuse and even prohibit such usage.

This is standalone program that can run without any web server. It can run on any UNIX/Linux platform provided you have Perl installed, and gzip is available. Most UNIX/Linux machines have Perl and gzip utilities. Also, access log files must be in gzip format.

For a live DEMO, click here.


First, identify the directory where you want to install this program. Choose the same directory that contains your gzipped webserver or proxy Access Log files. For example, if you choose DIR directory, you should download the program into DIR and your access log files access1.gz, access2.gz. The directory DIR can also contain sub directories containing your gzipped access log files.

Now, make sure you have Perl installed on your system. Also make sure gzip is installed and is working properly.

Now, edit the downloaded program using vi or emacs as follows:

  1. Edit the first line #!/usr/local/bin/perl to point to the correct location of Perl on your machine. If perl is installed as /usr/bin/perl, for example, edit the line to read as #!/usr/bin/perl -w
  2. Check your current Age in years and make sure that it is over 18 or whatever your local legal age limit is. If you are not over, abort installation and delete all downloaded programs. Consult your parent(s) or legal guardian for more information.
  3. Edit @logfiles array entries if necessary. i.e., to match your access logs and access log directory names.
  4. Edit $cache if necessary. i.e., to point to the directory where you want the cache files to be created by the program. Default value recommended. So, leave this alone.
  5. Edit $gzip such that it points to the absolute name of gzip utility on your computer. For example, if gzip is installed as /opt/bin/gzip, then $gzip should be '/opt/bin/gzip'
  6. Choose a port number. Default is 7777. Note that you should run this program as root, if you choose 80 or any other number below 1024 as port number.
  7. (This step not applicable to version 1.0 of X Watcher)
    If you do not want this program to listen on all interfaces (IP Addresses) available on your computer, then uncomment $ipaddr line and define $ipaddr to the IP Address which you want this program to bind to. If you chose $ipaddr to an IP Address, make sure that IP Address is assigned to your computer and is available. Also, no other process should be running on $ipaddr:$port or, if $ipaddr line left commented out, $port of all of your IP Addresses. (If you want to run Apache and X Watcher both on port 80 but on different IP Addresses, see: Co-existance with Apache web server below)
  8. Make sure all your access log files are in the same directory as the directory into which you downloaded X Watcher program, or in sub directories which are directly under the directory into which you downloaded X Watcher.
  9. Become root if you chose 80 or any number below 1024 as $port in Step 6 above. Type: chmod +x xwatcher
  10. Type: nohup ./xwatcher &
    Now, open your browser and type: http://$ipaddr:$port where $ipaddr is the IP Address and $port is the port you have chosen.

Co-existance with Apache web server :

This is not applicable to version 1.0 of X Watcher. i.e., version 1.0 of X Watcher cannot co-exist with Apache web server running on the same port as $port you have chosen in xwatcher program.

If your computer has more than one IP Address active and if you are running a web server like Apache on the same port as $port of this program, then by default your Apache or other web server binds to all available IP Addresses. Therefore, X Watcher cannot bind to the IP Address you have chosen. To fix this, first adjust your Apache or other web server to not use the specific IP Address you want to run X Watcher on. This can be explained better with an example:

Assume your computer has two interfaces or virtual interfaces with IP Addresses: and And lets say you are running Apache Web Server. By default, Apache runs on all the IP Addresses: and So you cannot choose Port 80 in X Watcher and you also cannot choose either of the IP Addresses for X Watcher. To fix this, you have to free up one IP Address from Apache, unless you want to use a different port like 7777 for X Watcher on all the IP Addresses (port 7777 is not used by Apache by default). But lets say, you want to use Port 80 for X Watcher. Then you have to free up one IP Address first. To do that, comment out BindAddress line in Apache config file (httpd.conf) and modify Listen 80 line in httpd.conf to read as follows:


Then restart your apache web server. Now, your Apache web server runs on Port 80 on first IP: only. This frees up the IP Address will all of its ports. You can then choose $ipaddr to be and any value (including 80) for $port in X Watcher program


Free for non-commercial use. For commercial use, please contact me first and I may grant you permission to use for free.


Murty's X Watcher program works with X rated web site keywords. Therefore, you should not download, read, modify or use it in any way unless you are over 18 years or your local legal age limit. No warranty. Use at your own risk.
Send Questions / Comments to:

© Murty Rompalli
All rights reserved