Slide 13.11: Using Oracle9.2.0i at the server with an IP address 172.20.2.253
  Slide 13.13: Using Perl
  Home


Using CGI at the shell Server


  1. Create a cgi-bin Sub-Directory. Create the directory by using the following command:
      shell> mkdir ~userid/public_html/cgi-bin
      
  2. Create a CGI Script. Create/edit a CGI script such as test.pl, a Perl CGI script, in the 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.

    Note that a compiler, activated in a CGI script, can not successfully generate an object file if the source program results a warning message.

  3. Open CGI Scripts. Note that this step is no longer needed here because the new Web server treats the one executing a script as the script's owner.

    
       shell> 
       

         


    That is after
      shell> chmod 700 test.pl
    test.pl still can be initiated 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 ~userid/public_html
      shell> chmod 755 ~userid/public_html/*
      shell> chmod 755 ~userid/public_html/cgi-bin
      shell> chmod 755 ~userid/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 ~userid/public_html
      shell> chmod 777 ~userid/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 ~userid/public_html/cgi-bin/
       


  4. View the Execution Results from CGI Scripts. You can then check the execution results of your CGI scripts on the browser. For the example of CGI script test.pl, the results are at the location:
      http://people.aero.und.edu/~userid/cgi-bin/test.pl