CSCI 470
Web Science
Spring 2014

Montana Tech
Computer Science & Software Engineering



Apache and CGI

You will learn to manage an Ubuntu server in "the cloud".
You will be installing your own Apache web server.
You will be learning to create and benchmark a dynamic web application using CGI.


Part 1: Setting up your server You will be creating your own 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, Apache and PHP. Part 2: Benchmarking CGI 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: You can use any language you like, though you may need to install a compiler/interpreter for your chosen language. 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. You will need to install the package apache2-utils to get this utility. To eliminate other sources of performance issues, we'll first benchmark locally on your server. You will also benchmark in a more realistic situation, from another server of your own choosing (e.g. katie). Type ab with no arguments to get a list of its features.

Complete this readme.txt file with the requests per second you measured using ab.

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: December 30, 2014