Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to configure Apache for running perl scripts.

by dsb (Chaplain)
on Aug 06, 2004 at 13:57 UTC ( [id://380543]=note: print w/replies, xml ) Need Help??


in reply to How to configure Apache for running perl scripts.

You have to configure Apache to handle Perl scripts. This might be a good place to start before you go showing off your source code :).

You also need to print out valid HTTP headers before you can print any web content. Something your tiny script does not do.

print "Content-type: text/html\n\n";
or even better:
use strict; use CGI; my $q = CGI->new(); print $q->header("text/html");


dsb
This @ISA my cool %SIG

Replies are listed 'Best First'.
Re^2: How to configure Apache for running perl scripts.
by munu (Novice) on Aug 06, 2004 at 14:24 UTC
    Now I have added the lines you have specified..
    But now it is telling that "you do not have permission to access a.pl on this server".
    BUT I DID "chmod 777 a.pl".
    In /httpd/logs/errlog file it is mentioned that "optionsExecCGI is off in this directory /var/www/html1/a.pl"
    suEXEC mechanism is enabled

      It is probably the permissions on the directory. You do not want the program to be rwx by the world, 755 should be sufficient - also with suExec it will protest at running things that appear to be owned by someone other than the user the script will be run at.

      /J\

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-19 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found