I'd already installed Apache. I'm using PHP for my scripting in localhost. Have to know how you can run the perl script. I've installed sudo aptitude install libapache2-mod-perl2 I've produced a directory title cgi-bin during my /var/www/cgi-bin there inside this folder i've stored my perl script perl_1.pl Your directory permissions receive. Also i must do in order to run the script???? i simply type http://localhost/cgi-bin/ and that i got error 403 You do not have permission to gain access to /cgi-bin/ about this server. help!!


you cannot browse the cgi-bin contents. You have to refer straight to among the scripts inside it, within this situation: http://localhost/cgi-bin/perl_1.pl

Outdoors of this, make sure that your cgi-bin/ directory is really treated as a result in httpd.conf.

Oh, and just in case you stumble on 500 later on: make certain that the perl script prints a legitimate HTTP header. This may be easily accomplished by:

use CGI qw(:standard);
print header();

So that as Pwex stated: make certain your script has got the executable bit set.

chmod 755 perl_1.pl

...should work generally

Furthermore, for future reference it's worth mentioning mod_perl, because it is an all natural next thing after you have the fundamentals of cgi + perl + apache lower. Starting detail about it might be past the scope of the answer, but I decided to bring it up to ensure that you realize what to do next when you have the fundamentals nailed lower in addition to seen the restrictions of cgi.

If you're not associated with apache or can run these scripts on different port you'll be able to use Plack/PSGI toolchain which have methods to run old CGI scripts as PSGI programs. See Running CGI scripts on Plack for many ways to get it done.