How to Setup CGI on CRUZIO

by Jeff Liebermann Ver 1.1.6 06/19/96

Getting the software you need.

To view the results of a CGI script, you need a web browser such as Netscape or MS Explorer. Since you are reading this with a web browser, we can safetly assume that you have one.

You will need a web account on Cruzio to have a place to put your CGI scripts. This document only covers CGI and is not intended to explain how to setup and write HTML scripts.

You will need an ftp (file transfer protocol) program to move files from your computer to the web server on cruzio. I suggest WS_FTP. Note that there are 16 bit and 32 bit versions. The command line ftp software that comes with Windows 95 and with the tcp/ip suppliments for Windows 3.1x are NOT suitable. Whatever ftp you use MUST have the chmod command.


Setting up a WS_FTP Connection

Left-click [Connect] and fill in the boxes as below. If it's blank, leave it blank.


Running a WS_FTP Session

This is the top of your ftp tree. Web browsers do NOT have access to all these directories. Your HTML files go into the directory pub_html which is actually members.cruzio.com/~jeffl to the real world.

This is what my pub_html directory looks like. I know, it's a mess. In the left window is my Windoze 95 box with my local HTML work files.

Scroll through the right window, in the pub_html directory, and check if you have a directory named [cgi-bin]. If not, you will need to create it and change its permissions.


Making a cgi-bin Directory

The httpd server will only execute files in the cgi-bin directory. The server runs as user=nobody or www and will need to have permission to execute your scripts. This is done with the chmod command. Please use lower case for everything unless you enjoy debugging exercises. Congratulations. You now have a place to hide your CGI scripts.

Sample PERL Test Script

The following is a minimal simple test script. Cut and save this script as HELLO.CGI leaveing no blank lines. At this time, Cruzio requires all scripts to end in .cgi for the NCSA httpd server to execute a script. This may change.
----------  cut here ----------------
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "Hello World!";
----------  cut here ----------------

Copying Your CGI Script

All scripts are ASCII text. Therefore, check the ASCII checkbox. The two arrows in the middle of the screen control the direction of a copy. Click the wrong direction and you over-scribble your new and improved script with the old and disgusting. Be careful. All CGI and PERL files must be made executeable with the chmod command.

Testing your CGI script

CGI scripts may be run from the web browser command line. Start your web browser and just run it. Here is a sample that displays all the server and client environment variables.

Display Environment Variables

You can also do it with a button like this:

If you copied the TEST.CGI Perl script, the easiest way to test it is to simply type in the full URL Location. It should look something like Perl Test.