Info required

2001-09-06 Thread Murugan K

Hi  
In the CGI  environment ,
After getting the request from the client  , based on the request  the web server 
will load the cgi2perl  module  
( may be someother name)  to act as interface between perl and Webserver.  The 
cgi2perl will get the data from perl interpreter and give back to web server.  This is 
the way it will work in cgi environment . The cgi2perl module will use the webserver 
API functions to interact with webserver.

Like that , i want to understand how internally mod_perl is working apart from generic 
explanations. Where to get all those informations.

Thanks in advance.

Regards
K.Murugan





Re: Info required

2001-09-06 Thread Stas Bekman

On Thu, 6 Sep 2001, Murugan K wrote:

 Hi
 In the CGI  environment ,

 After getting the request from the client , based on the request
 the web server will load the cgi2perl module ( may be someother name)
 to act as interface between perl and Webserver.  The cgi2perl will get
 the data from perl interpreter and give back to web server.  This is
 the way it will work in cgi environment . The cgi2perl module will use
 the webserver API functions to interact with webserver.

Ouch, my brain hurts. By cgi2perl module, do you mean a CGI script or a
perl handler? Or are you talking about something like FastCGI? Or
SpeedyCGI? I'm confused.

 Like that , i want to understand how internally mod_perl is working
 apart from generic explanations. Where to get all those informations.

See http://perl.apache.org/#docs

No offense, but based on your explanation of the problem, I suggest first
to read some basic CGI book before you dive into mod_perl.

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





Re: perl timestamps

2001-09-06 Thread Stas Bekman

On Wed, 5 Sep 2001, will trillich wrote:

 i didn't run into this until munging code via mod_perl and
 postgresql, so i figured this was a good place to ask a
 perl-generic question--if not, please point the way:

come'n will, you know that this is not a place to ask generic Perl
questions.

You've hundreds of perl lists and newsgroups to choose from:
http://lists.perl.org/.

Thank you.

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





discussing the future of Apache::Registry and friends

2001-09-06 Thread Stas Bekman

I'm about to start porting Apache::Registry and friends to 2.0, and we are
discussing this issue at [EMAIL PROTECTED], so if you aren't on this
list yet and want to influence things early, make sure that you subscribe
to the list:  [EMAIL PROTECTED] and sound your voice if you
have something interesting to say :)

The archive of the list is here:
http://marc.theaimsgroup.com/?l=apache-modperl-devr=1w=2#apache-modperl-dev

I'll post soonish an initial design spec, and then we can discuss its
merits. Meanwhile make sure that you are on the list.

thanks.

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/





sharing % across requests

2001-09-06 Thread Miroslav Madzarevic

BlankWhat is the best way to share % across multiple requests ?

I first tried with $r-notes('name'='value') but that wasn't persistent
across requests (or maybe I was doing it wrong ?).
Then I made a system to load data from database once at process ($$) startup
and then fetch it from % (module global) on every request reloading hash if
there were any changes (add, delete, I used a file modif. date as an
indicator) and it works well but:
1) it wasn't easy for me - this was my first time doing this
2) I think it could be improved by making a module and tying hash to
that class. Now I have to call a sub to see if the hash needs to be reloaded
before using it in any sub.

The main point is that a have a small subset of variables that don't change
often but are often queried.

I'm developing in HTML::Mason. tnx.




RE: sharing % across requests

