Slide 3.8: CGI (Common Gateway Interface) Slide 3.10: REQUEST_METHOD: GET or POST Home |
shell> mkdir ~/public_html shell> mkdir ~/public_html/cgi-binwhere the symbol ~ is the user's root in the Unix file system.
cgi-bin directory.
The cgi-bin directories are set up so that they do not serve plain HTML/WML pages; they just execute a given CGI script.
An example of a CGI Perl script is ~/public_html/cgi-bin/test.pl.
Check the CGI Programming 101 for how to write CGI scripts.
†Note that a compiler, activated in a CGI script, can not successfully generate an object file if the source program results a warning message.
shell> chmod 700 test.pl
test.pl still can be activated from the Web without problems and it acts like the owner being executing the script.
Open CGI scripts to let the browser, which is not the owner of the scripts, access them by using the command chmod : shell> chmod 755 ~/../userid shell> chmod 755 ~/public_html/ shell> chmod 755 ~/public_html/* shell> chmod 755 ~/public_html/cgi-bin/ shell> chmod 755 ~/public_html/cgi-bin/*†Note that the above commands may not be complete. You have to open all the files in the public_html directory.
If CGI writes to your directory, such as ~userid/public_html/out/ , then you need to open that directory. For the example of that directory:
shell> chmod 755 ~/../userid shell> chmod 755 ~/public_html/ shell> chmod 777 ~/public_html/out/†Note that if you write the file to the directory where the CGI script is, this will cause Internal Server Error , that is, try NOT to do the following:
shell> chmod 777 ~/public_html/cgi-bin/
~/public_html/cgi-bin/test.pl , the results are at the location:
http://people.aero.und.edu/~userid/cgi-bin/test.pl |