www.polyteknique.net Annuaire d'URL géographique !

.:: PLAN :: CV :: CONTACT :: MOTEUR :: STATS :: BILLETS :: NNTP :: IRC ::.
Navigation : DEVELOPPEMENT > PERL
LECTURE DU LOG BRUT D'APACHE
Ce scipt CGI permet d'ouvrir en affichage le log Apache du site.
www.polyteknique.netDETAIL DU SCRIPT
#!/usr/bin/perl -w

use CGI::Carp qw(fatalsToBrowser);

print "Content-type: text/html\n\n";
print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">', "\n";
print "<html><head><title>CGI PERL LOG APACHE</title></head><body>\n";
print "<h1>LOG WEB APACHE WWW.POLYTEKNIQUE.NET</h1><br>\n";

($secondes, $minutes, $heures, $jour_mois, $mois,
        $an, $jour_sem, $jour_calend, $heure_ete) = localtime(time);

$mois += 1;
$mois  = $mois < 10 ? $mois = "0".$mois : $mois;
$an    = substr($an, 1, 2);

open (LOG, "< /data/www/net/e/u/polyteknique.net/www/logs/access_log_$mois$an");

   print "<font size=2><table border=1>";
   while ($ligne = <LOG>){
      print "<tr><td>$ligne</td></tr>";
   }
   print "</table></font>";
   print "</body></html>\n";

close (LOG);
www.polyteknique.netLES LIENS :
TESTER LA LECTURE DU LOG APACHE : cgi-bin/logapache.pl

Rédigé le : 2004-02-16 21:43:12
Admin - 2003-2008 @ PolyTek~>DeeZigN - 83952 visites - Contact
Chargée en 0.03 sec. - sans cache (10 requètes) - 38.103.63.16 - PhP : 4.4.4
Valid XHTML 1.0 ! Debian GNU/Linux est un système d'exploitation libre Valid CSS !