2001-09-06 Thread Geoffrey Young



 -Original Message-
 From: Miroslav Madzarevic [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, September 06, 2001 10:02 AM
 To: [EMAIL PROTECTED]
 Subject: sharing % across requests
 
 
 BlankWhat is the best way to share % across multiple requests ?

it's called maintaining state - read the eagle book, chapter 5.

one common solution is Apache::Session

HTH

--Geoff



RE: sharing % across requests

2001-09-06 Thread Geoffrey Young



 -Original Message-
 From: Geoffrey Young [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, September 06, 2001 10:16 AM
 To: 'Miroslav Madzarevic'; [EMAIL PROTECTED]
 Subject: RE: sharing % across requests
 
 
 
 
  -Original Message-
  From: Miroslav Madzarevic [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, September 06, 2001 10:02 AM
  To: [EMAIL PROTECTED]
  Subject: sharing % across requests
  
  
  BlankWhat is the best way to share % across multiple requests ?
 
 it's called maintaining state - read the eagle book, chapter 5.
 
 one common solution is Apache::Session
 

sorry, I think I misread the question - the verbosity threw me.  If you 
are looking to store a datastructure on disk (such as a hash) then you
can use Storable, which allows you to serialize and deserialize your data
on demand.  Apache::Session has the ability to do the same, but it's not
entirely intuitive if you aren't already familiar with it.

there are also basic constructs like PerlSetVar and PerlAddVar, as well as
Apache::Storage...

again, sorry...

--Geoff



Re: sharing % across requests

2001-09-06 Thread darren chamberlain

Geoffrey Young [EMAIL PROTECTED] said something to this effect on 09/06/2001:
   BlankWhat is the best way to share % across multiple requests ?
  
  it's called maintaining state - read the eagle book, chapter 5.
  
  one common solution is Apache::Session
 
 sorry, I think I misread the question - the verbosity threw me.
 If you are looking to store a datastructure on disk (such as a
 hash) then you can use Storable, which allows you to serialize
 and deserialize your data on demand.  Apache::Session has the
 ability to do the same, but it's not entirely intuitive if you
 aren't already familiar with it.

Since he's using HTML::Mason, though, he has some examples of how
to use Apache::Session, and it's pretty easy to set up.  If I am
remembering correctly, many of the code examples in the Mason
docs assume you are using Apache::Session, and one of sample
handler subroutines shows how to use it.

(darren)

-- 
Never make anything simple and efficient when a way can be found to
make it complex and wonderful.



Re: sharing % across requests

2001-09-06 Thread Perrin Harkins

 sorry, I think I misread the question - the verbosity threw me.

No, I think you got it right.  He wants to share a hash between multiple
Apache children.

I recommend using either MLDBM::Sync or Cache::Cache for this.

- Perrin




Apache::MP3 error

2001-09-06 Thread Alex Porras

My setup:

- redhat 7.1
- perl 5.6.0 (original redhat rpm)
- mod_perl 1.26 (compiled)
- apache 1.3.20 (compiled)

I installed Apache::MP3 per the instructions in the docs.

perl.conf:

VirtualHost 192.168.123.100
ServerName removed
ServerAdmin removed
DefaultType text/plain
DirectoryIndex index.html
Location /songs
PerlSetVar  CacheDir/usr/tmp/mp3_cache
SetHandler  perl-script
PerlHandler Apache::MP3
/Location
/VirtualHost

httpd.conf:

# for Apache::MP3
AddType audio/mpeg mp3 MP3
AddType audio/playlist m3u M3U

startup.pl:

use MP3::Info;
use Apache::MP3;
use CGI;

I put a single MP3 in the 'songs' directory.  In what appears to be the
first request each child gets, the page pulls up fine.
However, any subsequent requests to each child result in this error in
the error_log:

[Thu Sep  6 00:51:23 2001] [error] Can't call method start_html on an
undefined value at /usr/lib/perl5/5.6.0/CGI.pm line 258.

Any ideas?

--Alex



Re: Info required

2001-09-06 Thread Ken Williams

Hi,

It sounds like you want to read the source code. =)  Download mod_perl 
(or perhaps you already have) and read the source to Apache.pm, 
mod_perl.pm, and so on, until you understand everything you want to.  Be 
warned, it's not easy reading.

There aren't many documents describing the internals of mod_perl, because 
the internals are subject to change, and the user generally shouldn't be 
concerned with what's going on there (unless they want to read the 
source).

Murugan K [EMAIL PROTECTED] wrote:

 Hi
 In the CGI  environment ,
 After getting the request from the client  , based on the request
 the web server will load the cgi2perl  module   ( may be someother
 name)  to act as interface between perl and Webserver.  The cgi2perl
 will get the data from perl interpreter and give back to web server.
 This is the way it will work in cgi environment . The cgi2perl module
 will use the webserver API functions to interact with webserver.

 Like that , i want to understand how internally mod_perl is working
 apart from generic explanations. Where to get all those informations.

 Thanks in advance.

 Regards
 K.Murugan







Redirecting protected file requests to https for authentication

2001-09-06 Thread J. J. Horner

I have what seems to be a uncommon request.

I need to write a module, or find a way, that will step in at the Authentication
phase, or rather before, determine that a password is required, return a response
that redirects to the https mode for the request, then allows authentication.

I'm doing this so that no clear text passwords pass the network and so that 
any page that doesn't require authentication can still be handled using our 
port 80 virtualhost.

basically:

http://devmachine/no_authen/ - stays port 80
https://devmachine/no_authen/ - stays port 443
http://devmachine/authen/ - redirects to 443
https://devmachine/authen/ - stays port 443 and sends 401

Any ideas?  I've seen a few that are close (Apache::AuthenURL, for instance), and
they could be changed to do what I need, but if there isn't a way already done
for specifically this, I might do it.


Comments?  How about a name for this, should it be necessary to right it?

Thanks,
JJ

-- 
J. J. Horner
H*,6d6174686c696e40326a6e6574776f726b732e636f6d
***
H*,6a6a686f726e65724062656c6c736f7574682e6e6574

Freedom is an all-or-nothing proposition:  either we 
are completely free, or we are subjects of a
tyrannical system.  If we lose one freedom in a
thousand, we become completely subjugated.

 PGP signature


Mod_Perl on AIX

2001-09-06 Thread Jim Cox

Can someone point me to the docs for compiling latest mod_perl 1.26 for apache 1.3.20
on AIX 4.3.3 using gcc.

Or if docs don't exist, or if I missed something, Just slap me.

The docs I've found result in a broken build enviromnent.  
I suspect that the problem is related to using gcc+ and not the 
distributed AIX cc. 

I just wanted to ask before I tried to modify the distributed Makefile.PL.
Expesially centz I'za perl newbi. :o 
-- 
Jim Cox (mailto:[EMAIL PROTECTED]) 
(817) 315-8134   (888) 834-7656 Toll Free
(817) 315-8253 FAX
(817) 233-8567 Mobile



Another Apache::DBI problem

2001-09-06 Thread Mauricio Herrera

Hi!

I'm running modperl 1.26 and apache 1.3.20 on a Solaris machine. I added
Apache::DBI and other DBI modules.

I added the following line to the httpd.conf line to use Apache::DBI

PerlModule Apache::DBI

Before any other DBI command as stated on the docs. Here's the error I get
at starting apache:

Syntax error on line 304 of /export/apache/conf/httpd.conf:
Can't load
'/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/DBI.so' for
module DBI: ld.so.1: /export/apache/bin/httpd: fatal: relocation error:
file /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/DBI.so:
symbol main: referenced symbol not found at
/usr/local/lib/perl5/5.6.1/sun4-solaris/DynaLoader.pm line 206.
 at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 189
BEGIN failed--compilation aborted at
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 189.
Compilation failed in require at
/usr/local/lib/perl5/site_perl/5.6.1/Apache/DBI.pm line 4.
BEGIN failed--compilation aborted at
/usr/local/lib/perl5/site_perl/5.6.1/Apache/DBI.pm line 4.
Compilation failed in require at (eval 4) line 3.

Line 304 of httpd.conf is the PerlModule Apache::DBI command.

Any ideas? 

Thanks for your help!

Mauricio




Re: Another Apache::DBI problem

2001-09-06 Thread Perrin Harkins

 Syntax error on line 304 of /export/apache/conf/httpd.conf:
 Can't load
 '/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/DBI.so' for
 module DBI: ld.so.1: /export/apache/bin/httpd: fatal: relocation error:
 file /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/DBI.so:
 symbol main: referenced symbol not found at
 /usr/local/lib/perl5/5.6.1/sun4-solaris/DynaLoader.pm line 206.
  at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 189
 BEGIN failed--compilation aborted at
 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 189.
 Compilation failed in require at
 /usr/local/lib/perl5/site_perl/5.6.1/Apache/DBI.pm line 4.
 BEGIN failed--compilation aborted at
 /usr/local/lib/perl5/site_perl/5.6.1/Apache/DBI.pm line 4.
 Compilation failed in require at (eval 4) line 3.

 Line 304 of httpd.conf is the PerlModule Apache::DBI command.

 Any ideas?

This looks like a DBI installation problem, not an Apache::DBI problem.
Does DBI work when you don't use Apache::DBI?
- Perrin




memory leaking with closures

2001-09-06 Thread Alex Krohn

Hi,

With this simple test script:

print Content-type: text/html\n\n;
my $var = 'x' x 50;
my $sub = sub { my $sub2 = sub { $var; }; };
print Done\n;

$var does not get freed, and the process grows each request. Has anyone
seen this sort of behavior and have any ideas/workarounds (besides don't
do that). 

Cheers,

Alex



Re: Another Apache::DBI problem

2001-09-06 Thread Mauricio Herrera

This looks like a DBI installation problem, not an Apache::DBI problem.
Does DBI work when you don't use Apache::DBI?
- Perrin

You are right. It gives me the same error when I try to use DBI alone:

[error] Can't load
'/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/DBI.so' for
module DBI: ld.so.1: /export/apache/bin/httpd: fatal: relocation error:
file /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/DBI/DBI.so:
symbol main: referenced symbol not found at
/usr/local/lib/perl5/5.6.1/sun4-solaris/DynaLoader.pm line 206.
 at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 189
BEGIN failed--compilation aborted at
/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm line 189.
Compilation failed in require at /export/www/perl/dbi.html line 1.
BEGIN failed--compilation aborted at /export/www/perl/dbi.html line 1.


The DBI installation went fine, I used CPAN. DBI version is 1.20. I looked
for the DBI.so and the DBI.pm files and they are in the correct paths. 

What may be the problem?

Thanks!

Mauricio




Re: Info required

2001-09-06 Thread Medi Montaseri


Maybe this abstraction do the job

mod_perl packages (or classes) binds with HTTP server process. 
Basically there is a perl interpreter loaded along with HTTP code
and running in memorythe customer of mod_perl then loads additional
perl code to alter the behavior of the HTTP server. The word 'alter' can
be replaced with 'overload' or 'override' as well. As such, this customer
would need to be aware of how the HTTP server is written. Sort of like
writing an installable device driver. 

So now that your class (or package) is loaded and running along with the
HTTP server, you can do many things, including crashing the HTTP server,
just like a bad device driver. But on a good day, your package should 
have a handler (simply a function) that will be called (invoked) when
certain events happen (an event is also a state, in which the HTTP server
is). So now the thread of control is given to your package. Now you can
do whatever. But whatever you do, you need to be in harmony with the 
rest of the HTTP cycle. And your day will end nicely, else you'll be
drinking lots coffee...just like hacking with any kernel...

Having said thatI recommend Writing Apache Modules with Perl and C
known as the 'eagle book'. See Chapter 3, 'The Apache Module Architecture
and API' and for  a quick feeling, see Figure 3-3, page 60, The Request
Loop.

Of course I'm new to mod_perl, so if Pokymon Masters find me in fault,
please train me as I want to be the best pokymon trainer...yes I got a 
four-year old...

Good luck...

On Thu, 6 Sep 2001, Ken Williams wrote:

 Hi,
 
 It sounds like you want to read the source code. =)  Download mod_perl 
 (or perhaps you already have) and read the source to Apache.pm, 
 mod_perl.pm, and so on, until you understand everything you want to.  Be 
 warned, it's not easy reading.
 
 There aren't many documents describing the internals of mod_perl, because 
 the internals are subject to change, and the user generally shouldn't be 
 concerned with what's going on there (unless they want to read the 
 source).
 
 Murugan K [EMAIL PROTECTED] wrote:
 
  Hi
  In the CGI  environment ,
  After getting the request from the client  , based on the request
  the web server will load the cgi2perl  module   ( may be someother
  name)  to act as interface between perl and Webserver.  The cgi2perl
  will get the data from perl interpreter and give back to web server.
  This is the way it will work in cgi environment . The cgi2perl module
  will use the webserver API functions to interact with webserver.
 
  Like that , i want to understand how internally mod_perl is working
  apart from generic explanations. Where to get all those informations.
 
  Thanks in advance.
 
  Regards
  K.Murugan
 
 
 
 
 

