Programming Exercise III: A Dynamic Website Using CGI

(Industry-Level, Second-to-None Comprehensive Specifications)



Absolutely no copying others’ works
Though these exercises are related, you are NOT allowed to submit one exercise to cover two or more exercises.
Development Requirements
When start developing the exercise, follow the requirements below:

Due Date and Submission Methods
Due on or before Wednesday, November 08, 2023. Send an email to the instructor at wenchen@cs.und.edu to let him know the exercise is ready for grading.



Objective
There are four steps to achieve our goal, building an online bookstore:
  1. (VPN) Sign in to our server, undcemcs02.und.edu .
  2. (HTML & CSS) Build static webpages.
  3. (CGI) Connect the Internet to the server-side programs.
  4. (Python) Write programs to fulfill the users’ requests.
This exercise is the third step to achieve the goal by using CGI (common gateway interface) to create a dynamic website. CGI is an interface which tells the webserver how to pass data to and from an application. More specifically, it describes how request information is passed in environment variables (such as request type, remote IP address), how the request body is passed in via standard input, and how the response is passed out via standard output:
User (client) ⇔ WWW ⇔ CGI (webserver) ⇔ Programs (server) ⇔ Databases/files (server)



Programming Helps
The four programming exercises (32% of the final grade) have each student step-by-step build a simple, dynamic website, which may be the most useful and popular IT system. By doing the exercises, students will gain essential knowledge and experience of using computers because they require you to know how to use various fundamental computer tools (like Linux, HTML, and Python). The instructor will detail how to use them in classes. If you still could not get them to work, come to the instructor and he will help you to set it up in few minutes.



Requirements
This is the third part of a simple dynamic website construction using CGI as the page below:


It includes the following pages: Recommended Steps
Take the following steps to build your Programming Exercise III:
  1. Connect to the NDUS servers by using VPN (virtual private network) like GlobalProtect.
  2. Connect to the server http://undcemcs02.und.edu/~user.id/ by using SSH (Secure Shell) like PuTTY.
  3. Sign in to your account by using your UND credentials.
  4. Enter the following commands when you sign in to undcemcs02 the first time:
       cd
       mkdir public_html
       mkdir public_html/3
       mkdir public_html/cgi-bin
       mkdir public_html/cgi-bin/3
       chcon -R -t httpd_user_content_t /home/first.lastname/public_html
       chmod 755 ../*
       chmod 755 *
  5. Your homepage of Programming Exercise III is located at
       public_html/3/home.html
    and the server-side scripts of your Programming Exercise III are located in the folder:
       public_html/cgi-bin/3/
    like
       public_html/cgi-bin/3/home.html
       public_html/cgi-bin/3/home.py
       public_html/cgi-bin/3/input.html
       public_html/cgi-bin/3/input.py
       public_html/cgi-bin/3/result.html
       public_html/cgi-bin/3/result.py
       public_html/cgi-bin/3/books.txt
  6. Enter the following commands after you create a script:
       cd 
       chmod 755 */*
       chmod 755 */*/*
       chmod 755 */*/*/*
       chmod 755 */*/*/*/*
       chmod 755 */*/*/*/*/*
  7. Start developing your Programming Exercise III.
  8. Use a browser to check your result at
       http://undcemcs02.und.edu/~user.id/3/home.html
  9. 🍀   Good luck!   🍀

Evaluations
The following features will be considered when grading: