Re: the coming of Apache 2.0

2002-04-05 Thread sterling

On Fri, 5 Apr 2002, Chuck Goehring wrote:

> The modssl-users list is all abuzz about the coming of Apache 2.0.  I 
> don't hear a lot on this list on mod_perl support for Apache 2.0.  Is 
> anyone planning to adopt this configuration in the near future?

http://perl.apache.org/~dougm/modperl_2.0.html

sterling




Re: Authorization question and subdirectories

2001-05-16 Thread sterling

On 16 May 2001, Chris Strom wrote:

> Mike Cameron <[EMAIL PROTECTED]> writes:
> 
> > Is it possible to have the same PerlAuthzHandler use different require's
> > 
> > on a subdirectory once a user has been authorized for a parent
> > directory? Here is what i would like to be acle to do:
> > 
> > 
> > SetHandler perl-script
> > AuthType MyAuth
> > AuthName MyAuth
> > PerlAuthenHandler MyAuth->authenticate
> > PerlAuthzHandler MyAuth->authorize
> > require valid-user
> 
> How about:
> 
> require valid-user administrator
> 



no - he just wants valid-user for the root location



> > 
> 
> shouldn't this be ?  
> 


no.



sterling




Re: Authentication using NIS

2001-05-15 Thread sterling

On 15 May 2001, qazi Ahmed wrote:

> Hi Gurus..
> I have got modperl installed on my system.
> When i check the error_log file, it shows that apache_1.3.19 installed mod_perl-1.25 
>installed.
> Now in httpd.conf  i write the 
> 
> 
> PerlRequire /../../../../startup.pl
> 

do you mean ? or do you actually have an alias to /guts on
your filesystem, plus the PerlRequire seems a bit whacky (/..?)

sterling



> AuthName NISAuthentication
> AuthType Basic
> PerlAuthenHandler  Apache::AuthenNIS
> require valid-user
> 
> 
> When i browse for the index.html present in guts it is not asking for 
>authentication, and just displaying the page.
> I dont know whether the Apache::AuthenNIS handler is being called or not, but the 
>server gets started without any errors.
> 
> Any hints
> Thanks and Regards
> Qazi
> 
> 
> _
> Chat with your friends as soon as they come online. Get Rediff Bol at
> http://bol.rediff.com
> 
> 
> 
> 




Re: modperl security model question

2001-04-15 Thread sterling

On Sun, 15 Apr 2001, Thomas K. Burkholder wrote:

> Thanks again for the help - I have another one-
> 
> My application consists of perl modules with file permissions set only
> to a particular user 'burkhold'.  The database password is kept in
> plaintext in one of those modules.  I use the User: and Group:
> directives in access.conf to cause the uid of the spawned httpd process
> to have permission to execute the code.  It works fine, except that it
> seems I can't embed 'User: burkhold' inside a  directive, so
> all requests have to be served as 'burkhold'.  It seems like there
> should be some simple way in apache to specify what user the httpd
> should be set to when it's spawned, but except for the global User: I
> haven't found a way.
> 

An httpd process is spawned to handle _all_ locations, that is why the
Group/User can only be specified per server.  If apache was able to spawn
separate processes to only handle one location, your suggestion would
work.  

The only solution i would offer would be to proxy all requests to
that location to another apache server, running on a different port,
as user bukhold. The main server could then run with whatever user is 
appropriate, and have a ProxyPass directive to forward requests requiring 
user burkhold.


sterling




> If I can't make this work, I may have to turf module handlers and go
> with a Registry and setuid solution, which I think would be a shame
> since I think handlers are a lot more elegant.
> 
> This is probably well-trodden territory - anyone got a solution?
> 
> Thanks again, several of you have been helpful to me, and I do
> appreciate it.
> 
> Happy Easter.
> 
> //Thomas
> Thomas K. Burkholder
> [EMAIL PROTECTED]
> 




Re: [OT] ApacheCon BOF

2001-03-20 Thread sterling

