In this assignment, you will use the GD::Graph
module to create a bar chart that shows
web usage for evc-cit.info
.
You will use a form like this to let the user choose a day (the year is fixed at 2005), and then produce a page that gives both a table of accesses by hour as well as a graph of the accesses. The example form is active; you may try it and see it in action.
You will not be using the real log file; you will be using
a copy of it that will be updated every day. The file you will
want to analyze is /var/log/access_copy
. This
solves a lot of problems with reading a file that is open and being
updated by another process. Make sure you close the file
when you finish reading it!
I have not told you anything about what the log file looks like internally; you have to find that out for yourself.
You must write two scripts. The first one, which must be named
stats.cgi
will produce the table of statistics and
an <img>
element whose src
attribute is a call to the second script, which must be named
graphstats.cgi
.