Re: New mod_perl Logo

2002-01-31 Thread Paul Cotter


   mod_perl is a lousy name.

It is causing me a problem. My potential customers have heard of Perl and
Apache, MySql and Postgres, but they dot like the idea of perl modifying the
Apache processing. It strikes them as tinkering round with the internals and
liable to cause problems 'when we upgrade' or 'move to another platform'. It
also does not look good on a resume when you are sending it to someone who
has never heard of it. You are never quite sure whether to Wordcap it or
not. Give it some other marketting name, even if it keeps its original name
in places like this. Anything will do, WebBlast, Insiouxiance, Perlandra,
Exsight, Insite, HowtoSite - I really do not mind.

Regards - Paul Cotter





Reverse engineered HTML

2001-05-15 Thread Paul Cotter




Does a package exist that will read an HTML document and generate an 
Apache::Registry cgi script? Even better if it accepts an 
!--Perltag.
Regards - Paul 
Cotter


Re: install perl-win32-bin-0.6.exe on win98

2001-05-09 Thread Paul Cotter

Hi

I am running it but I am using a different source. The respective psrt of my
conf file is

LoadModule anon_auth_module modules/mod_auth_anon.so
LoadModule dbm_auth_module modules/mod_auth_dbm.so
#LoadModule digest_auth_module modules/mod_auth_digest.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule digest_module modules/mod_digest.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule headers_module modules/mod_headers.so
LoadModule proxy_module modules/mod_proxy.so
#LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule speling_module modules/mod_speling.so
LoadModule info_module modules/mod_info.so
LoadModule status_module modules/mod_status.so
LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule usertrack_module modules/ApacheModuleUserTrack.dll

LoadModule perl_module modules/mod_perl.so
Perl
#!perl.exe
 $Apache::Server::SaveConfig = 1;
__END__
/Perl

I realise this does not solve your problem unless you want to have a go at
using the binaries from the university of Winnipeg. If so I will try and
find the url you need.

Paul Cotte