On Mon, 19 Mar 2001, Drew Taylor wrote:
>
snip..

> won't be there this year. Speaking of which, will the mod_perl classes have
> the handouts available over the web?
> 

i know doug's been updating his:
http://perl.apache.org/~dougm/modperl_2.0.html

sterling




Re: mod_perl.c:517: unterminated string or character constant

2001-03-12 Thread sterling

actually - with recent changes to the apache core, that patch doesn't work
any more.  we're working on a real fix - but in the mean time this one may
as well be removed.


sterling
_

Index: src/modules/perl/mod_perl.c
===
RCS file: /home/cvspublic/modperl/src/modules/perl/mod_perl.c,v
retrieving revision 1.135
diff -u -r1.135 mod_perl.c
--- src/modules/perl/mod_perl.c 2001/02/16 23:30:27 1.135
+++ src/modules/perl/mod_perl.c 2001/03/13 00:18:07
@@ -509,18 +509,6 @@
 { 
 array_header *librefs;
 
-#ifdef WIN32
-// This is here to stop a crash when bringing down
-// a service.  Apparently the dso is unloaded too early.
-// This if statement tests to see if we are running as a 
-// service. apache does the same
-// see apache's isProcessService() in service.c 
-if (AllocConsole()) {
-FreeConsole();
-return;
-} 
-#endif
-
 librefs = xs_dl_librefs((pool *)data);
 perl_shutdown(NULL, NULL);
 unload_xs_so(librefs);




Re: Mod_perl and Apache 2.0

2001-02-28 Thread sterling

Well, from the looks of the cvs commits, doug seems to be compiling
mod_perl under apache 2.0 quite regularly :)  With the complete rewrite
there's been plenty of work to do.

The word on it is here:
http://perl.apache.org/~dougm/modperl_2.0.html

its still in heavy development by doug - i would say the best thing to do
is watch the commits if you want to keep up with it.

sterling


On Wed, 28 Feb 2001, Jeffrey A. Stuart wrote:

> Has anyone tried compiling mod_perl under apache 2.0?  Also, what is the
> word on mod_perl 2.0?
> 
> --
> Jeff Stuart
> [EMAIL PROTECTED]
> 







Re: Is it Apache or me?

2001-02-25 Thread sterling

if you set a handler for / it will handle every request that way.
you can either have all pages that are generated be /foo/ and set 
that as the location, or you can force all files with a certain
suffix to be handled by mod_perl: .


sterling

On Sun, 25 Feb 2001, Jamie Krasnoo wrote:

> I'm not quite sure how this works, and maybe I missed it in the Eagle book.
> I have a handler set in httpd.conf like this:
> 
> 
>   Set-Handler perl-script
>   PerlHandler app::main
> 
> 
> Now this works great when I want to go to the first page of the server.
> However if I try to go to a static page, that page gets intercepted and the
> app::main goes in to action. The handler doesn't intercept any of the other
> set locations. Why is it intercepting static pages? Is it a standard rule
> that a handler for  is never set?
> 
> Thanks,
> 
> Jamie Krasnoo
> www.MyEBoard.com
> [EMAIL PROTECTED]
> 
> public key: http://www.planetphat.com/jkrasnoo/pgp.html
> 




Re: Apache/mod_perl/Win2K gpfault finally resolved?

2001-02-22 Thread sterling

On Tue, 20 Feb 2001, William A. Rowe, Jr. wrote:

> Folks,
> 
>   any of you in a position to grab the current Apache tree from CVS and build
> Apache plus mod_perl, and see if the gpfault is gone, here is the 'unpatch' for
> John Sterling's quick hack:

my 'quick hack' doesn't work anymore anyways because of some recent apache
changes regarding the console.  I just built apache from head, modperl
from head, and it still crashes - so its still unresolved.

i'll build debug versions and see if I can find any clarity.

sterling




Re: mod_perl for Win32 + ActiveState Perl 5.6 (build 616) + Apache1.3.12