-- 
-
Medi Montaseri   [EMAIL PROTECTED]
Unix Distributed Systems EngineerHTTP://www.CyberShell.com
CyberShell Engineering
-




Re: memory leaking with closures

2001-09-06 Thread Perrin Harkins

 With this simple test script:

 print Content-type: text/html\n\n;
 my $var = 'x' x 50;
 my $sub = sub { my $sub2 = sub { $var; }; };
 print Done\n;

 $var does not get freed, and the process grows each request. Has anyone
 seen this sort of behavior and have any ideas/workarounds (besides don't
 do that).

I've commented on this before, as have others, in the context of using
Error.pm.  There is no workaround for this except don't do that.
- Perrin




RE: Mod_Perl on AIX

2001-09-06 Thread Christian Gilmore

It greatly depends upon how you built perl. If you're using the
OS-provided perl installation, you'll have to use IBM C for AIX to compile
apache/mod_perl. Also, other problems/pitfalls exist if you wish to use
mod_perl as a DSO. These problems can be overcome, but you'll need
specific versions to do so...

Regards,
Christian

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
 Behalf Of Jim Cox
 Sent: Sunday, May 06, 2001 2:07 PM
 To: [EMAIL PROTECTED]
 Subject: Mod_Perl on AIX


 Can someone point me to the docs for compiling latest
 mod_perl 1.26 for apache 1.3.20
 on AIX 4.3.3 using gcc.

 Or if docs don't exist, or if I missed something,
 Just slap me.

 The docs I've found result in a broken build enviromnent.
 I suspect that the problem is related to using gcc+ and not the
 distributed AIX cc.

 I just wanted to ask before I tried to modify the distributed
 Makefile.PL.
 Expesially centz I'za perl newbi. :o
 --
 Jim Cox (mailto:[EMAIL PROTECTED])
 (817) 315-8134   (888) 834-7656 Toll Free
 (817) 315-8253 FAX
 (817) 233-8567 Mobile





