Lab 9
Note: There is no lecture on Wednesday, but I will post an assignment that will be due next Monday. I will link the assignment on Wednesday's lecture notes.
Lab: This week's lab is lab 1 re-due. Anthony sent me the following email which should allow you to complete the lab.
Subject: RE: Perl
Sorry about not getting back to you sooner. I just got an email from luke
that put me on the right track.
Have the students do this in their home directories to make .cgi programs
work:
ln -s www public_html
This will create a soft link that spoofs the web server into thinking they
have a public_html directory
the reason that this is necessary is that when the apache security module
was compiled, it had the default "public_html" directory specified as the
document root of websites (I'm assuming luke just forgot to fix this). We
use "www", so it was throwing document root errors and not doing anything.
Also, if you need pictures to show up in cgi scripts, the pictures cannot be
in the cgi-bin directory, or any subdirectory of cgi-bin, because the web
server will try to execute those with perl, which won't work.
I tested this on my own personal account, and it worked, but I'll try to get
some more testing in to make sure....
Anthony
Lab 1 - Perl
In lab today:
Tim Gradl your lab TA will assign time slices to each of you for turning in your
homeworks. Then you will start the Perl assignment below.
To Do:
You are to write a CGI program in Perl that handles the following:
-
Students will go to a Web page enter their name and then answer 10 mulitple choice questions.
- When they submit their answers it will call a perl cgi script (Perl cgi scripts are saved as .cgi not .pl) that will do the following:
- Read in the correct 10 answers from a file.
- Match up the correct answers with the input answers and grade the quiz.
- Then write the results out to a file. Output: Name, answers, score, date and time.
- Make sure all your permissions are set properly, and your cgi files are saved in ~/www/cgi-bin/
What to turn in:
you will demo your program for Tim Gradl during your time slice of lab time.