Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: where to place the .pl fro cgi script

by dorward (Curate)
on Oct 25, 2006 at 09:40 UTC ( #580524=note: print w/ replies, xml ) Need Help??


in reply to Re: where to place the .pl fro cgi script
in thread where to place the .pl fro cgi script

the precise answer to your question is that hello.pl must be placed in the directory cgi-bin.

No, that's a common configuration, but not universal, on my system this is called "cgi" not "cgi-bin". The precise answer is the one you get after reading the documentation for your webserver.

Typically this will be found in the public_html directory, but is sometimes not so you may have to look around for it

On my system 'public_html' is 'pages', and 'cgi' is a sibling, not a child. You shouldn't have to "look around for it" though, the aforementioned documentation should tell you.

You also may need to change the permissions on the file to 755

Hopefully the system will be set up so that world doesn't need access and you can limit execute permission to the group.

(normally this can be done using you ftp client)

Although hopefully you are using sftp, rsync over ssh, or some other means of transfering files that doesn't result in passwords being sent in clear text.

and if you are viewing from a browser an html header print "Content-type: text/html\n\n"; before your print 'hello world'; statement will probably be necessary.

Would it qualify as a CGI script if it didn't output a Content-type header?

Either way, printing out the content-type directly instead of using a module (such as CGI.pm) probably isn't the way to go.


Comment on Re^2: where to place the .pl fro cgi script

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-10-24 11:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (131 votes), past polls