Re: memory leaking with closures

2001-09-06 Thread ___cliff rayman___

Alex Krohn wrote:

 Hi,

 With this simple test script:

 print Content-type: text/html\n\n;
 my $var = 'x' x 50;

our $var = 'x' x 50;


 my $sub = sub { my $sub2 = sub { $var; }; };
 print Done\n;

 $var does not get freed, and the process grows each request. Has anyone
 seen this sort of behavior and have any ideas/workarounds (besides don't

yes.  this is the documented behavior for closures.  the anonymous sub must
have it's own copy of $var which happens to be 500k plus perl overhead on each
invocation.


 do that).

 Cheers,

 Alex

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/





Help w/ install [ActivePerl,W2K Server,Apache 1.3.20]

2001-09-06 Thread Brice D Ruth

I'm trying to simply get Apache/mod_perl working in W2K ... I've been 
trying to follow the steps outlined in messages I've found from 
searching through archives, but it seems I'm a bit stuck.  My experience 
w/ Apache has always been in Linux or *BSD, so I'm somewhat lost when it 
comes to getting this going in W2k.

I have Apache 1.3.20 installed - the httpd.conf is vanilla - I can 
access my server by going to http://localhost/ - so all is good there.

I downloaded ActivePerl 629 (?) and it installed fine ... c:\perl\bin is 
in my path and seems to work fine.  I ran PPM and had it install 
mod_perl from theoryx5.uwinnipeg.ca - everything seemed to run fine and 
in the end it asked me where to put mod_perl.so - the path I gave was 
c:/Program Files/Apache Group/Apache/modules - I later looked here and I 
could see mod_perl.