2001-02-13 Thread sterling

Randy Kobes handles win32 binaries - i believe you can find the
modperl 1.24 for use with apache 1.3.12 here:

ftp://theoryx5.uwinnipeg.ca/pub/other/ppd/ApacheModulePerl-1.24_1.3.12.dll

sterling


On Tue, 13 Feb 2001, Ron Reidy wrote:

> Hi,
> 
> Is there a mod_perl available for the above
> configuration?  If not, do you have suggestions?
> 
> Thank you.
> 
> =
> Ron Reidy
> Oracle DBA
> Reidy Consulting, L.L.C.
> 
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35 
> a year!  http://personal.mail.yahoo.com/
> 




RE: Accessing Global Configuration Directives

2001-02-12 Thread sterling

Apache->server will work - but it will always return the base server (so
if you are using virtual hosts it will return a different server from
$r->server).  As long as you are not using virtual hosts you should be ok.

sterling


On Mon, 12 Feb 2001, Stathy Touloumis wrote:

> Kinda, need to access these directives outside of a handler.  Will see how
> well it works creating a server object through the server method directly
> (Apache->server).
> 
> Thanks,
> 
> > not sure quite what you're asking, but if you're looking for a global
> > PerlSetVar/PerlAddVar type of thing - well, as of 1.21_01 i believe you
> > can do it - as long as you have access to Apache::Server.  Like in a child
> > init handler:
> >
> >
> >
> > PerlAddVar foo bar
> > PerlAddVar foo bar2
> > PerlChildInitHandler myChildInitHandler::init
> >
> > and then in the init handler do something like
> >
> > sub init
> > {
> > my $s = shift;
> > my @values = $s->dir_config->get('foo');
> > }
> >
> > @values will be [bar, bar2]
> >
> > is that what you're lookin for?
> 




Re: Accessing Global Configuration Directives

2001-02-10 Thread sterling

not sure quite what you're asking, but if you're looking for a global 
PerlSetVar/PerlAddVar type of thing - well, as of 1.21_01 i believe you
can do it - as long as you have access to Apache::Server.  Like in a child
init handler:



PerlAddVar foo bar
PerlAddVar foo bar2
PerlChildInitHandler myChildInitHandler::init

and then in the init handler do something like

sub init
{
my $s = shift;
my @values = $s->dir_config->get('foo');
}

@values will be [bar, bar2]

is that what you're lookin for?

sterling


On Fri, 9 Feb 2001, Stathy Touloumis wrote:

> Is it possible to access a global configuration directive without using the
> request object?
> 
> Thanks,
> 




Re: Debugging mod_perl with gdb

2001-02-06 Thread sterling

If you're looking for which piece of perl code being processed, there
are some gdb macros to help.  If you source the .gdbinit in the root of
your modperl dir you have access to a bunch of cool macros to use.  In
this case, curinfo will give you the current line number in your perl
code.

here's the macro: 
define curinfo
   printf "%d:%s\n", PL_curcop->cop_line, \
   ((XPV*)(*(XPVGV*)PL_curcop->cop_filegv->sv_any)\
   ->xgv_gp->gp_sv->sv_any)->xpv_pv 
end

hope that helps.

sterling


On Tue, 6 Feb 2001, Shane Adams wrote:

> Hey there - 
> 
> I've successfully built apache/mod_perl with full debugging.  In
> addition, I'm running the whole setup through insure, a commercial
> memory leak/corruption tool.  
> 
> I've found a "write to a dangling pointer" when apache/mod_perl
> evaluates a  section of the apache config file.
> 
> My question:  How do I go about attacking this problem?  I only know
> that I'm in a  section due to printing out some variables
> somewhere at ap_read_config() to invoke_cmd().  I guess I'm trying to
> find out what the perl script is doing when the memory corruption
> occurs.  Obviously if I could narrow the offending line of code (if
> possible) I might be able to better understand where the real bug is.
> 
> Shane
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 30, 2001 5:25 PM
> To: AxKit Users Mailing List
> Cc: [EMAIL PROTECTED]
> Subject: (Correction) Re: Object->XML serialization [was Re: AxKit
> Users?]
> 
> 
> On Tue, 30 Jan 2001 [EMAIL PROTECTED] wrote:
> 
> > Castor (for Java, from www.exolab.com), uses an actual XML Schema for
> > this. The advantage is that you can leverage off the fairly rich
> existing
> > set of defined datatypes.
> 
> Sorry, it's www.exolab.org, don't you hate that?
> 
> --Chris
> 




