Re: mod_perl and 700k files...

2001-05-09 Thread Stas Bekman

On Wed, 9 May 2001, Morbus Iff wrote:

>  >> Ahhh. Ok. What's this $SIG{'USR2'} thingy. What's that do?
>  >
>  >http://perl.apache.org/guide
>
> Well, that's all fine and dandy, and I've gone through there before, but
> the only thing the search engine brings up concerning USR2 is:
>
>>The above code asigns a signal handler for the USR2 signal.
>>This signal has been chosen because it's least likely to be
>>used by the other parts of the server.
>
> That, unfortunately doesn't tell me what causes a USR2 signal to be sent to
> Apache. Or when it's caused. I only want to reload the file when said file
> has changed. Am I supposed to do some checking against the file -M time
> myself, and then send a USR2 signal myself?

You didn't search the guide, even if you try to make everyone believe that
you did, and starting a thread that was documented long time ago (I'm
talking about using USR2, not the caching technique). The first hit in the
search gives:
http://thingy.kcilink.com/modperlguide/debug/Using_the_Perl_Trace.html
which is exactly what you need.

Your question about reloading something from within the code is answered
here:
http://perl.apache.org/guide/porting.html#Configuration_Files_Writing_Dy
and here:
http://perl.apache.org/guide/porting.html#Using_Apache_Reload

Hope this helps.

_
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: Throwing die in Apache::Registry

2001-05-09 Thread Mark Maunder

Thanks Tom.

Yeah for XML::Parser line 236 perhaps we can get Clark (Current maintainer
according to POD) to change it to
return undef if $err;

Mark.
ps: I'll check that rule (tommorow. ..must...have...sleep..)

Tom Harper wrote:

> Mark--
>
> While you may be having problems with segfaults because
> of expat = yes rule--  i was having similar problems
> with XML parser relating to the the die statement.
>
> I do the same thing as far as eval'ing the parsefile
> call.  Also, I removed the die statement from parser.pm
> (v 2.29 line 240 or so) so it would return a useful error
> message rather than just die uninformatively.
>
> Maybe this is what you were asking about?
>
> Tom
>
> At 09:19 AM 5/4/01 +0100, Matt Sergeant wrote:
> >On Fri, 4 May 2001, Perrin Harkins wrote:
> >
> >> on 5/4/01 9:28 AM, Mark Maunder at [EMAIL PROTECTED] wrote:
> >> > I have an Apache::Registry script that is using XML::Parser. The
> parser throws
> >> > a
> >> > 'die' call if it encounters a parse error (Why?).
> >>
> >> Because it's an exception and the parser can't continue.
> >>
> >> > I was handling this by
> >> > putting
> >> > the code in an eval block, but this no longer works since all Registry
> scripts
> >> > are already in one huge eval block.
> >>
> >> It should still work.  An eval{} is scoped like any other block.  Maybe you
> >> have a typo?  Post your code and we'll look at it.
> >
> >More likely is a b0rked $SIG{__DIE__} handler, like fatalsToBrowser. Yick.
> >
> >--
> >
> >
> >/||** Founder and CTO  **  **   http://axkit.com/ **
> >   //||**  AxKit.com Ltd   **  ** XML Application Serving **
> >  // ||** http://axkit.org **  ** XSLT, XPathScript, XSP  **
> > // \\| // ** mod_perl news and resources: http://take23.org  **
> > \\//
> > //\\
> >//  \\
> >

--
Mark Maunder
[EMAIL PROTECTED]
http://swiftcamel.com/

 Try not.
 Do.
 Or do not.
 There is no try.
 ~yoda





Re:mod_perl and 700k files...

2001-05-09 Thread Mike Miller

On Wednesday, May 09, 2001, Morbus Iff wrote the
following about "mod_perl and 700k files..."

MI>  >Keep in mind, if you load this data during startup (in the parent) it will
MI>  >be shared, but reloading it later will make a separate copy in each child,
MI>  >chewing up a large amount of memory.  You might have better luck using dbm

MI> That is something I was hoping I wouldn't here ;) ... Even reloading the 
MI> file into the same variable in my startup.pl wouldn't cause the parent to 
MI> share it with new children?

Has anyone suggested (I am jumping in late) a shared memory segment a
la IPC::ShareLite, etc.

Best Regards,

Mike Miller
[EMAIL PROTECTED]




Re: mod_perl and 700k files...

2001-05-09 Thread Morbus Iff