I then added the following line to my httpd.conf:

LoadModule perl_module modules/mod_perl.so

and left everything else as it was.  I now get the following when I try 
to start Apache:

The Apache service is starting.
Failed to start the Apache service.
Note the errors or messages above, and press the ESC key to exit. 
(countdown)...

I don't see any error messages that do me any good, config test returns 
Syntax OK and the error log shows nothing.

What do I need to do?

Any help would be greatly appreciated!

Brice Ruth




Re: Help w/ install [ActivePerl,W2K Server,Apache 1.3.20]

2001-09-06 Thread Brice D Ruth



All right. I added the line 'AddModule mod_perl.c' before the 'LoadModule' 
and I got an error about not being able to add a module that's not in the 
loaded modules list, so I changed its position in the file and put it directly 
after the LoadModule perl_module modules/mod_perl.so and now I'm back to where
I was before (same error as original message).

 -Brice

Issac Goldstand wrote:
008c01c13728$76cc8920$[EMAIL PROTECTED]">
  Possible you need an AddModule mod_perl.c line in there somewhere...  I'mnot such an experienced module-user with Apache for Win32...  IssacPGP Key 0xE0FA561B - Fingerprint:7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B- Original Message -From: "Brice D Ruth" [EMAIL PROTECTED]To: [EMAIL PROTECTED]Sent: Friday, September 07, 2001 00:00Subject: Help w/ install [ActivePerl,W2K Server,Apache 1.3.20]
  
I'm trying to simply get Apache/mod_perl working in W2K ... I've beentrying to follow the steps outlined in messages I've found fromsearching through archives, but it seems I'm a bit stuck.  My experiencew/ Apache has always been in Linux or *BSD, so I'm somewhat lost when itcomes to getting this going in W2k.I have Apache 1.3.20 installed - the httpd.conf is vanilla - I canaccess my server by going to http://localhost/ - so all is good there.I downloaded ActivePerl 629 (?) and it installed fine ... c:\perl\bin isin my path and seems to work fine.  I ran PPM and had it installmod_perl from theoryx5.uwinnipeg.ca - everything seemed to run fine andin the end it asked me where to put mod_perl.so - the path I gave wasc:/Program Files/Apache G
roup/Apache/modules - I later looked here and Icould see mod_perl.I then added the following line to my httpd.conf:LoadModule perl_module modules/mod_perl.soand left everything else as it was.  I now get the following when I tryto start Apache:The Apache service is starting.Failed to start the Apache service.Note the errors or messages above, and press the ESC key to exit.(countdown)...I don't see any error messages that do me any good, config test returnsSyntax OK and the error log shows nothing.What do I need to do?Any help would be greatly appreciated!Brice Ruth








Re: Mod_Perl on AIX

2001-09-06 Thread Jim Cox


Therein lies the problem. I currently do not have the IBM supplied cc on 
the system. If the answer is to use only the IBM cc I'm not sure there will
be an answer. 

Everything else compiles fine, Apache, as well as the other modules.

Thanks.

Christian Gilmore wrote:
 
 It greatly depends upon how you built perl. If you're using the
 OS-provided perl installation, you'll have to use IBM C for AIX to compile
 apache/mod_perl. Also, other problems/pitfalls exist if you wish to use
 mod_perl as a DSO. These problems can be overcome, but you'll need
 specific versions to do so...
 
 Regards,
 Christian
 

-- 
Jim Cox (mailto:[EMAIL PROTECTED]) 
(817) 315-8134   (888) 834-7656 Toll Free
(817) 315-8253 FAX
(817) 233-8567 Mobile



Re: Another Apache::DBI problem

2001-09-06 Thread Perrin Harkins

 The DBI installation went fine, I used CPAN. DBI version is 1.20. I looked
 for the DBI.so and the DBI.pm files and they are in the correct paths.

 What may be the problem?

I don't know, but you might have more luck asking about it on the DBI list.
Or you could do some searching on Google for similar error messages.
- Perrin




RE: Mod_Perl on AIX

2001-09-06 Thread Christian Gilmore

You'll need to compile and install your own perl, then, using gcc.

Regards,
Christian

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
 Behalf Of Jim Cox
 Sent: Sunday, May 06, 2001 5:19 PM
 Cc: [EMAIL PROTECTED]
 Subject: Re: Mod_Perl on AIX
 
 
 
 Therein lies the problem. I currently do not have the IBM 
 supplied cc on 
 the system. If the answer is to use only the IBM cc I'm not 
 sure there will
 be an answer. 
 
 Everything else compiles fine, Apache, as well as the 
 other modules.
 
 Thanks.
 
 Christian Gilmore wrote:
  
  It greatly depends upon how you built perl. If you're using the
  OS-provided perl installation, you'll have to use IBM C for 
 AIX to compile
  apache/mod_perl. Also, other problems/pitfalls exist if you 
 wish to use
  mod_perl as a DSO. These problems can be overcome, but you'll need
  specific versions to do so...
  
  Regards,
  Christian
  
 
 -- 
 Jim Cox (mailto:[EMAIL PROTECTED]) 
 (817) 315-8134   (888) 834-7656 Toll Free
 (817) 315-8253 FAX
 (817) 233-8567 Mobile
 



