develooper Front page | perl.beginners | Postings from July 2003

RE: apache/cgi/script/beguinner

From:
Dan Muey
Date:
July 25, 2003 06:27
Subject:
RE: apache/cgi/script/beguinner
Message ID:
D6D77DB239A2004BB08A240E2E71460D12BA35@LSLOFFICE.infiniplex.infiniplex.com
> #! /usr/bin/perl
> 

You should only have one shebang line, the on with the right path.

> #!/usr/local/bin/perl
> # hello.pl - My first CGI program
> 
> print "Content-Type: text/html\n\n";
> # Note there is a newline between 
> # this header and Data
> 
> # Simple HTML code follows
> 
> print "<html> <head>\n";
> print "<title>Hello, world!</title>";
> print "</head>\n";
> print "<body>\n";
> print "<h1>Hello, world!</h1>\n";
> print "</body> </html>\n";
> 
> I have put this file at /html and /cgi-bin as a pl file as 
> well as a cgi file... no way.. netscape displays the text 
> content of the file, but does not execute the script. so it 
> is just printing the whole textual content of the file... 
> I have chmod 755 the file.. so... what do I have to change 
> and where... please.. if I place the script 
> at /cgi-bin then it gives me an error msgs forbiden.... so? 

Is the webserver user allowed to execute it (SETUID, nobody, or ???)?
Is apache configured to know how to execute it?

HTH

DMuey



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About