>> Ultimately, I'm looking for something I can do totally from within Perl.
>
>Couldn't you create a Perl script to run as a cron job that could stat
>the file off-line for you and HUP the server when it has changed?
>That would seem easy enough.  You'd just have to work out the perms on
>the cron user to make sure it could affect httpd.  Restarting Apache
>isn't the end of the world, is it?

Well, it's a big deal if you've no "in" with the place you're webhosting
with, sure... No one wants to be told that some lowly customer wants to
restart the server that's running 200 other vhosts...

Granted, I work at the damn webhost, but it's gotten to the point where all
the gizmo's and crap I've added have slowly been dipping the "stop touching
the server, you feature freak" - I'd rather not stress the relationship.

-- 
  ICQ: 2927491  /  AOL: akaMorbus
   Yahoo: morbus_iff/  Jabber: [EMAIL PROTECTED]
   [EMAIL PROTECTED]   /   http://www.disobey.com/



Re: mod_perl and 700k files...

2001-05-09 Thread Ken Y. Clark

On Wed, 9 May 2001, Morbus Iff wrote:

> Date: Wed, 09 May 2001 17:45:03 -0400
> From: Morbus Iff <[EMAIL PROTECTED]>
> To: Perrin Harkins <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: mod_perl and 700k files...
>
> Ok. Thanks for the replies everybody. Collectively, I'm looking for a
> solution that DOES NOT require an Apache restart, or one that requires me
> to use a kill/killall command. I'm not in front of the server 100%, and I
> won't have access to telnet/ssh in to issue commands.
>
> Ultimately, I'm looking for something I can do totally from within Perl.

Couldn't you create a Perl script to run as a cron job that could stat
the file off-line for you and HUP the server when it has changed?
That would seem easy enough.  You'd just have to work out the perms on
the cron user to make sure it could affect httpd.  Restarting Apache
isn't the end of the world, is it?

ky




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.exe
 $Apache::Server::SaveConfig = 1;
__END__


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: mod_perl and 700k files...

2001-05-09 Thread Morbus Iff

Ok. Thanks for the replies everybody. Collectively, I'm looking for a 
solution that DOES NOT require an Apache restart, or one that requires me 
to use a kill/killall command. I'm not in front of the server 100%, and I 
won't have access to telnet/ssh in to issue commands.

Ultimately, I'm looking for something I can do totally from within Perl.

 >You might have better luck just having your app check -M against the file
 >and reload as needed.  If you don't want to take the hit on every request,
 >you can just use a counter or a "last checked" time kept in a global, and
 >check every 10 minutes or 100 requests or whatever.

 From various other posts, I'm understanding that I can do what I want by 
defining a subroutine in my startup.pl that would reload the file, and then 
I could call that subroutine whenever I determine the file is out of date 
(either through a cache, request, or -M system)...

 >Keep in mind, if you load this data during startup (in the parent) it will
 >be shared, but reloading it later will make a separate copy in each child,
 >chewing up a large amount of memory.  You might have better luck using dbm

That is something I was hoping I wouldn't here ;) ... Even reloading the 
file into the same variable in my startup.pl wouldn't cause the parent to 
share it with new children?


Morbus Iff
.sig on other machine.
http://www.disobey.com/
http://www.gamegrene.com/




Re: mod_perl and 700k files...

2001-05-09 Thread Tim Tompkins

kill -s USR2 {process id}

see: man kill
see also: man killall

This is just one way to handle it.  It, of course, requires that you
manually send the signal to the process when your data file has changed.
Using this method eliminates the need to stat() the datafile with each
request to see if it has changed.  You surely will not want to base your
stat on -M, as that will certainly vary over time.  Instead, you'd want to
base on (stat)[9].  Remember though, this will have the overhead of
stat()ing the file with each FETCH(), but at least it won't have the
overhead of loading and parsing the file with each request.

For example:

package My::AutoData;

use strict;
use vars qw($MOD_TIME,$DATA_FILE,%DATA);

$DATA_FILE = "/path/to/data/file.dat";
$MOD_TIME =  (stat($DATA_FILE))[9];

sub FETCH {
  load_data() unless %DATA;
  load_data() if ($MOD_TIME != (stat($DATA_FILE))[9]);

  # continue with code to return requested data

}

sub load_data {
# insert code to parse data file and assign to global %DATA
}

1;
__END__



I am assuming this would work, I've not tested it.


