Getting the Pieces
So now that we understand what
it is that we are building, let's continue by assembling the
tools and raw material.
As I said before, we are going to demonstrate
this process on a Windows 95 machine. I chose to demonstrate
on a Windows box because I know that even if you are a UNIX
developer, you have access to a Windows machine that you can
use to develop a test site. Of course, most likely, you develop
on a Windows system. Either way, everything we go over can be
performed on any platform, just with different software packages.
I will try to point out where things might be different as we
The first thing you will need to
do is download Perl 5. You can do this easily, by going to
There are two versions of Perl available and the differences are explained at
www.perl.com. However, I use Gurusamy Sarathy's binary version of
Perl for extra module support.
If you are using UNIX, you can download the .tar.gz (Note
if you are using UNIX it is almost assuredly already installed and/or
installable by your systems administrator. You probably should not do
If you are using Windows or Macintosh, download the ZIP file.
In any case, unzip utilities for all the platforms are available at
When you have downloaded the zipped file, you should
uncompress it on your local hard drive. On Windows, I tend to extract it
into a directory like c:\Perl\Perl5.004\. But the directory you use does
not really matter much.
Note for Windows and UNIX users, you might want to
add the Perl executable to your path, but it is not necessary for this
tutorial. In case, you want to add it to your path, here is an example of
the line I use in my autoexec.bat file. In UNIX you would
typically define the PATH in .login, though it is better to
install Perl in a standard directory that is already defined in your
PATH such as "/usr/local/bin".
Okay, once Perl is installed, try
running a simple Perl program to make sure everything
is hunky dory. Here is the program I use:
print "hello world";
Installing a Web Server: Sambar
Now that you have Perl installed and running,
it is time to download a Web Server that you can use locally to
test CGI scripts.
But how can I run a web server on my
computer that is not hooked up to the web?
Well, you "can" run a web server locally,
but it will only be useful for testing and development.
That is, you will create a network composed of one
computer and then use your web browser to access the
You can easily pick up a free web server for any
operating system you are using. For UNIX and Windows I recommend Apache.
You can also use the Sambar Web Server for Windows. In the
case of this tutorial, I downloaded Sambar from
because it is so incredibly easy to install. However, which
Web Server you choose will not make a difference for this
tutorial. They will all work like Sambar for our purposes.
Once you download the self-extracting
executable file from www.sambar.com, you
run the setup program and the server is installed. There is not much
else to it.
The server is fairly featureless, but for testing purposes that can
be just what the doctor ordered.
Once that is done, try running Sambar!
You should see the status window. Once that is done, you
can try connecting to your personal web server. Just use
your IP address in the location field in Netscape or
Internet Explorer or use "localhost". You can see
in the following image, that my Netscape document request
is being registered and handled by Sambar.