Re: Virtual Host Logging Perl Script

2003-07-16 Thread Guillaume Fougnies
Hi,

Wed, Jul 16, 2003 at 11:07:47AM +0100: Jez Hancock wrote:
> Hi Ged,
> 
> On Wed, Jul 16, 2003 at 07:06:43AM +0100, Ged Haywood wrote:
> > On Tue, 15 Jul 2003, Jez Hancock wrote:
> > > Does anyone how one could log errorlog entries in a similar manner to
> > > the script above - ie pipe the errorlog to a script which appends one
> > > copy of the error entry to a main error logfile and another copy to the
> > > virtual host's error logfile?
> > It's possible, but I don't think you really want to do it.  You would
> > be asking the server to do more than is necessary while handling each
> > request (you probably already are:).
> This was my reason for considering using mod_perl :)
> 
> > Would it not be better for example to rotate your logs frequently, and
> > to process them afterwards, off-line?  You would then have a choice of
> > doing things with the various log file analysis tools too.  If you are
> > a little bit creative in what you log, it can be simple to extract the
> > information you need for each vhost from one file.
> I would do this but we wanted to give our users 'live' logfiles, rather
> than making them wait until log rotation before being able to view them
> (or did I misunderstand you?).

During my work on the ENodes project, i've developed a tiny threaded logger
in c to manage internal logfiles (by webmaster/website/version).
(you can rewrite it in perl with a 5.8.x built with thread...)

Perl handlers send log lines through a UNIX socket to the logger which
is opening logfiles when needed and keeping them opened.
It avoids the overhead of opening and locking each time the file and
provides as many online debug logfile as you ask.
The logger is launched in a 'PerlRequire' file.
The client have a persistant connection to the logger.

If it fits your needs, you can get sources here: http://www.enodes.org
 Server : utils/enodes_logger/enodes_logger.c
 Client module  : enodes_core/modules/ENodes/Core/ApLog.pm

Cheers
--
Guillaume FOUGNIES


Perl Handlers and namespaces.

2001-11-05 Thread Guillaume

I ran into this problem today. I am trying to develope a small
application server with a few handlers and Apache/1.3.22 .

So I have something that looks like this set up in the apache conf file:


   
  Allow from all
   
   PerlRequire "startup.pl"
   SetHandler perl-script
   PerlHandler AppServer

   AuthName "AppServer"
   AuthType Basic
   PerlAuthenHandler AppServer::Auth
   require valid-user

   PerlAccessHandler AppServer::Access


Now, you notice that these packages are all under the same namespace.
This, somehow, causes an 'Undefined subroutine &AppServer::handler
called.' each time the server recieves a request from a client. However,
if i move the main handler into another
namespace or simply rename it to foo.pm ( and adjust the apache conf
file of course ) the error magically disappears. If one of the access
handler or authentification handler is under the same namespace as the
main handler, i always get the undefined subroutine error msg.

I'm not sure why or how apache handles this or if it's a bug or if i'm
just too tired and missed something somewhere else. I would appreciate
someone's insight on this. Is it a bug / limitation /... ?

Thanks for your time,
Guillaume




I want to unsubscribe!!!!!

2001-09-01 Thread Guillaume Denizot


_
Le journal des abonnés Caramail - http://www.carazine.com




Apache et perl

2001-06-29 Thread Guillaume Denizot

J'ai installé Apache 1.3.12, Perl 5.6.0 sous Mandrake 8.0.
J'ai la page HTML suivante (sans les <>) (dans
/var/www/html):

html head title Page de Test /title
meta name="author" content="denizot"
/head
body
form action="../cgi-bin/base.pl" method="GET"
input type="Text" name="saisie" value="" size="10"
/form
/body /html

et le script perl (dans /var/www/cgi-bin) suivant:

#!/usr/bin/perl -w
# base.pl

printf "Content-type: text/html\n\n";
print "ca marche pas\n";

J'ai modifie httpd.conf pour que /var/www/cgi-bin soit un
Directory avec Options ExecCGI.

Lorsque je tape http://nom_de_host et que je presse Enter
apres la saisie,
une page HTML Internal ERROR me saute au yeux.
Par contre, lorsque je tape http://adresse_ip et que je fais
la meme manip,
une fenetre "Enregistrer sous..." apparait.
Quelqu'un a-t-il eu le meme probleme ou comment le resoudre?
_
Le journal des abonnés Caramail - http://www.carazine.com