Re: prob with dir_config at server startup

2001-01-02 Thread John K Sterling

the per_dir_configs (i.e.  PerlSetVar) are not accessabled from
the Apache::Server.  They are only accessable from
Apache::Request::dir_config.  It makes sense if you think about it - a
per_dir config can be different for each Location.  If you need any config
values in a PerlInitHandler, you need to specify them outside the location
tags.

sterling

"T.J. Mather" wrote:

> I'm having a problem accessing PerlSetVar variables with
> Apache->server->dir_config at server startup.  I'm using the lastest
> versions of mod_perl 1.24_01 and apache (1.3.14).
>
> The problem occurs when I use PerlSetVar inside a Directory, Location or
> Files section:
>
> in httpd.conf:
> 
> PerlSetVar PKIT_ROOT /home/tjmather/Apache-PageKit/eg
> 
>
> perl startup code:
> my $pkit_root = Apache->server->dir_config('PKIT_ROOT');
> # $pkit_root = undef
>
> But if I remove the Location directive, then it works fine:
>
> in httpd.conf:
> PerlSetVar PKIT_ROOT /home/tjmather/Apache-PageKit/eg
>
> perl startup code:
> my $pkit_root = Apache->server->dir_config('PKIT_ROOT');
> # $pkit_root = '/home/tjmather/Apache-PageKit/eg'
>
> Any ideas?




Re: PerlSetupEnv Off not working

2001-01-02 Thread John K Sterling

i assume thats a typo, i think PerlSetupEnv has been in since '96

have you seen this bug report? 
http://marc.theaimsgroup.com/?l=apache-modperl&m=95867712412668&w=2
might have something to do with it.

sterling

JR Mayberry wrote:

> Perhaps the problem is that the page reads...
>
> PerlSetupEnv Off is another optimization you might consider. This
> directive requires mod_perl 1.25 or later.
>
> but I run mod_perl 1.24, but http://perl.apache.org/dist/ makes no
> reference to mod_perl 1.25
>
> ?
>
> John K Sterling wrote:
> >
> > check the guide:
> > http://thingy.kcilink.com/modperlguide/performance/PerlSetupEnv_Off.html
> >
> > > But %ENV population is expensive. Those who have moved to the Perl Apache API no 
>longer need this extra %ENV
> > > population, and can gain by turning it Off. Scripts using the CGI.pm module 
>require PerlSetupEnv On because that
> > > module relies on a properly populated CGI environment table.
> > >
> > 
>___
> >
> > JR Mayberry wrote:
> >
> > > Perhaps I am a bit confused about how this should be working...but..
> > >
> > > I have PerlSetupEnv set to Off in httpd.conf..
> > >
> > > yet in this sample script running as an Apache::Registry script:
> > >
> > > #!/opt/bin/perl
> > >
> > > use Data::Dumper;
> > > my $r = Apache->request();
> > > $r->send_http_header('text/plain');
> > > print Dumper(\%ENV);
> > >
> > > its dumping out what appears to be a complete enviroment..
> > >
> > > what gives, shouldnt this be empty?
> > >
> > > there are some other Apache::Registry scripts which havent been
> > > re-written to not use CGI.pm anymore, is it possible that 'use'ing
> > > CGI.pm;' is forcing this to be turned back on?
> > >
> > > -confused
> > >
> > > --
>
> --
> __
> JR Mayberry e-Vend.net Corporation
> Programmer and Systems Administrator(888) 427-8743 x226 tel
> [EMAIL PROTECTED]http://www.e-vend.net
>
> 
> The information in this message (including attachments) is confidential.
> If the reader of this message is not the intended recipient or an agent
> responsible for delivering it to the intended recipient, you are hereby
> notified that you have received this document in error and that any
> review, dissemination, distribution, or copying of this message is
> strictly prohibited.  If you have received this communication in error,
> please notify us immediately by e-mail, and delete the original message.
> ***




