Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

How do I configure Apache to run perl scripts? (was : New to perl!)

by ms_vijay (Initiate)
on May 24, 2002 at 15:25 UTC ( [id://169104]=perlquestion: print w/replies, xml ) Need Help??

ms_vijay has asked for the wisdom of the Perl Monks concerning the following question:

I need to configure my apache server on RH Linux 7.1 to run .pl's how do i do it???

update by boo_radley : title change
  • Comment on How do I configure Apache to run perl scripts? (was : New to perl!)

Replies are listed 'Best First'.
Re: How do I configure Apache to run perl scripts? (was : New to perl!)
by joealba (Hermit) on May 24, 2002 at 15:43 UTC
    In your httpd.conf, change the AddHandler line to: AddHandler cgi-script .cgi .pl I think it just has .cgi in that line by default.
Re: How do I configure Apache to run perl scripts? (was : New to perl!)
by Caillte (Friar) on May 24, 2002 at 15:57 UTC

    You need to put two things into your httpd.conf file. First, to tell apache what an executable is you need to put in something like:

    AddHandler cgi-script cgi pl

    This tells apache that any file with the extension cgi or pl is a cgi script. This still doesn't mean that your scripts will run, you also have to tell apache where you intend to run scripts from, what is called your cgi-bin directory.

    ScriptAlias /cgi-bin/ /home/thing/www/cgi-bin/ <Directory /home/thing/www/cgi-bin> Options +ExecCGI </Directory>

    What this does is, first, tell apache where to look for files when the it gets a request like www.thing.com/cgi-bin/myscript.pl and the other three lines tell apache that it is ok to run scripts found in that directory.

    Finally, apache runs as a user. Therefore it is important that that user has read and execute (but not write) permissions for these directories and files.


    This page is intentionally left justified.

Re: How do I configure Apache to run perl scripts?
by cjf (Parson) on May 24, 2002 at 15:46 UTC
Re: How do I configure Apache to run perl scripts? (was : New to perl!)
by Aristotle (Chancellor) on May 24, 2002 at 15:50 UTC
Re: How do I configure Apache to run perl scripts? (was : New to perl!)
by mrbbking (Hermit) on May 24, 2002 at 15:39 UTC
    Should be done by default.

    Save them in /cgi-bin/ and make sure they're executable.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://169104]
Approved by Caillte
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-04-25 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found