PERL/CGI- Getting Started

 

To get started programming Perl/CGI you need an environment to develop them in. If you are using UNIX or LINUX these features are built in and you can skip to the next section. But if you are running Windows 9x then you must do some things to start.

First you need to download the Apache Web Server at http://www.apache.org. After it is done downloading, run the program to install it. After installation go to the conf directory from the directory you installed Apache to and open the file httpd.conf for editing. Find the line that starts ServerRoot. Change this to read ServerRoot "C:/Apache" (where C:/Apache is the directory you installed Apache to. Now go to the line that starts ServerName. If you are just going to be running Apache to test programs, then change this line to ServerName "127.0.0.1". Otherwise you should replace 127.0.0.1 with the IP/Address of your webpage (i.e. www.yourname.com). Next go to the line that starts DocumentRoot. Change this line to DocumentRoot "c:/webpage" where c:/webpage is the root where you documents will go. You will also need to download and isntall DCOM 98 from the Microsoft site. There should be a link to it from the download page.

Now you need to go to the ActiveState site. Click on the link to download ActivePerl 615. Download this file. While it is downloading you will need to also download and install the Microsoft Installer 1.1, there will be a link from the download page. Once both files are downloaded and the MI 1.1 is installed, double click on the file downloaded from ActiveState. Install it to the default directore (c:\Perl). After it has installed, open the httpd.conf file again.Find the line that begins ScriptAlias /cgi-bin/ and change it to ScriptAlias /cgi-bin/ "c:/webpage/cgi-bin" where c:/webpage is you DocumentRoot (make sure to create the cgi-bin directory). Now skip down a few lines to the line that starts <DIRECTORY ... and change it to <DIRECTORY "c:/webpage/cgi-bin"> (where c:/webpage/cgi-bin is the directory you specfied in the last step).

Save the file. Now go to a command prompt and type c:\Apache\Apache.exe (where c:\Apache is the directory where you installed Apache). To exit the server, type CTRL-C.