Re: PerlSetupEnv Off not working

2001-01-02 Thread John K Sterling

check the guide:
http://thingy.kcilink.com/modperlguide/performance/PerlSetupEnv_Off.html



> But %ENV population is expensive. Those who have moved to the Perl Apache API no 
>longer need this extra %ENV
> population, and can gain by turning it Off. Scripts using the CGI.pm module require 
>PerlSetupEnv On because that
> module relies on a properly populated CGI environment table.
>
___

JR Mayberry wrote:

> Perhaps I am a bit confused about how this should be working...but..
>
> I have PerlSetupEnv set to Off in httpd.conf..
>
> yet in this sample script running as an Apache::Registry script:
>
> #!/opt/bin/perl
>
> use Data::Dumper;
> my $r = Apache->request();
> $r->send_http_header('text/plain');
> print Dumper(\%ENV);
>
> its dumping out what appears to be a complete enviroment..
>
> what gives, shouldnt this be empty?
>
> there are some other Apache::Registry scripts which havent been
> re-written to not use CGI.pm anymore, is it possible that 'use'ing
> CGI.pm;' is forcing this to be turned back on?
>
> -confused
>
> --




Re: LWP and HTML::HeadParser....failed

2001-01-02 Thread John K Sterling

Yung Kwong Wing wrote:

>
> "[thekid@visors thekid]# perl -MCPAN -install LWP
> Can't open perl script "LWP": No such file or directory"

try:
    perl -MCPAN -e 'install "LWP"'

sterling




Re: do I really need "mod_perl"

2000-12-30 Thread John K Sterling

read this: http://take23.org/whatis_mod_perl.xml

it should explain all.

sterling


Yung Kwong Wing wrote:

> Hi,
>
> Sorry for asking a stupid question, but I was wondering do I really need
> to install "mod_perl" to get my website to work with CGI.
>
> It seems that after my unsuccessful attempt at installing "mod_perl", I
> can use the Perl interpreter just fine and I can use the CGI-bin just fine
> also.
>
> I have placed my observations and records in the following URL:
> http://home.netvigator.com/~yungp/my_perl.html
>
> If you look at the observations and records under the date "Dec 30, 2000",
> you will see the modules that are currently installed and that my CGI
> works just fine without "mod_perl"
>
> If anyone can shed the light on this mystery to me, it would be greatly
> appreciated.
>
> Thanks
>
> Peter




Re: Proposals for ApacheCon 2001 in; help us choose! (fwd)

2000-12-21 Thread John K Sterling

