Judas DocumentationLast updated: 08.05.2002 IntroductionJudas is a CGI script written in Perl which can be used to log information about visitors to your Web site. It is intended to be invoked from an <IMG> tag, and will return an image instead of an HTML document. RequirementsThe following things are required for use of Judas:
The following things are needed to make use of all of Judas's features:
If you are uncertain whether your server meets these requirements, check with your server administrator. Installation and configurationTo install Judas, follow the general instructions for installing Perl scripts. The system consists of two files: the Judas.pl file, which is a Perl script, and the Judas.cfg file, which is a text file containing configuration information for the script. You should place both files in the same location, and make sure that the Perl script has been made executable. If you are installing on a UNIX system, you should not generally need to change anything in the script file itself (except perhaps for the interpreter line at the start of the file if your Perl is installed in a non-standard place). You do, however, need to make some changes to the configuration file. The behavior of the script is governed by settings that can be acquired in one of three ways. First, some default values for the settings are encoded in the script itself. Second, certain settings may be specified when the script is called from a URL. Thirdly, settings may be specified in a configuration file which is read when the script starts up. Note that settings in the configuration file override anything passed in the URL: this is a security measure. The following settings are recognised by the program.
Settings marked with a 'yes' in the URL column of the table above may be passed in as part of the URL that invokes the script. While most settings are optional, some are dependent on others: for instance, if you include 'log' in the 'mode' setting, you must provide a valid 'logfile' argument; if you include 'mail' in the 'mode' setting, you must provide a valid 'address' argument and so forth. Most of the items above should be relatively self-explanatory, but some may need a little more explanation:
Information provided by the scriptThe Judas script works with the environment variables set by the user's browser and by the Web server. It may optionally try to look up the user's host. It will also try to process the information intelligently in order to extract particular details (such as the precise version of the browser in use, or the operating system of the user's computer). This is, however, all it can do. It can't get access to information that the user's browser doesn't give away - such as the user's mail address, or details of files stored on their computer. And it doesn't try to get access to information that's available only via JavaScript, such as the user's screen size or installed plugins. The information retrieved can be written out as tab-separated text to a log file, or as a list of values in a mail message. You can control what information should be logged using the 'mailformat' and 'logformat' settings. Each setting consists of a string of upper and lower case letters, each letter standing for some piece of information. The different information available is shown in the table below.
So, for example, setting 'logformat' to 'thb' would cause the script to log the time in ISO format, followed by the hostname, followed by the name of the user's browser. TroubleshootingIf the script gives a server error, review the installation instructions to make sure that you have followed all the steps properly. Also look at the error logs for your server: they should give you a hint as to what went wrong. See also these notes on debugging CGI scripts. If the script runs but doesn't behave properly, try switching on the 'debug' setting (explained above) to get more information. If the script doesn't seem to write anything to the log file, use the 'debug' setting to check that it can actually find the log file and write to it. You may need to create an empty log file by hand before running the script. You should also ensure that both the log file and the directory that contain it have their permissions set to allow them to be written by any user (this is a potential security hole, so make sure that the log directory is somewhere outside your HTML document tree, and that there's no possibility of someone harming you by creating or changing files in that directory). If the script doesn't send mail, check that you have correctly specified your mail address, and the path to the mailer. Both of these settings must be made in the configuration file. Note that if you have debugging switched on, calling the script from the SRC attribute of an <IMG> tag will just produce a broken image. This is because the debug mode will return a document of type 'text/plain' if anything goes wrong, but your browser is expecting a document of type 'image/*'. To debug, call the script directly: if the script works, you'll see an image. If it doesn't, you'll see an error message. The script was written to work on UNIX servers. It won't run 'out of the box' on other operating systems. If you want to run it on a different system, you will typically need to do a fair amount of work, in particular with respect to invoking programs such as 'finger' or 'sendmail'. |
![]() |