#!/usr/bin/perl # # vhshowlog.pl - dumps the named log to an HTML page # # Copyright (1997) Advanced Internet Technologies, Inc. require 'CGI.pl'; $logdir = "/usr/local/etc/httpd/logs"; # get form data &read_cgi_input; if ($FORM{'log'} eq "Access") { $logf = "$logdir/vhdomain.com-access_log"; } elsif ($FORM{'log'} eq "Error") { $logf = "$logdir/vhdomain.com-error_log"; } else { $msg = "

Error: Unrecognized Log

\n"; &write_and_exit($msg); } if (open(LOG, $logf)) { $title = "Viewing $FORM{'log'} Log for $mydomain"; &start_html($title); print "

$title

\n"; print "
\n";
   while () {
      print;
   }
   close(LOG);
   print "

\n"; &end_html; } else { $msg = "

Error: Could not open $FORM{'log'} Log

\n"; &write_and_exit($msg); } exit;