> At 02:22 AM 12/22/00 +0100, Stas Bekman wrote:
>
> >Well, this is new. You choose what sessions at ApacheCon you want.
> >
> >I don't think it's a fair approach by ApacheCon committee, as by applying
> >this approach they are going to make the big player even bigger and kill
> >the emerging technologies, who will definitely not get enough quotes and
> >thus will not make it in :( I'm not on the committee, so I cannot really
> >influence, but I'll try anyway.
> >

you don't want a little say in things? i think its clear that they are not
going to just pick the speaker by the number of votes they get.  its just a
great way to allow the people who are going to be at apachecon to put their 2
cents in on what is going to be there.  if anything it gives the public more
say.  the group is obviously interested in picking new diverse topics, but they
also want feedback.

sterling





Re: mod_perl in a shared hosting environment

2000-12-10 Thread John K. Sterling


yes - check out http://perl.apache.org/~dougm/modperl_2.0.html

sterling

 On
10 Dec 2000, David Hodgkinson wrote:

> 
> Just a thought, but will mod_perl and Apache 2.0 be better for this?
> Will we be able to isolate different hosts' perl more easily?
> 
> 




Re: [OT] mod_motd

2000-12-07 Thread John K. Sterling

I think there's a Apache::Motd perl module, is that what your looking for?

sterling

On Thu, 7 Dec 2000, Jerrad Pierce wrote:

> Am I losing my mind or is there a mod_motd for Apache floating around?
> I haven't been able to find it anywhere, but I'm sure I've seen it.
> (Checked Freshmeat, search engines, and Apache module repository)
> 
> Thanks
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: mod_perl with threaded Apache (eg Apache2)

2000-12-04 Thread John K. Sterling

This is doug macEachern's bag -

those who were at apachecon in london saw the progress he had made at that
point - its pretty sweet.  check the archives for summaries of his
presentation in late october.

sterling

On Mon, 4 Dec 2000, Robbie Lindauer wrote:

> Is anyone working on an upgrade to mod_perl to
> handle Apache 2.0b with thread support?
> 
> If so, do you want my help?
> 
> If not, does anyone want to help me?
> 
> Robbie Lindauer
> 
> =
> Robbie Lindauer
> To quote Heidegger:
> 
> "Existence is a mode of being, specifically, the being of 
> those being who stand for the openess of being by standing 
> in it."
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Shopping - Thousands of Stores. Millions of Products.
> http://shopping.yahoo.com/
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: configuration file ( startup.pl )!!!

2000-11-20 Thread John K. Sterling

The below code in your startup.pl will have 1 connection per child.  If
you're apache config allows for 20 kids, each one will get its own
connection to your database.  There is no built in pooling support (though
that will be trivial in 2.0) but usually having a connection per kid is
what you're looking for.


sterling


On Mon, 20 Nov 2000, Edmar Edilton da Silva wrote:

> Dear all,
> 
> I am with a small problem. I used the following command to open some
> 
> connections when the WWW server is initialized:
> 
> #Initialize the database connections for each child
> Apache::DBI->connect_on_init
> ("dbi:Oracle:ora8", "travel", "travel",
>{
>PrintError => 1, # Warn() on errors
>RaiseError => 0, # Don't die on error
>AutoCommit => 1, # Commit executes immediately
>}
> );
> 
> The problem is which I do not know how to configure the WWW server
> 
> to open many connections for example "20 connections"!!!
> 
> Can anyone help me ? If possible, I would like someone send me your
> 
> configuration file (startup.pl).
> 
> Thanks,
> 
> 
> 
> Edmar Edilton da Silva
> Bacharel em Ciência da Computacão - UFV
>   Mestrando em Ciência da Computacão - UNICAMP
> 
> 
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: return from nested functions

2000-11-01 Thread John K. Sterling

On Wed, 1 Nov 2000, Paul J. Lucas wrote:

> On Wed, 1 Nov 2000, John K. Sterling wrote:
> 
> > even better: Apache->exit(SERVER_ERROR);
> 
>   The documentation for exit() deosnt' explicitly say you can do
>   that.  It mentions only "0" and "DONE" (see pp. 464-465).


it works though, Apache.xs:exit() passes the status value to
perl_util.c:perl_call_halt(), which checks:
int is_http_code = 
((status >= 100) && (status < 600) && ERRSV_CAN_BE_HTTP);

...

if(is_http_code) {
croak("%d\n", status);
}

the croak() call is caught the same way 'die SERVER_ERROR' is.



> 
> > or die SERVER_ERROR;
> 
>   But that works.  Thanks!  :)
> 
>   - Paul
> 




Re: return from nested functions

2000-11-01 Thread John K. Sterling


even better: Apache->exit(SERVER_ERROR);.  or die SERVER_ERROR;. this is
documented in the eagle book:

ch9 -  The Apache::Constants Class

