You need to configure Apache like this:
Code:
AddHandler cgi-script .cgi
And after the <Directory "/svr/www/htdocs"> (or whever your main htdocs is located), make sure your
Options contains
ExecCGI.
Here's an example of one I have on an old server of mine -- I have the main htdocs setup to allow for CGIs to be executed, as well as a virtual host:
Code:
<Directory "/usr/local/apache_1.3.26/htdocs">
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<VirtualHost 10.100.1.1>
ServerAdmin neil@foo.com
DocumentRoot /home/neil/htdocs
ServerName neil.foo.com
ScriptAlias /cgi-bin/ /home/neil/cgi-bin/
<Location />
Options ExecCGI
</Location>
</VirtualHost>
If this still doesn't work for you, just send me a private message with your httpd.conf attached, and I'll make the necessary changes for you and send it back.
Also don't forget to test the syntax of your perl script from your shell prompt. A simple
perl -c redirect.cgi should do the trick. If you see
syntax OK, your script is good. Just make sure that's good first.