PDA

View Full Version : configuring apache for cgi/perl scripting


Cheesy Peas
10-02-03, 03:33 PM
Hi guys, can someone help me with configuring apache to use cgi.

ive tried to do it myself and i keep getting server erros whenever i try to access them.

I wanna use the normal settings, (cgi-bin in normal folder access from all directories etc)
I am using the 2.0.xx version for windows.(just upgraded from version 1.3)

Ive tried setting it up like it says in the manual but i cant get it to work so can someone with more experience give me a hand.
Also, which files do i need in the \bin directory? do i need to make a new folder called perl and put all the active perl components in there, or do i just need the perl.exe file in the \bin directory?
could you help in showing me which parts of the config to change, or even better, set up my config file for me?

My config file (http://kieronholden.pwp.blueyonder.co.uk/httpd.conf)
thanx, Kieron

Cheesy Peas
10-05-03, 03:16 PM
*bump*

su root
10-05-03, 05:43 PM
Well, since no-one else has had any ideas (including me), I'll put in my two cents.

I don't really see where you have your references to perl in there... A quick find shows no instances of the word "perl"..

Here are my config files,
apache.conf is for apache 1.x (may be out of date, as this was before I upgraded)
apache2.conf is for apach 2.x
commonapache2.conf is the other half of apache2's config.

These are from a linux install, most of the stuff should be the same though, just the paths would be different. To me, it doesn't look like you have modified your apache config for perl.

It's been so long, I don't remember if it was done automatically for me, or I had to add a few lines myself.... The install should have told you if you needed to edit it. I would definately look at your readmes and helpfiles though..

http://ocimg.blackpacket.net/downloadables/apache

With a quick look, I think you are missing this part:
<IfModule mod_perl.c>
PerlModule Apache2::ModPerl::Registry
#set Apache::Registry Mode for /perl Alias
<Location /perl/*.pl>
SetHandler perl-script
PerlResponseHandler ModPerl::Registry
Options -Indexes ExecCGI
PerlSendHeader On
</Location>

#set Apache::PerlRun Mode for /cgi-perl Alias
<Location /cgi-perl/*.pl>
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
Options -Indexes ExecCGI
PerlSendHeader On
</Location>
</IfModule>

Cheesy Peas
10-06-03, 08:27 AM
thanx bud, i slipped that code in you posted in the options part and modified the directories and now its workin fine, i had been trying to put in a diff code before but it didnt work.
Cheers.