Splash of Style...Macs, Photography, Design, and other Passions

Perl Install on Apache

April 23, 2004 by debbie T | ApacheWeb Development

Tonight I worked on installing perl on my Apache server on my Win XP system. I am so excited to run a few blogging scripts on my own hard drive to experiment and test templates, etc.

At first I was very confused and I didn’t know what to do. Looking at the ActivePerl web site, it looked pretty intimidating and I didn’t know if I was ready for the challenge. But after googling for "installing perl on apache", I printed out two good tutorials and combined the information from both to make it work for me:

* Installing & Configuring CGI Tutorial
* Installing Perl Tutorial

So, here we go!!

* Download the latest version of Activeperl (I downloaded 5.8.3 build 809 MSI) and install.
* I changed the default install to c:\usr\ so it matched to Hosting Matters (my host) path to perl.
* I kept the other install options at the default. After install was completed, I rebooted Windows.
* Opening the conf\httpd.conf file (for Apache) I edited line #335 and added the text ExecCGI so it reads "Options Indexes FollowSymLinks ExecCGI MultiViews Includes" (It is best to read both tutorials for more details on your config file, as the text might look slightly different in your file.)
* I uncommented the AddHandler cgi-script .cgi and also added AddHandler cgi-script .pl right under it. (This allows scripts to run outside of the cgi-bin folder, see the tutorials for more details.)
* I left ScriptAlias /cgi-bin/ as is, and did not comment out the code.
* I already had .shtml includes enabled, so there were no edits needed for this (see the tutorial for more details, server side includes are very important to web design.)
* After edits were made, I saved the file, then restarted Apache.
* Since I installed perl to my c: drive and Apache is installed in my d: drive, I can’t use the default #!/usr/bin/perl as the shebang notation (the top line in cgi files) because perl can’t be found in the same partition. For my script files, I must change the top line to #!c:/usr/bin/perl.exe or #!c:/usr/bin/perl to give the direct path to where perl is installed. If Perl is installed in the same partition as Apache, then it is much easier. The best thing is to try the default path in the testing hello.cgi script and if it doesn’t work, then specify the path directly.

Yay, and now I am done and hopefully I can install some neat scripts to test on my own system! Next stop my laptop!

Commments are closed for this article.