Up Next
Go up to 4 Major Topics
Go forward to 4.2 CGI Introduction to Perl Topic

4.1 CGI Introduction Topic

The purpose of this section is to introduce, UNIX, Perl and CGI concepts. This for some, will be a review, for others new material. It will establish a starting point for the class and provide an introduction to the computer system used in the class, "cgi".

4.1.1 Preparation

Preparation for this section requires you to obtain an overview of how the various parts and pieces of the Internet and Web are tied together through the use of servers and clients. To do this:
  1. Review your UNIX skills. You may want to look at the UNIX Reference Desk
  2. Review your HTML skills. You may want to look at NCSA's A Beginner's Guide to HTML Home Page
  3. Look at an introduction to Perl. This can be the first chapter of Programming Perl by Wall, Christansen, & Schwartz and/or the first chapter of Learning Perl.
  4. Look at the Perl module list. Think about which ones might be useful writing CGI scripts. This can also be found at CPAN, the Comprehensive Perl Archive Network.
  5. Read the first chapter of CGI Programming by Gundavaram On the web at O'Reilly. This will provide an introduction to CGI scripting.

4.1.2 Group Task

  1. Each member of the group needs to log-on to system cgi. One member of the group need to keep a copy of the password file. After this is done, all members of the group need to change there password. (Choose a good password, but write it down please!) Verify that you all have the same GID. Look at the password file or is the id command. Once everyone has changed there password grab a second copy of the password file. Merge and edit the two file so that it represents a before and after snapshot of of the password entries for your group.
  2. Set up your account the way you will like it this semester.
  3. Each group member should create and set permissions on the directory public_html world read and execute. Within this directory create and set permissions on the directory public_html/cgi-bin world read and execute.

     

  4. Make sure that your public_html directory is set up correctly by creating an index.html file. You can also polish your HTML skills with this lab. It won't hurt at all of it shows off your groups creativity. Create a single HTML index_html page with several links. Use the UNIX command ln to create hard links so that only one page actually exists, but it appears in each group members directories. Plan on maintaining this page this semester so that it points to your groups work.

    Remember to test your page with a web browser.  

  5. Convert your index.html to a cgi program written in Perl. Create a program in your cgi-bin directory that is written in Perl that generates the same web page as your original index.html file. Then modify both so that the link to one another
  6. Create (or find) a Perl program or a shell script that displays the environment variables as seen by the running program. Examine the results of this program using a web browser. This will provide some incite in to what can be done with CGI programs. It turns out that this will be a useful program all semester.

4.1.3 Report

e-mail your group's report (only one copy please) as follows:
Instructor: ltaber@pima.edu** Red's Home page** The Pima College Site

Up Next