Re: Help w/ install [ActivePerl,W2K Server,Apache 1.3.20]

2001-09-06 Thread will

At 5:00 pm -0500 6/9/01, Brice D Ruth wrote:
I'm trying to simply get Apache/mod_perl working in W2K ... I've 
been trying to follow the steps outlined in messages I've found from 
searching through archives, but it seems I'm a bit stuck.  My 
experience w/ Apache has always been in Linux or *BSD, so I'm 
somewhat lost when it comes to getting this going in W2k.

I have Apache 1.3.20 installed - the httpd.conf is vanilla - I can 
access my server by going to http://localhost/ - so all is good 
there.


you might have more luck with IndigoPerl: it comes as a bundle with 
apache and mod_perl and installs everything for you at once.

http://www.indigostar.com/indigoperl.htm

i've never used it, though...

will





Re: Help w/ install [ActivePerl,W2K Server,Apache 1.3.20]

2001-09-06 Thread Ron Savage

[Mailed to list and to individual]

Brice

I think the easiest is to install a pre-compiled Apache+mod_perl+mod_*. Start here:

http://savage.net.au/Perl.html#Configuring-Apache

Cheers
Ron Savage
[EMAIL PROTECTED]
http://savage.net.au/index.html





MLDBM::Sync usage

2001-09-06 Thread Rasoul Hajikhani

Hi all,
I am trying to use MLDBM::Sync to create persistent %hash. Has any one
used this module? I was reading the archive mail between Joshua and
Perrin and 

or do you tie/untie on every request?
yes

??

Also, I would appreciate it if someone could direct me to a code snipet
for this module.
Thanks
-r



Re: Help w/ install [ActivePerl,W2K Server,Apache 1.3.20]

2001-09-06 Thread Randy Kobes

On Thu, 6 Sep 2001, Brice D Ruth wrote:

 I'm trying to simply get Apache/mod_perl working in W2K ... I've been
 trying to follow the steps outlined in messages I've found from
 searching through archives, but it seems I'm a bit stuck.  My experience
 w/ Apache has always been in Linux or *BSD, so I'm somewhat lost when it
 comes to getting this going in W2k.

 I have Apache 1.3.20 installed - the httpd.conf is vanilla - I can
 access my server by going to http://localhost/ - so all is good there.

 I downloaded ActivePerl 629 (?) and it installed fine ... c:\perl\bin is
 in my path and seems to work fine.  I ran PPM and had it install
 mod_perl from theoryx5.uwinnipeg.ca - everything seemed to run fine and
 in the end it asked me where to put mod_perl.so - the path I gave was
 c:/Program Files/Apache Group/Apache/modules - I later looked here and I
 could see mod_perl.

 I then added the following line to my httpd.conf:

 LoadModule perl_module modules/mod_perl.so

 and left everything else as it was.  I now get the following when I try
 to start Apache:

 The Apache service is starting.
 Failed to start the Apache service.
 Note the errors or messages above, and press the ESC key to exit.
 (countdown)...

 I don't see any error messages that do me any good, config test returns
 Syntax OK and the error log shows nothing.

 What do I need to do?

Hi,
   Although it appears that you've done this OK, the two most
common causes of this error message is that Perl is not in
your PATH environment variable when starting Apache, and that
you've got a mismatch between mod_perl/Apache versions
(http://theoryx5.uwinnipeg.ca/ppmpackages/mod_perl.ppd corresponds
to apache_1.3.20). Are these two things OK for you?
   Another couple of things to check - can you load other
Apache modules? And can you run ordinary cgi Perl cgi scripts
(not under mod_perl)?
   Although it may be OK now, some time ago I had problems using
mod_perl when there were spaces in the Apache directory tree names.
If the above don't work, perhaps try reinstalling Apache to
something like C:\Apache (you shouldn't have to reinstall mod_perl -
just move mod_perl.so to the new \Apache\modules directory).

best regards,
randy kobes





ANNOUNCE: Apache::No404Proxy 0.03

2001-09-06 Thread Tatsuhiko Miyagawa

Annoucing the Apache::No404Proxy module, which serves as 404-free
HTTP proxy server! 

Note that you should be careful before really start using this...
Read the whole document!


The URL

http://bulknews.net/lib/archives/Apache-No404Proxy-0.03.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/M/MI/MIYAGAWA/Apache-No404Proxy-0.03.tar.gz
  size: 3204 bytes
   md5: 9c35ea3a8c5f8c852ccf5ac244c15b8a

--

NAME
Apache::No404Proxy - 404 Redirecting Proxy

SYNOPSIS
  # in httpd.conf
  PerlTransHandler Apache::No404Proxy # default uses ::Google

