PDA

View Full Version : Perl CGI Scripts with Apache



Dannz
21-10-2005, 08:02 PM
I have VOCP installed and i want to use the web interface

the interface is here: http://dannz.homelinux.com/vocp/vocpweb.cgi
For some reason i get 403 forbidden

How can i allow perl cgi scripts to run

(the site will be up till 10:30 after which i have to shut my computer down)

robsonde
21-10-2005, 08:08 PM
perl scripts must be in a directory that Apache thinks is "CGI" safe.
check the config for apache i think its under scripts.

if you are on *NIX....

put perl scripts in www/cgi-bin/*

new URL will be www.yoursite.com/cgi-bin/script.pl

Dannz
21-10-2005, 08:14 PM
i guess i will need to copy all associated files into the cgi-bin directory as well?

robsonde
21-10-2005, 08:15 PM
i would think so, what files??

Dannz
21-10-2005, 08:17 PM
Images etc

Dannz
21-10-2005, 08:18 PM
Its working now thanks

robsonde
21-10-2005, 08:25 PM
then if you want nice clean URL's then setup mod_rewrite to magic the URL's from one thing to another.

EG:
http://www.theanswerguy.co.nz/article/426
is what a user puts in to the browser, the Mod_rewrite changes it to.....

http://www.theanswerguy.co.nz/cgi-bin/view?426

to do this we have some goo line in the httpd.conf


LoadModule rewrite_module /usr/lib/apache/modules/mod_rewrite.so
RewriteEngine on
RewriteRule ^/article/(.*)$ /cgi-bin/view?$1 [PT]