- Original Message -
From: David Lanzarote García [EMAIL PROTECTED]
To: Randy Kobes [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, 09 May, 2001 12:35 PM
Subject: Re: install perl-win32-bin-0.6.exe on win98


 On Tue, 8 May 2001, Randy Kobes wrote:

  On Mon, 7 May 2001, David Lanzarote García wrote:
 
I'm using perl-win32-bin-0.6.exe package, so I use the Perl
   and Apache binaries that come with it. When everything is unpacked
   I move  the perl subdirectory to c:\Prel, the apache subdirectory
   to c:\apache and the openssl directory to c:\openssl.
When everything is done as it's explained on the installation readme
   (I think so, but I'm not 100% sure),I try to execute apache as:
 Apache.exe -f conf\httpd.conf-perl
   and the error cannot load /apache/modules/apachemoduleperl into
   server appears.
 
  It sounds like it's trying to load the dll named ApacheModulePerl,
  without the .dll extension. What if you try, in httpd.conf-perl,
  putting in
 LoadModule perl_module modules/ApacheModulePerl.dll
  (ie, with the extension).
 
  best regards,
  randy kobes
 
 
 I tried to load the module both ways, first by:

 LoadModule perl_module modules/ApacheModulePerl.dll

 and it produced the error:
 Syntax error on line 181 of c:/apache/conf/httpd.conf-perl:
 cannot load /apache/modules/ApacheModulePerl.dll into server:

 after that, I tried to load the module by:

 LoadModule perl_module modules/ApacheModulePerl

 and it produced the error:
 Syntax error on line 181 of c:/apache/conf/httpd.conf-perl:
 cannot load /apache/modules/ApacheModulePerl into server:

 and ApacheModulePerl.dll was on directory c:\apache\modules\ , so I don't
 know why this nodule can't be loaded.

  Thanks for your ideas..






Re: Apache Processes hanging

2001-05-03 Thread Paul Cotter

This answer has nothing to do with modperl - sorry. I have had the same
problem
on a Sybase database with a 'normal' application.

This situation can occur due to a database (b)locks, particularly if a
transaction is
composed of more than one update, or it fires a referential trigger which
has the same
effect.

The first question is what is the lock-level. Is it at the row or at the
page - I presume
the row. If the insert causes a 'fault' such that an index page becomes full
and has to
split then the whole index page will be locked regardless of row-level
locking. If the
second part of transaction is waiting on someone else then we can get the
deadly
embrace situation. However, it can normally be cleared on time-outs. If
however
you are acquiring these blocks faster then they time out, then in very short
order
you will be .. er.. screwed.

Sometimes it can help to do dirty reads if the data you need to present does
not need to be up to date.

One of the cures for this is an update pipe. Instead of each 'program' doing
the insert
on the database they funnel the updates to a single threading process. Reads
of
course can be be done by the individual 'programs'.

Can you confirm that the connection is freed if you kill the process that is
blocked?
If so this gives you another way out.



- Original Message -
From: Robert Landrum [EMAIL PROTECTED]
To: Kevin Slean [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Thursday, 03 May, 2001 03:40 PM
Subject: Re: Apache Processes hanging


 At 10:37 AM -0400 5/3/01, Kevin Slean wrote:
 Mod_perlers,
 
 I have a problem with Apache and was looking for your thoughts on my
problem
 or some additional mailing lists more focused on just Apache.
 
 I have 70 httpd daemons running and some of them just appear to hang.  As
 time goes by, the number of hung processes increases such that there are
no
 working ones left to perform real work.  Consequently transaction
processing
 performance drops eventually to zero.
 
 Our web transactions running through these httpd daemons should not take
 more than 60 seconds in a worst case scenario.  Yet, some of these 'hung'
 processes have been on the same transaction for over 30 hours.  I
 originally thought that this was a mod_perl problem and was buried in the
 CGI/Perl routines performing the transactions.  However, upon closer
 inspection, I have found that these hanging processes are also running
JAVA
 servlets and gif gets.  This makes me suspect that it is an Apache
problem.
 
 I ran truss on the hung processes and found that they fell into two
camps.
 The first group was sitting at a read system call.  The second group was
in
 a loop with sigalarm going off every 10 seconds.
 

 I'm having similar problems, but we think it's directly related to
 Oracle.  Basically, a connection is made to the Oracle database, a
 transaction is started and finished, but the connection to the
 database doesn't go away and the statement (at least from the oracle
 side) never seems to finish.  The data is present in the database
 (these are insert statement, btw).  Over time, every process collects
 one of these hanging statements and it eventually overwhelms our
 oracle database.  The only solution is to restart apache every 5
 minutes to eliminate the built-up non-finished transactions.

 Has anyone seen this before?

 Rob

 --
 As soon as you make something foolproof, someone will create a better
fool.





Much Todo about nothing

2001-04-27 Thread Paul Cotter



If this is the wrong place to post then please adviseFYI:At 
http://perl.apache.org/from-cvs/modperl-2.0/ 
when extracting modperl-2.0_20010427110246.tar.gz there is a file called 
Todo and a directory called todo. This is a 'problem' in a windows 
environment which is case insensitive. Obviously easy to 
bypass.Regards - Paul Cotter



Passing Tied Filehandles

2001-04-18 Thread Paul Cotter



Hi
I was trying to get NET::Ftp to work in Apache to post statistics via FTP. 
These stats are in memory and are manipulated before being posted. I wanted 
totie a filehandle so thatNet::FTP would call my READ code. So I 
could just go 

 MyNetFTPObject-put(TIED_FILE_HANDLE, 
remote_file)
I cannot get this to work and it seems to boil 
down to this fabricated example. Note that theREAD / OPEN etc routines in 
PRCTiedHandle prints out the READ / 
OPEN 'debug' message. A summary of the example is:

 1) Tie 
and open a filehandle , buffering data in array.
  2) sysread 
from within main::
  3) Pass 
filehandle to subroutine and go sysread
  4) sysread 
again from within main

The result is that the 'main' sysread work, but the 
sysread in the subroutine'fails' (returns undef). 

use strict;use PRCTiedHandle;my ( $len , 
$buf, $blksize) = (0,"",120);my $file = 'c:\a.txt';

