Jump to main content
University Computer Centre
Retrieve web accesses

Retrieve web accesses

Of course, a web author is interested in how often his pages are read. Technically, these are the numbers of requests of these documents from our server. Not ascertainable are requests that are already fulfilled by local proxy cache servers (at the reader's service provider, for example). In addition, it is of course hardly possible to determine whether the page was actually read or only skimmed over...
The daily and monthly evaluation of the log files reveals the most frequently requested documents (TOP 150).

webstat

The page requests are transferred from the log files of the central web servers www.tu-chemnitz.de and www-user.tu-chemnitz.de into a database. Local accesses (TU Chemnitz = *.tu-chemnitz.de), "near" accesses (Germany = *.de) and other accesses are broken down individually. Furthermore, accesses in the current month, in the previous months of the current year and even earlier accesses are counted individually.

The accesses have been recorded since 1.1.1997. Every night, the access figures for the day are updated for each document in the database. This means that the accesses of the current day are only visible on the following day.

The statistics are accessed via the CGI script /cgi-bin/webstat or via a PHP function in the respective document.

Query:

Possible uses as a PHP function:

Example:
<?php include('php/webstat.inc');
      $res webstat($_SERVER['SCRIPT_NAME']);
      printf ("Total accesses: %s, of which TU Chemnitz: %s<br />",
           $res[0]['gesamt'],
           $res[0]['gesamtlokal']);
?>

If the URL path was specified as a pattern (with *) of the document to be queried is passed to the webstat function.The result is a field of fields. The first field (index 0) contains the accesses of all documents found. The total number of accesses is obtained with the index 'gesamt' (total), individual access numbers e. g. with indices 'monatlokal' (month local), 'jahrde' (year germany) or 'gesamtwelt' (total world).

If the URL path was specified as a pattern (with *), the top 100 of the applicable documents are obtained as further entries in the result field:

<?php include_once('php/webstat.inc');
      $res webstat('/urz/www/*');
      printf("%s: %d document(s), Total accesses: %s, of which TU Chemnitz: %s, DE: %s<br />\n",
        $res[0]['url'],
        $res[0]['count'],
        $res[0]['gesamt'],
        $res[0]['gesamtlokal'],
        $res[0]['gesamtde']);

     # Output of the Top 5:
      $max $res[0]['count'] < $res[0]['count'] : 5;
      if ($max 1) {
          print "<b>Top $max documents:</b><br />\n";
          for ($i 1$i <= $max$i++) {
              if ($res[$i]['url'])
                  print $res[$i]['url'] . ': ' $res[$i]['gesamt'] . "<br />\n";
          }
      }
?>
Result: /urz/www/*: 100 document(s), Total accesses: 3103061, of which TU Chemnitz: 773380, DE:
Top 5 documents:
/urz/www/kurzurl.html: 801708
/urz/www/: 258508
/urz/www/mod.php: 175952
/urz/www/wtc.html: 139690
/urz/www/html-autoren.html: 135319