Installing CGI/PERL Scripts
June 10th, 2007This section is more of an expansion on the initial discussion of CGI/PERL scripts from the “Creating Forms” section. It is intended to make you become acquainted with installation procedures relating to your Web directory.
If you would like to use CGI/PERL scripts and plan on installing yourself on your directory, be sure to follow the script’s instructions, if available. Helpful instruction sets are included with most freeware CGI and PERL scripts available on the World Wide Web. When you upload your scripts, be sure to have you FTP client set in ASCII mode (click the “A” button or “ASCII” radio tab in FTP Explorer) since the file is composed of straight ASCII based text. And definitely make sure you’re uploading the scripts in the correct folder, usually titled “cgi-bin” on most servers. The “cgi-bin” directory is usually assigned special administrative permissions so that only you can access its contents over the Net. Speaking of permissions, you’ll want to set your CGI/PERL scripts to various administrative, group, and user access rights. Using Telnet (a UNIX-based environment based entirely on text), you can set permissions to either chmod 755 or 777, depending on the script’s behavior. The “chmod” command is followed by obviously the number (i.e. 755) and the location of the file you wish to apply specific permissions to. The command chmod 755 allows virtually all permissions to be implemented except “Write” permissions for the group and user while chmod 777 sets permissions for everything (Read, Write, and Execute) for all groups.
In any case, be sure to look at the files that came with your CGI/PERL script for the proper installation of the program. Many CGI/PERL packages come with a “readme” file that contains valuable information regarding the file setup. You might also want to refer to the lines following continuous number symbols (#) since these lines are not part of the CGI/PERL script’s performance and are generally intended for identification and installation guidance purposes. Number symbols are also used to “rem” (or remove) lines to make them dormant or unable to initialize from within the script without actually deleting the entire line in case its wanted in the future. (Just be careful not to “rem” too many lines because it adds to the script’s file size, which increases it’s download time.) In addition, its also important to point out that if you wish to use any special characters (i.e. “$” or “@”) you must place a backslash “\” in front of them so the script does not recognize the character as a variable (which can send an error message on-screen).
Side Note: Although Telnet may be accessed within the Microsoft Windows interface by going to “Start”, “Run…” and typing in “telnet” followed by a space and the location, most FTP clients support chmod permission settings directly within the program. You might find taking advantage of setting permissions within FTP helpful, especially since logging onto Telnet can be rather slow at times.
Also, if you don’t have a “cgi-bin” you can create one by making a new directory and using the “chmod” command to set permissions to chmod 777. Normally, you’ll want to set permissions to chmod to other directories you create from within this “cgi-bin” directory, especially for scripts that save user-inputted data (i.e. scripts that create customized Web pages).


























