CSCI 470
Web Science
Spring 2013

Montana Tech
Computer Science & Software Engineering



ASSIGNMENT #1
Due: Thursday 1/24, 10PM

You will be building a web server using Ubuntu and Apache.
You will be learning to create a dynamic web application using CGI.


Part 1. You will be creating your own personal web server for use during the course. Your web server will be built using the LAMP software stack consisting of Linux (operating system), Apache (web server), MySQL (database), and PHP (server-side scripting). In this lab, you will be setting up Linux and Apache. We will configure MySQL and PHP in future labs. Part 2. One way a web server can provide dynamic content is by shelling out to an external program or script via CGI. You will be creating a simple web application that can store name/value pairs. The pairs are associated with a particular filename. You can store the pairs in the file in any way you like so long as it behaves as specified below.

Create two HTML pages get.html and set.html. The get.html page works as follows: The set.html page works as follows: Your can use any language you like, though if you want to use something besides C, Python or Perl you'll need to install it. Here is a skeleton CGI program in C that shows how to obtain the query string and output a page. It also has a couple helper functions for parsing out parameter values from the string.

Part 3. Benchmark your CGI program using the Apache benchmark utility ab. The utility is located in /usr/local/apache2/bin. Type ab with no arguments to get a list of its features.

Complete this readme.txt file with the requests per second you measure using ab connecting locally to your server (that is using the base URL http://127.0.0.1).
I don't like having to sudo every time I edit something in /var/www. What can I do about that? By default, apache runs the web server as the username www-data and the group www-data. You can add yourself to this group and then modify the permissions of var/www:
Submission. I will be testing your application by logging into your sever, starting Apache and then going to the get and set pages. You should also submit your CGI program source code, get.html, set.html and readme.txt to the Moodle dropbox. The Moodle timestamp is the completion time for the assignment.

Page last updated: May 15, 2013