Thanks,

Tim Tompkins
--
Staff Engineer / Programmer
http://www.arttoday.com/
--


- Original Message -
From: "Morbus Iff" <[EMAIL PROTECTED]>
To: "G.W. Haywood" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, May 09, 2001 2:14 PM
Subject: Re: mod_perl and 700k files...


> >> Ahhh. Ok. What's this $SIG{'USR2'} thingy. What's that do?
>  >
>  >http://perl.apache.org/guide
>
> Well, that's all fine and dandy, and I've gone through there before, but
> the only thing the search engine brings up concerning USR2 is:
>
>>The above code asigns a signal handler for the USR2 signal.
>>This signal has been chosen because it's least likely to be
>>used by the other parts of the server.
>
> That, unfortunately doesn't tell me what causes a USR2 signal to be sent
to
> Apache. Or when it's caused. I only want to reload the file when said file
> has changed. Am I supposed to do some checking against the file -M time
> myself, and then send a USR2 signal myself?
>
>
> Morbus Iff
> .sig on other machine.
> http://www.disobey.com/
> http://www.gamegrene.com/
>
>




RE: mod_perl and 700k files...

2001-05-09 Thread Rob Bloodgood

> That, unfortunately doesn't tell me what causes a USR2 signal to
> be sent to
> Apache. Or when it's caused. I only want to reload the file when
> said file
> has changed. Am I supposed to do some checking against the file -M time
> myself, and then send a USR2 signal myself?

USR2 only fires when you do it yourself, e.g.
kill -USR2 `cat /var/run/httpd.pid`
or under linux
killall -USR2 httpd

However, if you want to change based on mod time, then one way to do it
would be as follows (THIS CODE IS UNTESTED!!!).

in the handler/CGI that USES the 700k doc:

my $big_doc = My::get_big_doc();

and in startup.pl you can say:

package My;

my $big_doc = undef;
my $mod_time = 0;

my $big_file = '/path/to/big/file';

sub get_big_doc {

if (defined $big_doc and -M $big_file < $mod_time) {
return $big_doc;
} # implicit else

($big_doc, $mod_time) = some_complex_operation();

return $big_doc;

}

sub some_complex_operation {

# read in $big_doc and its $mod_time

return ($big_doc, $mod_time);
}

HTH!

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





Re: mod_perl and 700k files...

2001-05-09 Thread ___cliff rayman___

Morbus Iff wrote:

>  >> Ahhh. Ok. What's this $SIG{'USR2'} thingy. What's that do?
>
> has changed. Am I supposed to do some checking against the file -M time
> myself, and then send a USR2 signal myself?
>

yes.  this method assumes that the administrator of apache has made
a change to a file and now wants to reload it.  this is how some unix
services work such as named and inetd.  you modify the config
files and send a kill -HUP to the daemon.  in this case you would do:
kill -USR2 `cat /path/to/apache/logs/httpd.pid`

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





Re: mod_perl and 700k files...

2001-05-09 Thread Perrin Harkins

on 5/9/01 5:14 PM, Morbus Iff at [EMAIL PROTECTED] wrote:
> That, unfortunately doesn't tell me what causes a USR2 signal to be sent to
> Apache.

You can use the kill command to send a USR2 signal.

> Or when it's caused.

When you send it.

> I only want to reload the file when said file
> has changed. Am I supposed to do some checking against the file -M time
> myself, and then send a USR2 signal myself?

You might have better luck just having your app check -M against the file
and reload as needed.  If you don't want to take the hit on every request,
you can just use a counter or a "last checked" time kept in a global, and
check every 10 minutes or 100 requests or whatever.

Keep in mind, if you load this data during startup (in the parent) it will
be shared, but reloading it later will make a separate copy in each child,
chewing up a large amount of memory.  You might have better luck using dbm
files or something similar that doesn't need to keep the whole thing in
memory at once.

- Perrin




Re: mod_perl and 700k files...

2001-05-09 Thread Ken Y. Clark

On Wed, 9 May 2001, Morbus Iff wrote:

> Date: Wed, 09 May 2001 17:14:10 -0400
> From: Morbus Iff <[EMAIL PROTECTED]>
> To: G.W. Haywood <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: mod_perl and 700k files...
>
>  >> Ahhh. Ok. What's this $SIG{'USR2'} thingy. What's that do?
>  >
>  >http://perl.apache.org/guide
>
> Well, that's all fine and dandy, and I've gone through there before, but
> the only thing the search engine brings up concerning USR2 is:
>
>>The above code asigns a signal handler for the USR2 signal.
>>This signal has been chosen because it's least likely to be
>>used by the other parts of the server.
>
> That, unfortunately doesn't tell me what causes a USR2 signal to be sent to
> Apache. Or when it's caused. I only want to reload the file when said file
> has changed. Am I supposed to do some checking against the file -M time
> myself, and then send a USR2 signal myself?
>
>
> Morbus Iff
> .sig on other machine.
> http://www.disobey.com/
> http://www.gamegrene.com/
>

Well, here's an idea that I've used before, though this will only
cache the data in each child and not when the parent starts up.
Still...  Here's pseudo-code version of my idea:

package Foo;

use strict;

use vars qw[ %CACHE ];
%CACHE = ();

use constant EXPIRES  => 60*5; # five minutes

sub handler {
my $r = shift;

my $expires = $CACHE{'expires'} || 0;

if ( $expires < time ) {
#
# stat the file, figure out when it was changed
#
my $mtime = ...

if ( $mtime > $CACHE{'mtime'} ) {
#
# get your new data here
#
$CACHE{'data'}  = ...
$CACHE{'mtime'} = $mtime;
}

#
# reset CACHE's expire time
#
$CACHE{'expires'} = time + EXPIRES;
}

$r->print( $CACHE{'data'} );

return OK;
}

You see that my idea is to eliminate stat'ing the file on every
request by caching data for at least 'x' amount of time.  Then when
the data expires, stat the file and reload only if it has changed.
Again, this means each child maintains its own cache, but it might not
be that bad (?).

ky




Re: mod_perl and 700k files...

2001-05-09 Thread G.W. Haywood

Hi again,

On Wed, 9 May 2001, Morbus Iff wrote:

>  >> Ahhh. Ok. What's this $SIG{'USR2'} thingy. What's that do?
>  >
>  >http://perl.apache.org/guide
> 
> Well, that's all fine and dandy, and I've gone through there before, but 
> the only thing the search engine brings up concerning USR2 is:
> 
>>The above code asigns a signal handler for the USR2 signal.
>>This signal has been chosen because it's least likely to be
>>used by the other parts of the server.

Look again.

Get the source, go to the directory which contains all the .pod
files and type

grep USR2 * | less -S

or something similar.

(Or you could just read it. :)

73,
Ged.





Re: mod_perl and 700k files...

2001-05-09 Thread Morbus Iff

 >> Ahhh. Ok. What's this $SIG{'USR2'} thingy. What's that do?
 >
 >http://perl.apache.org/guide

Well, that's all fine and dandy, and I've gone through there before, but 
the only thing the search engine brings up concerning USR2 is:

   >The above code asigns a signal handler for the USR2 signal.
   >This signal has been chosen because it's least likely to be
   >used by the other parts of the server.

That, unfortunately doesn't tell me what causes a USR2 signal to be sent to 
Apache. Or when it's caused. I only want to reload the file when said file 
has changed. Am I supposed to do some checking against the file -M time 
myself, and then send a USR2 signal myself?


Morbus Iff
.sig on other machine.
http://www.disobey.com/
http://www.gamegrene.com/




Re: mod_perl and 700k files...

2001-05-09 Thread G.W. Haywood

Hi there,

On Wed, 9 May 2001, Morbus Iff wrote:

> Ahhh. Ok. What's this $SIG{'USR2'} thingy. What's that do?

http://perl.apache.org/guide

73,
Ged.




Re: mod_perl and 700k files...

2001-05-09 Thread Morbus Iff

At 04:24 PM 5/9/01, Robert Landrum wrote:
 >At 3:51 PM -0400 5/9/01, Morbus Iff wrote:
 >>** The 700k file is an XML file, read in by XML::Simple. XML::Simple
 >>can cache that file into memory. Is this how I should do it? Or
 >>should I load the file from my startup.pl script so that the file is
 >>shared amongst all the apache children? If that's the case, how
 >>would I dynamically reload it?
 >
 >Basically, I loaded the file into $My::Data via the startup.pl.
 >
 >Then I did a
 >$SIG{'USR2'} = sub {
 >  open(FILE,'file');
 >  $My::Data = process_file(\*FILE);
 >  close(FILE);
 >};

Ahhh. Ok. What's this $SIG{'USR2'} thingy. What's that do?