"...
While the HTTP constants are generally used as return codes from
handler subroutines, it is also possible to use the builtin die()
function to jump out of a handler with a status code that will be
propagated back to Apache.  Example:

 unless (-r _) {
 die FORBIDDEN;
 }
"
sterling


On Wed, 1 Nov 2000, Paul J. Lucas wrote:

> On Wed, 1 Nov 2000, Paul J. Lucas wrote:
> 
> > Ideally, I want to be able to do:
> > 
> > sub foo {
> > if ( $serious_problem )
> > stop_now_dammit( SERVER_ERROR );
> > }
> > 
> > anywhere in the code like:
> > 
> > sub bar {
> > foo();
> > }
> > 
> > and I do *NOT* have to "catch" anything after the point of
> > call, i.e., every call of foo() is similar to an "assertion" in
> > C, i.e., if you get to the line of code after it, it worked; if
> > it didn't work, you never get to the line after it.
> 
>   I figured out that I can do this by having stop_now_dammit()
>   use $r->notes() to set a note of the status code, call
>   Apache->exit(), and have the downstream handler check the note.
>   If it's anything but OK, simply return that value and the
>   normal Apache error handline mechanism kicks in.  :)
> 
>   - Paul
> 




Re: persistent database problem

2000-10-23 Thread John K. Sterling


The db connection happens once for each child - so every time you hit a
child for the first time it will open up a new connection - you probably
have apache configured to start with 4 or so kids.

sterling

 On Mon, 23 Oct 2000,
Differentiated Software Solutions Pvt. Ltd wrote:

> Hi,
> I have started with one httpd; and executed the following mod-perl program from 
>the browser. We've configured apache to have persistent DBI
> The idea is first time the database handle will be inactive and it will print 
>'INSIDE'.  From the second time onwards the database handle will be active and it 
>will print 'OUTSIDE'.  This is working.
> But, sometimes the 'OUTSIDE' comes from the third or fourth time only.  (that is 
>it takes more than one attempt to become persistent) Why it is happening like this?
> Thanks
> Muthu S Ganesh
> 
> mod-perl code is here:
> 
> $rc = $dbh_pg->{Active};
> print "$$: $rc\n";
> if($rc eq '')
> {
> print "INSIDE\n";
> $dbh_pg = 
>DBI->connect("dbi:Pg:dbname=adcept_smg_ctrl","postgres","postgres",{RaiseError => 1}) 
>|| die $DBI::errstr;
> }
> else
> {
> print "OUTSIDE\n";
> }
> 
> 
> Differentiated Software Solutions Pvt. Ltd.
> 176, Ground Floor, 6th Main,
> 2nd Block, RT Nagar
> Bangalore - 560032
> Phone : 91 80 3431470
> www.diffs-india.com
> 




[PATCH] stop win32 crash when bringing down service

2000-10-20 Thread John K. Sterling

it appears that the mp dso was being unloaded before the cleanups were
complete, causing a crash in cleanup_sv - ONLY when running as a
service.  still not sure why this happens, but this patch at least
eliminates the crash.  i believe this is only called before the process
comes down (nt service restart seems to bring the process down), so it
shouldn't really leak.

--- mod_perl.c_bk   Fri Oct 20 12:03:22 2000
+++ mod_perl.c  Fri Oct 20 12:58:52 2000
@@ -507,8 +507,20 @@
 
 static void mp_dso_unload(void *data) 
 { 
-
-array_header *librefs = xs_dl_librefs((pool *)data);
+array_header *librefs;
+#ifdef WIN32
+// This is here to stop a crash when bringing down
+// a service.  Apparently the dso is unloaded too early.
+// This if statement tests to see if we are running as a 
+// service. apache does the same
+// see apache's isProcessService() in service.c 
+if (AllocConsole())
+{
+FreeConsole();
+return;
+} 
+#endif
+librefs = xs_dl_librefs((pool *)data);
 perl_shutdown(NULL, NULL);
 unload_xs_so(librefs);