tie *FILMAIN, PRCTiedHandle::;open *FILMAIN, 
$file or die "cannot open $file" ;print "Main 1 before sysread 1 
filmain=", *FILMAIN, " ref=", ref(\*FILMAIN) 
,"\n";sysread(*FILMAIN,$buf="",$blksize);

print "Main 2 after first 
sysread\n";readIt(*FILMAIN); 
$len = sysread(*FILMAIN,$buf="",$blksize); print "Main 3 after sysread 
2\n";close FILMAIN;

sub readIt (*){*FILSUB= 
shift; print "readIt filsub=",*FILSUB, " 
ref=",ref(\*FILSUB),"\n"; print "readIt filsub and filmain 
are equal\n" if (*FILSUB eq *FILMAIN); return 
$len = sysread(*FILSUB,$buf="",$blksize);}; 

When I run the above I get the following output from various print 
statements:--- snip TIEHANDLE calledOPEN c:\a.txt: 
countRecs=11Main 1 before sysread 1 filmain=*main::FILMAIN ref=GLOBREAD 
enteredMain 2 after first sysreadreadIt 
filsub=*main::FILMAIN ref=GLOBreadIt filsub and filmain are 
equalREAD enteredMain 3 after sysread 2CLOSE called
--- snip The READ routine in the handler is called correctly 
from the main routine. However, when I call it from the readIt subroutine then 
'nothing' happens. (If I substitute FILEMAIN for FILESUB in readIt then it works 
of course). There appears to be a logical difference between the tied FILMAIN 
and the passed FILSUB, even though they 'point' to the same thing. I guess I 
really don'tunderstand what is Tied. I know TISMTOWTDI, however, I have 
tried the complete Heinz 57 varieties of passed referenced and dereferenced 
variables.All have failed.After I get this example working I can 
modFTP::Net to accept tied Filehandles.Can anyone give me a few 
pointers? I prefer them to references (C background, you know)Paul 
Cotterwww.powermagic.net


Re: mirroring data across a server cluster

2001-04-02 Thread Paul Cotter


[OT] - but...

Do not throw out database replication as a solution. Trying to maintain
synchronicity across multiple databases is not a trivial task. You have to
cope with single point failure at the transaction level, (eg the server
'one' update works, but server 'two' fails) clashes (same record updated
differently on two servers.) communication failures between servers, single
server maintenance, 'non-authorized' updates toa single server and so on.

Event simplistic methods such as replacing all updates with stored
procedures that can update across multiple data-bases (eg Oracle Sybase etc)
will have problems. If you wish to separate the servers geographically then
loss of network will cause problems unless you adopt a store-and-forward
basis.

One method that has a reasonable level of success is a transaction log
analyser. Updates (as opposed to reads) are applied to a single server and
the transaction log analyser applies them to the other servers. However, for
ease of creation and maintenance a publish-and-subscribe replication system
is easiest. Remember that only certain data need be replicated. I have tried
in the past to extract to cached flat files for performance. At the end of
the day it is usually cheaper to go out and buy more hardware.

 This is important when clustering for redundancy purposes,

 I'm trying to address 2 issues:

 A. Avoiding a single point of failure associated with a
having a central repository for the data, such as a NFS
share or a single database server.
 B. Avoiding the overhead from using heavyweight tools like
database replication.

 So I've been thinking about how to pull that off, and I think
 I've figured out how, as long as I don't need every machine to
 have exactly the same version of the data structure at all times.

 What it comes down to is implementing 2 classes: one implements
 a daemon running on each server in the cluster, responsible for
 handling requests to update the data across the network and one
 a class usable inside mod_perl to handle local updates and inform
 other servers of updates.

 I believe I wouldn't be the only person finding something like
 this terrifically useful.  Furthermore, I see that Cache::Cache
 could be the underlying basis for those classes.  Most of the
 deep network programming is already there in Net::Daemon.

 What say y'all to something like Cache::Clustered::Server and
 Cache::Clustered::Client::* ?

   --Christopher Everett





Re: Forbidden access

2001-03-07 Thread Paul Cotter


- Original Message -
From: "Stas Bekman" [EMAIL PROTECTED]
To: "Daniel" [EMAIL PROTECTED]

  Also there's a typo:

 It has been confirmed by the original author that the typo was only in
 the email sample.

