Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP: Trying to get perl (.pl) to execute on my server 1

Status
Not open for further replies.

dondoucette

Technical User
Oct 14, 2004
9
CA
OK I have been a little dismayed with being unable to get perl scripts to work on my server so today I decided to much about in my conf files to see what I could do cause I have other perl scripts I would like to run other than YaBB. So here is what I can tell you about my system....

I have Apache 2.0.47 on Mandrake 9.2
mod_perl/1.99_09
Perl v5.8.1

whereis perl gives /usr/bin/perl

in commonhttpd.conf I have the following...

Alias /perl/ /var/
<location /perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
</Location>

The perl directory is 775 and the perltest.pl script in the directory is 755

This is the script...

#!/usr/bin/perl

# Create an HTML page to display a message.
print "Content-type: text/html\n\n";
print "<HTML><BODY><TITLE>Test</TITLE>";
print "<CENTER>";
print "<H1>";
print "TEST";
print "</H1>";
print "<HR>";
print "Hooray! It works!";
print "<HR>";
print "</CENTER>";
print "</BODY></HTML>";

When I try to acces my test script from the web I get a prompt in my browser asking me if I want to download the file.

Link to the perl file

What the heck am I missing here?

Thanks for your help!
 
Wishdiak...

Thank you very much!

I had AddHandler cgi-script .cgi so I just added .pl and restarted apache.

Now I get

Forbidden

You don't have permission to access /forum/perl/perltest.pl on this server.

So now at least I know it is trying to execute, now I just have to set the proper permissions!

Thank you sir!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top