eXtropia: the open web technology company
Technology | Support | Tutorials | Development | About Us | Users | Contact Us
Instant Web Scripts with CGI/PERL
Appendix C - About The CD-ROM  


The companion CD-ROM includes all the scripts discussed in this book ready to use for both UNIX and Windows NT Webservers. Since there are a variety of Web server environments in which the scripts can run, certain assumptions which are discussed below have been made related to how the scripts are distributed on the CD. Figure C-1 shows the basic directory structure of the applications.

Figure C-1 Basic Directory Structure of the CD-ROM

The UNIX directory contains all the scripts discussed in the book. For every chapter, there is a separate directory which contains the CGI scripts, data files, and their subdirectories. In addition, the scripts related to each chapter are also archived using the tar format.

The CGI applications which have a Windows NT equivalent are stored in their chapter subdirectories under the WINNT directory. Just like their UNIX equivalents on the CD, the full application is already laid out as separate files and subdirectories. In addition to this method of distribution, the applications are also archived in the zip format.

[NOTE] The applications discussed in this book use long filenames. You will need to unzip the files using a program that recognizes long filenames such as WinZip95. Programs for dearchiving the applications on the CD can be found at www.shareware.com.
Finally, if your machine has a CD-ROM which does not recognize long filenames, short filename versions of all the zip and tar files are located within the DOS directory. Remember though that the files within these archives still use long filenames. The short filenames are provided in the DOS directory of the CD in order to allow you to at least copy the files off of the CD-ROM if your machine does not recognize long filenames. Then, you can transfer them later to the actual machine running your Web server which may not have CD-ROM access. The machine upon which the files are untarred or unzipped should support long filenames.

UNIX Specifics

The UNIX directory on the CD-ROM contains all the applications discussed in the book. The instructions and comments listed below will help you install them.


To transfer an application to your system, you have two choices. First, the directories and files related to the application can be copied directly to the Web server directory. You can also copy the tar file to the UNIX server and then use the tar command to expand the application into its constituent directories and files. For example, if you were untarring the chat script (chat.tar), you would issue the following command:

tar xvf chat.tar
Once the scripts are copied onto your server, follow the guidelines in Chapters One and Two as well as the actual chapters related to the scripts you are installing. The guidelines contained in these chapters will help you with the rest of the process of setting up the applications such as setting permissions on the files and directories.


First, all the scripts have been written with the assumption that the Perl executable is in the "/usr/local/bin" directory. Second, scripts that do mailing use the SENDMAIL-LIB.PL library (copied over MAIL-LIB.PL) discussed in Chapter Seven. In addition, this library has been configured to look for the UNIX sendmail program in the "/usr/lib" directory by default. If your UNIX system is different, you may need to change these defaults. You should read Chapters One and Two thoroughly to get an idea of how to install and customize the scripts to your Web server environment.

Windows NT Specifics

The Windows NT version of the applications are stored under the WINNT directory on the CD-ROM. The installation process is similar to that of the UNIX versions of the scripts. You can copy the files directly off of the CD-ROM or you can use the provided zip file. In addition, each application comes with a "README.NT" file which briefly outlines what was changed in each CGI application to make them work on Windows NT Web servers.


We recommend that you install the NT scripts by copying the application files and directories directly off of the CD-ROM onto your Windows NT Web server. However, if you must use the zip files instead, there are two things you need to be aware of. First, since the applications use long filenames, you will need to unzip the files using a zip program that is aware of long filenames. In addition, the zip files do not contain the empty subdirectories that the application may need when it is running. For example, the "Sessions" directory is needed by several applications to store temporary application session files. You will need to create these directories according to the specifications outlined in the chapters that discuss the individual applications.


First, the scripts have been tested using the Netscape Commerce Server v1.13 for Windows NT v3.51 and PERL 5 For Win32 (build 107). All the scripts have been converted to run with batch file wrappers instead of directly using the ".CGI" extension script names. We chose to do this because this is the configuration that allows the majority of Windows NT Web servers to run the scripts in this book. If you are using a Windows NT Web server that has the ability to execute ".CGI" extension scripts directly, then you may want to use the UNIX versions of the scripts contained on this CD and then follow the guidelines in the README.NT file provided with each CGI application to make the Windows NT specific changes minus the alterations related to referencing batch files.

[NOTE] There are security issues involved with running batch files on your Web server. For a list of these concerns, you may want to read the WWW Security FAQ
The batch files on the CD-ROM assume that the "perl.exe" file is located in the path of the Web Server. The following is an example of a batch file that calls the chat script.
@echo off
perl chat.cgi
If your Web server is not configured such that "perl.exe" is included in the Web server path, then you will need to modify the batch file accordingly. The following is an example of the above batch file modified to have a path set to the perl executable file located in the "d:\perl5" directory.
@echo off
perl chat.cgi
As a final note, The Windows NT readme file (README.NT) for each application contains information about how we took the UNIX versions of the scripts and converted them to Windows NT. Generally, there were only three changes that had to be made to the majority of the scripts:
  • The ".CGI" references were replaced with ".BAT" and a batch file was created to call the actual ".CGI" script.
  • Applications which use the authentication library discussed in Chapter Nine, had $auth_use_cleartext set to "on" in their setup files. This turns off password encryption which is not supported in most versions of Perl for Windows NT.
  • Applications which use mail-lib.pl discussed in Chapter Seven for sending email have the SMTP version of the library replacing the UNIX sendmail version of the library.
If you find yourself in need of modifying any of the UNIX scripts to suit your particular NT server (or even another operating system's Web server), the "README.NT" file should point you in the right direction as to things to make the scripts function properly.