There was also a /Locatiom but I guess this was a transcription error
also.




Re: wheris @INC defined ?

2001-03-07 Thread Paul Cotter


To: "Henri Delebecque" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]

  "Henri" == Henri Delebecque [EMAIL PROTECTED] writes:

 Henri I'm a mod_perl newbie, trying to install it on an apache server
 Henri on a Digital-Unix platform.

 Henri I have succeded, with problems, to make a mod_perl lib.
 Henri Unfortunately, when I launch the apache server, it fails with
 Henri an error message telling that it can't locate Apache.pm in
@INC.
 Henri More strangely, it says that @INC contains
 Henri
/u/richm/QXZ-OSF/nsPerl5.005_03/lib/alpha-dec-osf.../webmaster/apache,
 Henri when the apache dierctory is in fact /webmaster/apache_1.3.19
 Henri (the /webmaster/apache is the operationnal version of the
server)

You can alter these in config.pm in your lib directory.




Re: wheris @INC defined ?

2001-03-07 Thread Paul Cotter


To: "Henri Delebecque" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]

  "Henri" == Henri Delebecque [EMAIL PROTECTED] writes:

 Henri I'm a mod_perl newbie, trying to install it on an apache server
 Henri on a Digital-Unix platform.

 Henri I have succeded, with problems, to make a mod_perl lib.
 Henri Unfortunately, when I launch the apache server, it fails with
 Henri an error message telling that it can't locate Apache.pm in
@INC.
 Henri More strangely, it says that @INC contains
 Henri
/u/richm/QXZ-OSF/nsPerl5.005_03/lib/alpha-dec-osf.../webmaster/apache,
 Henri when the apache dierctory is in fact /webmaster/apache_1.3.19
 Henri (the /webmaster/apache is the operationnal version of the
server)

You can alter these in config.pm in your lib directory.




Re: mod_perl startup sequence?

2001-03-06 Thread Paul Cotter
Title: mod_perl startup sequence?



From: Drew Wilson 

  To: [EMAIL PROTECTED] 
  Sent: Monday, 05 March, 2001 08:24 
  PM
  Subject: mod_perl startup sequence?
  
  I'm confused about when mod_perl loads Perl Modules. It 
  appears my perl module gets loaded twice: once when the log writes to stdout, 
  and once when the log message is written to error-log.
  I would expect my module to only get loaded once. Why 
  twice? 
  To help me trace loading, I added "print STDERR" statements to 
  my .conf file and my perl module. To my surprise, log messages go to the 
  console, and messages go the log file 30 milliseconds later. Also, the 
  Apache::Server::Starting is 1 first time through, and 0 the second time 
  through. NOTE: PerlFreshRestart is NOT defined.
  For example, this appears on my console: # .conf started at 983839924.241642, Starting = 1, ReStarting=0 
  # wierd.pm started at 983839924.274978, Starting = 1, 
  ReStarting=0 # .conf finished at 
  983839924.277637 
  And this appears in my error-log: # 
  .conf started at 983839924.285614, Starting = 0, ReStarting=0 # wierd.pm started at 983839924.292273, Starting = 0, 
  ReStarting=0 # .conf finished at 
  983839924.294823 
  Notice the difference in execution times (1st ends at 
  983839924.277637 and the 2nd one starts at 983839924.285614). 


I have a similar confusion.My httpd.conf opens with

LoadModule 
perl_module modules/mod_perl.soPerl open FIL, 
"c:\\a.txt"; print FIL "\nStart httpd.conf 
pid=$$"; close FIL;/PerlAfter starting 
Apache I have the following in c:\a.txtStart httpd.conf 
pid=2144Start httpd.conf pid=2144Start httpd.conf 
pid=2072startup.pl is also run three times.The config is win2k, 
apache 1.3.17, mod_perl 1.25. The taskmanager shows two apache.exe's running and 
two cidaemons. I could understand a fallback apache, bit I cannot see why the 
code is executed twice for the same pid.Can someone explain this 
behaviour - or tell me where I should go to read about it. 
(politely!-)TVM - Paul 
Cotter