Morbus Iff
.sig on other machine.
http://www.disobey.com/
http://www.gamegrene.com/




Re: mod_perl and 700k files...

2001-05-09 Thread Robert Landrum

At 3:51 PM -0400 5/9/01, Morbus Iff wrote:
>** The 700k file is an XML file, read in by XML::Simple. XML::Simple 
>can cache that file into memory. Is this how I should do it? Or 
>should I load the file from my startup.pl script so that the file is 
>shared amongst all the apache children? If that's the case, how 
>would I dynamically reload it?
>


I've done similar things

Basically, I loaded the file into $My::Data via the startup.pl.

Then I did a
$SIG{'USR2'} = sub {
open(FILE,'file');
$My::Data = process_file(\*FILE);
close(FILE);
};


Rob

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



mod_perl and 700k files...

2001-05-09 Thread Morbus Iff

Hey there, wondering if anyone could help me with this.

I'm relatively new to mod_perl... I've got a 700k file that is loaded each 
time I run a CGI script, so I'm hoping to cache the file using mod_perl 
somehow. The file will change occasionally (maybe once a week) - the reload 
of a few seconds isn't worrisome, but it has to be done without restarting 
the server.

Any suggestions on exactly the best way to do this? I've going to:

  - PerlSetupEnv Off
  - PerlModule and PerlRequre
  - Remove buffering.
  - Cache from XML::Simple **

** The 700k file is an XML file, read in by XML::Simple. XML::Simple can 
cache that file into memory. Is this how I should do it? Or should I load 
the file from my startup.pl script so that the file is shared amongst all 
the apache children? If that's the case, how would I dynamically reload it?



Morbus Iff
.sig on other machine.
http://www.disobey.com/
http://www.gamegrene.com/




FW: authorization and mod_perl

2001-05-09 Thread Rob Bloodgood

I had intended this to CC: to the list... 




> 
>   AuthName"foo control"
>   AuthTypeBasic
>   PerlAuthenHandlerApache::OK
>   PerlAuthzHanlderWW_authz
>   PerlSetVarMaskGeek
>   requireusermaskgeeky
> 

I have a similar setup, and my directory/authentication block is as follows:


DirectoryIndex stats.html

PerlAuthenHandler +Apache::AuthenCache +Stat::Auth
Apache::AuthenCache::manage_cache

# AuthenCache Directives
PerlSetVar AuthenCache_Encrypted Off
# AuthenCache Directives

AuthName "Stats (Your username is your Account ID)"
AuthType Basic
require valid-user

Options +Includes

ErrorDocument 403 /error/loginfail.html



As listed, every path under /reports is subject to authentication.
Naturally, auth in a SUBDIRECTORY can be overridden:


# Makes this directory globally accessible
# in spite of its parent and siblings still
# falling under the above listed AUTH handling.
PerlAuthenHandler Apache::OK


HTH!

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





Re: authorization and mod_perl

2001-05-09 Thread will trillich

On Wed, May 09, 2001 at 10:10:19AM -0500, John Saylor wrote:
> Perhaps this is obvious, or said somewhere that I haven't looked; but
> I'm having trouble figuring it out.

it feels like "everything is obvious to everyone but me" doesn't
it? :)

> What I want is for a certain directory tree to be behind an
> authorization handler; however, the content behind this directory tree
> consists of handlers and aliases. And the authentication handler isn't
> working with  directives.
> 
> 
>   AuthName"foo control"
>   AuthTypeBasic
>   PerlAuthenHandlerApache::OK
>   PerlAuthzHanlderWW_authz
>   PerlSetVarMaskGeek
>   requireusermaskgeeky
> 

presumably that's a typo: PerlAuthzHanlder ? (always a good idea
to cut and paste from the actual source or actual output.)

> I don't think it's even getting called.
> 
> Do I need to push the code as a PerlChildInitHandler?

i wouldn't think so.

> Should I create the [empty] root directory in the htdocs tree as a place
> holder for a  directive?

i tried that just to see, and it caused more trouble than it
solved...

> Is there some syntax error in my  block?

as is in your email, there is a typo: Hanlder ...

> Should it work OK [I cribbed most of it from the eagle book]?

i used the Apache::Ticket examples and learned that i needed to
modify them for my purposes, but it worked with 
directives just fine, WITHOUT an empty directory to match. (in
fact, creating such an empty directory interfered in a big way.)

