ASIC/FPGA Design and Verification Out Source Services
This page presents a script, which is used by this site, to extract,
what pages have been accessed (from apache2 access log).
-
As the owner of this site, it is very important to me to know which files
are most popular. Recently I decided to write a PERL script,
to extract this information from the access log of my web server (
an apache2 under debian).
-
The access log has a lot of information, regarding visitors to the site.
I, presently, only report on pages, which were visited on the current
day.
The scripts converts date's output to the format used in the access log
and extracts all the html pages of today.
-
As opposed to other PERL scripts, used by this site, this is
not run
by CGI. The access log is only accessible to root, and I don't want CGI
access to /var/log/apache2/ directory.
Instead the PERL script is invoked by the root, using
crontab. The output of this
PERL script is an
HTML report.
-
The PERL script uses a hash to store its main data base. The
key is the HTML file and the value is the number of times the HTML file
was visited. The hash is sorted so that the largest value is
displayed first.
-
More details can be read from the following pages:
The PERL script
description.
The crontab file
description.
The PERL script code
code.
|