DESCRIPTION
Oops, 404 Not found. But wait..., there is a Google cache!

Apache::No404Proxy serves as a proxy server, which automaticaly detects
404 responses and redirects your browser to Google cache.

Set your browser's proxy setting to Apache::No404Proxy based server, and
it becomes 404 free now!

See also the section on RESRICTIONS FOR USE before you use this.

SUBCLASSING
Default cache archive is Google's one. Here is how you customize this.

*   Declare your URL translator class.

*   Inherit from Apache::No404Proxy.

*   Define translate() method.

That's all. Here is an example of implementation, extracted from
Apache::No404Proxy::Google.

  package Apache::No404Proxy::Google;

  use WWW::Cache::Google;
  use base qw(Apache::No404Proxy);

  sub translate {
  my($class, $uri) = @_;
  return WWW::Cache::Google-new($uri)-as_string;
  }

Define translate() method as a class method. Argument $uri is a string
that represents URI.

At last, remember to add the following line to httpd.conf:

  PerlTransHandler Apache::No404Proxy::Google

RESTRICTIONS FOR USE
READ THIS before you use this proxy, especially for the default Google
implementation.

This proxy may or may not break terms of service of Google. In fact,
Google prohibits *Automatic Query* without their permissions. See
http://www.google.com/terms_of_service.html for details.