# TICKET / COOKIE stuff
# restricted area needing ticket access

SetHandler perl-script

# handle content-generation (if we get in)
PerlHandler +My::Handler

# arewe allowed in?
PerlAccessHandler Apache::TicketAccess
PerlSetVar TicketDomain   .testing-this-monster.com
PerlSetVar TicketLogin http://www.testing-this-monster.com/login


# TICKET server

SetHandler perl-script
PerlHandler +Apache::TicketMaster
PerlSetVar TicketDomain   .testing-this-monster.com
PerlSetVar TicketExpires  20


# KEY server


order allow,deny
allow from 192.168.1
allow from 127.0.0.1
deny from all



-- 
don't visit this page. it's bad for you. take my expert word for it.
http://www.salon.com/people/col/pagl/2001/03/21/spring/index1.html

[EMAIL PROTECTED]
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!



Perl Sections: command_rec for directive `ISA' not found!

2001-05-09 Thread Jonathan Hilgeman

Seeing that nobody answered your question or posted the answer, I had to
overcome this same problem. The problem was the Perl libraries that were
installed (or not installed). You need to reinstall / install the
Bundle::DBI package and the correct modules for it. In my case, I was trying
to dynamically build VirtualHost directives from a mySQL database. I
telnetted/ssh to the shell and typed the following:

su-2.04#  perl -MCPAN -e shell

cpan> install Bundle::DBI

< Bundle gets installed >

cpan> install Msql-Mysql-modules-1.2216.tar.gz

< Package starts installing >

When it asked me if I wanted mSQL, mySQL, or both, I chose mySQL only. 
It asked me where the subdirectory with the include files was, and it
defaulted to /usr/local. This caught me off-guard because mySQL was actually
installed in /usr/local/mysql and so I kept putting that directory, but it
kept failing. When I tried reinstalling, I left it at /usr/local and it went
through fine. 

Now that the packages are installed, I had one more error to fix. In the
 section, I had:

$dbh = DBI->connect('DBI:mysql: ..blah..blah...');

which had to be changed to 

my $dbh = DBI->connect('DBI:mysql: ..blah..blah...');

Otherwise, Apache will not recognize the variables and will return an error
about commands and stuff.

Hope this helps!

Jonathan Hilgeman



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

2001-05-09 Thread David Lanzarote García

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..




authorization and mod_perl

2001-05-09 Thread John Saylor

Hi

Perhaps this is obvious, or said somewhere that I haven't looked; but
I'm having trouble figuring it out.

What I want is for a certain directory tree to be behind an
authorization handler; however, the content behind this directory tree
consists of handlers and aliases. And the authentication handler isn't
working with  directives.


  AuthName"foo control"
  AuthTypeBasic
  PerlAuthenHandlerApache::OK
  PerlAuthzHanlderWW_authz
  PerlSetVarMaskGeek
  requireusermaskgeeky


I don't think it's even getting called.

Do I need to push the code as a PerlChildInitHandler?
Should I create the [empty] root directory in the htdocs tree as a place
holder for a  directive?
Is there some syntax error in my  block?
Should it work OK [I cribbed most of it from the eagle book]?

Any comments, suggestions, pointers, or non sequitors appreciated.

--
\js [your ad here]



Re: [OT] 128 bit encryption and IE

2001-05-09 Thread Christoph Wernli

Geoffrey Young wrote:
> 
> unfortunately, the client has a requirement that _only_ 128 bit be allowed.
> I think, though, that I may be able to use your suggestion to at least show
> a page saying that an upgrade to 128 is required.

Another approach lies here:
 - although it won't 
work
with all browser.

-Christoph
 S/MIME Cryptographic Signature


Re: capturing subrequest output (have things changed)

2001-05-09 Thread Chris Strom

"Anand Raman" <[EMAIL PROTECTED]> writes:

> hi guys
> I just started off using modperl so excuse me if this has been answered.
> 
> Is there a way to capture output from a subrequest.. rather than
> allowing the subrequest to directly output the response to the client
> browser. 
> 
> I need to be able to parse the output of the subrequest before
> outputting it to the browser.

Are you trying to do something like:

http://perl.apache.org/guide/modules.html#Apache_OutputChain_Chain_Sta 

or 

http://perl.apache.org/guide/modules.html#Apache_Filter_Alter_the_outpu

Apologies if you've already read the guide, but it sounds as if you might
be able to make use of this for what you're trying to do.