Yes, this means you are recommended to contact staff at Google,
otherwise your IP address would be blacklisted from Google :( The one
you should get contact with is Ray Sidney, whose email addy is
[EMAIL PROTECTED]. Thanks to Ray for his kindness.

AUTHOR
Tastuhiko Miyagawa [EMAIL PROTECTED]

This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

This module comes WITHOUT ANY WARRANTY.

SEE ALSO
the Apache::ProxyPassThru manpage, the LWP::UserAgent manpage, the
Apache::No404Proxy::Google manpage



--
Tatsuhiko Miyagawa [EMAIL PROTECTED]




Re: memory leaking with closures

2001-09-06 Thread Ken Williams


___cliff rayman___ [EMAIL PROTECTED] wrote:

 Alex Krohn wrote:

 Hi,

 With this simple test script:

 print Content-type: text/html\n\n;
 my $var = 'x' x 50;

 our $var = 'x' x 50;


 my $sub = sub { my $sub2 = sub { $var; }; };
 print Done\n;

 $var does not get freed, and the process grows each request. Has anyone
 seen this sort of behavior and have any ideas/workarounds (besides don't

 yes.  this is the documented behavior for closures.  the anonymous sub
 must have it's own copy of $var which happens to be 500k plus perl
 overhead on each invocation.

I think the problem is that $var doesn't get freed even when $var and
$sub and $sub2 have all gone out of scope.  That's a perl bug for which I
can fathom no workaround.

If any of those variables are still in scope, then of course $var can't
get freed.

 -Ken



cvs commit: modperl-2.0/lib/Apache ParseSource.pm

2001-09-06 Thread dougm

dougm   01/09/06 09:40:11

  Modified:lib/Apache ParseSource.pm
  Log:
  only generate table .pm's if content has changed
  Submitted by:  Stas Bekman [EMAIL PROTECTED]
  Reviewed by:  dougm
  
  Revision  ChangesPath
  1.26  +26 -4 modperl-2.0/lib/Apache/ParseSource.pm
  
  Index: ParseSource.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- ParseSource.pm2001/09/06 05:26:52 1.25
  +++ ParseSource.pm2001/09/06 16:40:11 1.26
  @@ -410,8 +410,6 @@
   $file = $tdir/$subdir/$file;
   }
   
  -open my $pm, '', $file or die open $file: $!;
  -
   # sort the hashes (including nested ones) for a consistent dump
   canonsort(\$data);
   
  @@ -422,7 +420,7 @@
   my $version = $self-VERSION;
   my $date = scalar localtime;
   
  -print $pm EOF;
  +my $new_content =  EOF;
   package $name;
   
   # !!
  @@ -435,7 +433,31 @@
   
   1;
   EOF
  -close $pm;
  +
  +my $old_content = '';
  +if (-e $file) {
  +open my $pm, '', $file or die open $file: $!;
  +local $/ = undef; # slurp the file
  +$old_content = $pm;
  +close $pm;
  +}
  +
  +my $overwrite = 1;
  +if ($old_content) {
  +# strip the date line, which will never be the same before
  +# comparing
  +my $table_header = qr{^\#\s!.*};
  +(my $old = $old_content) =~ s/$table_header//mg;
  +(my $new = $new_content) =~ s/$table_header//mg;
  +$overwrite = 0 if $old eq $new;
  +}
  +
  +if ($overwrite) {
  +open my $pm, '', $file or die open $file: $!;
  +print $pm $new_content;
  +close $pm;
  +}
  +
   }
   
   # canonsort(\$data);
  
  
  



cvs commit: modperl-2.0/xs/tables/current/Apache FunctionTable.pm StructureTable.pm

2001-09-06 Thread dougm

dougm   01/09/06 09:41:30

  Modified:xs/tables/current/Apache FunctionTable.pm StructureTable.pm
  Log:
  sync
  
  Revision  ChangesPath
  1.17  +277 -2modperl-2.0/xs/tables/current/Apache/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/FunctionTable.pm,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- FunctionTable.pm  2001/09/06 05:16:25 1.16
  +++ FunctionTable.pm  2001/09/06 16:41:29 1.17
  @@ -2,7 +2,7 @@
   
   # !!
   # ! WARNING: generated by Apache::ParseSource/0.02
  -# !  Sun Aug 19 10:32:09 2001
  +# !  Thu Sep  6 09:45:43 2001
   # !  do NOT edit, any changes will be lost !
   # !!
   
  @@ -208,6 +208,20 @@
   ]
 },
 {
  +'return_type' = 'void',
  +'name' = 'ap_basic_http_header',
  +'args' = [
  +  {
  +'type' = 'request_rec *',
  +'name' = 'r'
  +  },
  +  {
  +'type' = 'apr_bucket_brigade *',
  +'name' = 'bb'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'apr_bucket *',
   'name' = 'ap_bucket_error_create',
   'args' = [
  @@ -554,6 +568,28 @@
   ]
 },
 {
  +'return_type' = 'apr_status_t',
  +'name' = 'ap_dechunk_filter',
  +'args' = [
  +  {
  +'type' = 'ap_filter_t *',
  +'name' = 'f'
  +  },
  +  {
  +'type' = 'apr_bucket_brigade *',
  +'name' = 'b'
  +  },
  +  {
  +'type' = 'ap_input_mode_t',
  +'name' = 'mode'
  +  },
  +  {
  +'type' = 'apr_off_t *',
  +'name' = 'readbytes'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'const char *',
   'name' = 'ap_default_type',
   'args' = [
  @@ -589,6 +625,16 @@
 },
 {
   'return_type' = 'int',
  +'name' = 'ap_directory_walk',
  +'args' = [
  +  {
  +'type' = 'request_rec *',
  +'name' = 'r'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'int',
   'name' = 'ap_discard_request_body',
   'args' = [
 {
  @@ -717,6 +763,16 @@
   ]
 },
 {
  +'return_type' = 'int',
  +'name' = 'ap_file_walk',
  +'args' = [
  +  {
  +'type' = 'request_rec *',
  +'name' = 'r'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'apr_status_t',
   'name' = 'ap_filter_flush',
   'args' = [
  @@ -1545,6 +1601,11 @@
   'args' = []
 },
 {
  +'return_type' = 'apr_array_header_t *',
  +'name' = 'ap_hook_get_map_to_storage',
  +'args' = []
  +  },
  +  {
   'return_type' = 'void',
   'name' = 'ap_hook_get_mgmt_items',
   'args' = [
  @@ -1755,6 +1816,28 @@
 },
 {
   'return_type' = 'void',
  +'name' = 'ap_hook_map_to_storage',
  +'args' = [
  +  {
  +'type' = 'ap_HOOK_map_to_storage_t *',
  +'name' = 'pf'
  +  },
  +  {
  +'type' = 'const char * const *',
  +'name' = 'aszPre'
  +  },
  +  {
  +'type' = 'const char * const *',
  +'name' = 'aszSucc'
  +  },
  +  {
  +'type' = 'int',
  +'name' = 'nOrder'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'void',
   'name' = 'ap_hook_open_logs',
   'args' = [
 {
  @@ -2019,6 +2102,28 @@
 },
 {
   'return_type' = 'apr_status_t',
  +'name' = 'ap_http_filter',
  +'args' = [
  +  {
  +'type' = 'ap_filter_t *',
  +'name' = 'f'
  +  },
  +  {
  +'type' = 'apr_bucket_brigade *',
  +'name' = 'b'
  +  },
  +  {
  +'type' = 'ap_input_mode_t',
  +'name' = 'mode'
  +  },
  +  {
  +'type' = 'apr_off_t *',
  +'name' = 'readbytes'
  +  }
  +]
  +  },
  +  {
  +'return_type' = 'apr_status_t',
   'name' = 'ap_http_header_filter',
   'args' = [
 {
  @@ -2194,6 +2299,16 @@
   ]
 },
 {
  +'return_type' = 'int',
  +'name' = 'ap_location_walk',
  +'args' = [
  +  {
  +'type' = 'request_rec *',
  +'name' = 'r'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'void',
   'name' = 'ap_log_assert',
   'args' = [
  @@ -2996,6 +3111,20 @@
   ]
 },
 {
  +'return_type' = 'int',
  +'name' = 'ap_os_is_path_absolute',
  +'args' = [
  +  {
  +'type' = 'apr_pool_t *',
  +'name' = 'p'
  +  },
  +  {
  +'type' = 'const char *',
  +'name' = 'dir'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'void',
   'name' = 'ap_parse_uri',
   'args' = [
  @@ -3222,6 +3351,16 @@
   ]
 },
 {
  +'return_type' = 'int',
  +'name' = 'ap_process_request_internal',