Apache::ASP and tied variables

2000-07-07 Thread Remi Fasol

hello.

i am using Tie::IxHash within my Apache::ASP page and
have noticed that the size of my processes are
balooning in size (as told by 'top').

do i need to explicitly untie and undef my tie
variables? or are they automatically freed when my
page exits?

thank you,
remi

__
Do You Yahoo!?
Get Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com/



Re: Newbie: make test failure!

2000-07-07 Thread Michael Robinton

On Sat, 8 Jul 2000, Greg Leidreiter wrote:

> Config:
> mod_perl-1.24
> perl v5.6.0
> apache 1.3.12
> RedHat linux 6.1, kernel 2.2.12
> 
> Using:
> 
>   [/usr/local/apahce/build/mod_perl-1.24]# perl Makefile.PL \
>   EVERYTHING=1 \
>   APACHE_PREFIX=/usr/local/apache
> 
> everything seems to look ok (to me) for both this and 'make'
> but when I run 'make test'
> 
> I get:
> 
>   ...
>   httpd listening on port 8529
>   will write error_log to: t/logs/error_log
>   letting apache warm up...\c
>   done
>   /usr/bin/perl t/TEST 0
>   still waiting for server to warm up.not ok
>   server failed to start! (please examine t/logs/error_log) at t/TEST line
> 95.
>   make: *** [run_tests] Error 9
> 
I always get that error. I always ignore the error and everything seems 
to work fine. Did the same thing with the older perl and older versions 
of apache and mod-perl.

Such is life :-)



Newbie: make test failure!

2000-07-07 Thread Greg Leidreiter

Config:
mod_perl-1.24
perl v5.6.0
apache 1.3.12
RedHat linux 6.1, kernel 2.2.12

Using:

[/usr/local/apahce/build/mod_perl-1.24]# perl Makefile.PL \
EVERYTHING=1 \
APACHE_PREFIX=/usr/local/apache

everything seems to look ok (to me) for both this and 'make'
but when I run 'make test'

I get:

...
httpd listening on port 8529
will write error_log to: t/logs/error_log
letting apache warm up...\c
done
/usr/bin/perl t/TEST 0
still waiting for server to warm up.not ok
server failed to start! (please examine t/logs/error_log) at t/TEST line
95.
make: *** [run_tests] Error 9

which isn't so good I figure. t/logs/error_log says this:

[Sat July 8 13:34:16 2000] [crit] (98)Addresses already in use: make_sock:
could not   bind to port 8529

Although the very first time I ran this it fell over with a different error
(which I rather stupidly failed to note and subsequently hosed the log -
it's great being new at this...)

I can also reproduce this behaviour (perhaps not surprisingly) by running
'make start_http' followed by 't/TEST -v modules'

Any insight appreciated!

Cheers,
Greg.



best encryption module

2000-07-07 Thread clayton cottingham aka drfrog

whats the best encryption module for use with mod perl?
i want to encrypt passwords store in a db and then be able to check 
what a users inputs against it



Re: Hang in $r->print w/ POST

2000-07-07 Thread Patrick

Le Fri, Jul 07, 2000 at 02:18:29PM +0200, heddy Boubaker a dit:
>  to do. I'm just looking for a simple but complete html generator (instead of
>  hard coding all html tags in my code), does such a beast exists or have I to
>  write my own?

I'm not sure what you mean by complete, but CGI::FastTemplate always
suited my needs. Of course there are many other solutions, like
others have told you : HTML::Mason (seems to be very popular), etc...

HTH

-- 
Patrick.
Because if life has a meaning, we should already know it.



Re: Apache::ASP and post-POST redirect

2000-07-07 Thread Roger Espel Llima

Dmitry Beransky wrote:
> Hmm, I don't think I ever mentioned that ASP post-POST redirects just all 
> of a sudden stopped working for me.  A browser would send a POST request 
> and never get anything back.  The logs showed that the request was 
> processed to the point of $Response->Redirect, but nothing would ever come 
> out from the other side.  The server was simply closing the connection 
> without sending any data back to the client.  I did find a hack that made 
> redirects work by replacing ASP's Redirect with the following lines:

I don't know a thing about Apache::Redirect, but I've had this same
problem before: a handler returning REDIRECT after reading POST data
would freeze the apache process (it got stuck trying to read the data
again).

The work-around I used is to set $r->header_in("Content-length", 0) just
after reading the POST data.  Then, if some cleanup function in apache
tries to read it again, it finds that there is none to read.

-- 
Roger Espel Llima, [EMAIL PROTECTED]
http://www.iagora.com/~espel/index.html



Re: Apache/mod_perl

2000-07-07 Thread Scott Alexander

The issue has less to do with the cost of the whole thing, then with 
Strong hold having horrible support as well as a laundry list of other 
problems.  

Our as we convert our code base into completely mod_perl 
modules, the stronghold 2.4.2 has to be replaced by either 3.x or 
going to some other solutions based on apache/mod_perl/ssl 
component. Stronghold on solaris won't run the perlhandler that we 
want it to. 
The question were facing is whether it is worth it to go after the 3.x 
upgrade for strong hold or some other route.

I'm going to try the raven 30day trial and see if i can make that 
work the way we want it to.

Scott

On 7 Jul 2000, at 16:42, Vivek Khera wrote:
> You don't get a license from RSA cheaply.  This is why you buy
> Stronghold or Raven or some equivalent.  The cost of Stronhold and
> Raven is not that much in the grand scheme of things if you have stuff
> important enough to be protecting with SSL in the first place





PerlSetupEnv is evil

2000-07-07 Thread Roger Espel Llima

In the process of optimizing a mod_perl setup (removing useless system
calls), I just spent a very boring couple hours trying to figure out
just why, when I gave Apache a request for a file that didn't exist, it
would first (as expected) stat() each path component, and then do it
again, skipping the *first* path component!

A slightly sanitized bit of strace output looked like this:

read(6, "GET /foo/bar/zoinx HTTP/1.0\r\n", 4096) = 40
read(6, "\r\n", 4096)   = 2
stat("/www/html/foo/bar/zoinx", 0xb8ec) = -1 ENOENT
stat("/www/html/foo/bar", 0xb8ec) = -1 ENOENT
stat("/www/html/foo", 0xb8ec)= -1 ENOENT
stat("/www/html", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
stat("/www/html/bar/zoinx", 0xb6bc) = -1 ENOENT
stat("/www/html/bar", 0xb6bc)= -1 ENOENT
stat("/www/html", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0

Quite clearly, these 3 last stat() calls are wrong and should not be
there.

Poking around a bit more, it turned out that the TransHandlers were
being called twice for each such request; the second call would skip the
first part of the pathname.  i.e, if I gave Apache a "GET
/foo/bar/bletch" and the file didn't exist, it would first run the
TransHandler on "/foo/bar/bletch", then on "/bar/bletch".

It turns out that this is an indirect consequence of PerlSetupEnv; one
of the variables it tries to set is PATH_TRANSLATED, and in order to set
that, Apache runs a subrequest on the path_info (in this case, since
$DocumentRoot existed but $DocumentRoot/foo/ didn't, the path_info was
taken to be "/bar/bletch").

It also turns out that specifying "PerlSetupEnv Off" outside of any
 apparently gets ignored.  Is that a bug?  I put another
"PerlSetupEnv Off" in the  entry for the DocumentRoot, and
now it's not doing these annoying subrequests anymore.

Anyway, after tracing through this stuff, I'm more convinced than ever
that PerlSetupEnv is ugly and slow and to be avoided.

-- 
Roger Espel Llima, [EMAIL PROTECTED]
http://www.iagora.com/~espel/index.html



RE: More on the set_handlers() / push_handlers() bug...

2000-07-07 Thread Christian Gilmore


> Forgive me for the obvious and probably stupid questions, (especially
> since I didn't see the earlier posts in which you probably answered
> them =o)  but just for the record --

No problem. I appreciate your trying to help!

> Could you be misspelling "PerlAuthzHandler"? I note you said
> "PerlAuthzHandlers" with an 's' below Is that a feature I should
> kick myself for not being aware of? Or maybe just an email typo? Or a
> code error? (I do see it's a stack of handlerS, but)

Heh. No, that was just a typo in my mail. I have it right in the handler
code, which I had attached.

> Why undefine the handlers? Could you just use
>  $r->set_handlers( PerlAuthzHandler => [ \&OK ] );
> or something?  Could that be part of the problem? (Though I don't see
> how.I'm still pretty new to this.)

Well, setting it to undef is what is recommended in the "Apache Modules"
book (page 466), but I have tried setting it to \&OK. Setting it to \&OK
turns out to do nothing at all. The server ignores your attempted change
(even though it shows that it did change when you look at get_handlers) and
continues as if you never even called set_handlers.

Please, if you have the time and opportunity, give the AuthzCache a try. I'd
really like to know that others can reproduce the problem. It can wrap
around any perl Authz handler as follows:

PerlAuthzHandler Tivoli::Apache::AuthzCache 
Tivoli::Apache::AuthzCache::manage_cache

Regards,
Christian

-
Christian Gilmore
Infrastructure & Tools Team Lead
Web & Multimedia Development
Tivoli Systems, Inc.




Re: Apache/mod_perl

2000-07-07 Thread Rob Tanner

The problem is cost.  If licensing were cheap, Stronghold, Raven, and 
others would have a somewhat hard time staying in business (an issue 
they'll all have to address soon enough).  The SSL vendors have an OEM 
license of some sort and so what you pay for a right-to-use license is a 
much smaller hunk of change especially because it's spread across a large 
customer base.  So, if you can't wait till September, don't want to risk 
being in violation of a license and getting caught, and don't want to fork 
over $3-4K, the Stronghold/Raven route is a much better choice.

-- Rob

--On Friday, July 07, 2000 12:42 PM -0700 Scott Alexander 
<[EMAIL PROTECTED]> wrote:

> So if i didn't want to wait,  how would I go about getting an RSA
> liscense? to have a mod_ssl server before then.
>
> Also,  are the CA's willing to sign for this time of server?
>
> Scott
> On 7 Jul 2000, at 11:34, Rob Tanner wrote:
>> If you can patiently wait till September 21 when the RSA patents expire
>> covering the SSL algorithms, then you can use mod_ssl without fear of
>> patent violations or lawsuits.
>
>




   _ _ _ _   __ _ _ _ _
  /\_\_\_\_\/\_\ /\_\_\_\_\_\
 /\/_/_/_/_/   /\/_/ \/_/_/_/_/_/  QUIDQUID LATINE DICTUM SIT,
/\/_/__\/_/ __/\/_//\/_/  PROFUNDUM VIDITUR
   /\/_/_/_/_/ /\_\  /\/_//\/_/
  /\/_/ \/_/  /\/_/_/\/_//\/_/ (Whatever is said in Latin
  \/_/  \/_/  \/_/_/_/_/ \/_/  appears profound)

  Rob Tanner
  McMinnville, Oregon
  [EMAIL PROTECTED]



Re: Apache/mod_perl

2000-07-07 Thread Vivek Khera

> "GK" == Gerd Knops <[EMAIL PROTECTED]> writes:

GK> includes a RSA license, you could just put it into a corner and use  
GK> mod_ssl. But I am not sure if that kind of 'license transfer' is really  
GK> legal.

Buying a licensed RSA implementation doesn't give you a license to use
RSA, it gives you a license to use that RSA implementation in the
context which you bought it.  Consult a lawyer, as I am not one, nor
would I want to be.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
GPG & MIME spoken herehttp://www.khera.org/~vivek/



Re: Apache/mod_perl

2000-07-07 Thread Vivek Khera

> "SA" == Scott Alexander <[EMAIL PROTECTED]> writes:

SA> So if i didn't want to wait,  how would I go about getting an RSA 
SA> liscense? to have a mod_ssl server before then.

You don't get a license from RSA cheaply.  This is why you buy
Stronghold or Raven or some equivalent.  The cost of Stronhold and
Raven is not that much in the grand scheme of things if you have stuff
important enough to be protecting with SSL in the first place.

SA> Also,  are the CA's willing to sign for this time of server?

Yes, they will.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
GPG & MIME spoken herehttp://www.khera.org/~vivek/



Re: Apache/mod_perl

2000-07-07 Thread Vivek Khera

> "PS" == Pramod Sokke <[EMAIL PROTECTED]> writes:

PS> Has anybody used stronghold? I'm considering using stronghold for SSL
PS> support since ours is a commercial application. Would mod_perl and all
PS> related modules work as fine with Stronghold as with plain Apache?

Yes.  There's even a file called INSTALL.simple.stronghold in the
mod_perl source directory.  I haven't built stronghold with mod_perl
in nearly a year, so I couldn't tell you how accurate those
instructions are.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
GPG & MIME spoken herehttp://www.khera.org/~vivek/



Re: Apache/mod_perl

2000-07-07 Thread Gerd Knops

Scott Alexander wrote:
> So if i didn't want to wait,  how would I go about getting an RSA
> liscense? to have a mod_ssl server before then.
>
> Also,  are the CA's willing to sign for this time of server?
>
When I checked into this Raven SSL seemed to be the solution. It is  
basically mod_ssl with an RSA license. Some people also suggested that  
if you buy the Red-Hat server package (or whatever it is called) which  
includes a RSA license, you could just put it into a corner and use  
mod_ssl. But I am not sure if that kind of 'license transfer' is really  
legal.

Gerd



Re: Apache/mod_perl

2000-07-07 Thread Scott Alexander

So if i didn't want to wait,  how would I go about getting an RSA 
liscense? to have a mod_ssl server before then.

Also,  are the CA's willing to sign for this time of server?

Scott
On 7 Jul 2000, at 11:34, Rob Tanner wrote:
> If you can patiently wait till September 21 when the RSA patents expire
> covering the SSL algorithms, then you can use mod_ssl without fear of
> patent violations or lawsuits.





More on the set_handlers() / push_handlers() bug...

2000-07-07 Thread Christian Gilmore

Hello, again.

Here's a quick summary of the problem: upon clearing the stack of handlers
(with set_handlers(PerlAuthzHandlers => undef)) the server appears to not
recognize when it has found a DirectoryIndex file and returns the contents
of a directory instead of the index file.

Since last writing on this topic, I upgraded to all of the newest versions
(apache-1.3.12, perl-5.6, mod_perl-1.24) and configured mod_perl with
PERL_TRACE=1. Looking at the error_log with the handler tracing on and httpd
running in single-server mode, I discovered that the server does appear to
cycle through the directory indexes, but doesn't realize when it has found
one. I've attached two error logs for the request
http://dw3.tivoli.com:81/home/passwd/group/: one with the cache enabled, one
without. I've also attached a copy of the document returned by the server
for the with-authz-cache request. The document is the auto-generated
contents of the directory. As you can see, index.phtml does exist in the
directory and is the first file searched for by the server.

Does anyone have any ideas here? Can anyone reproduce the problem? I've also
included the source for the AuthzCache and AuthzLDAP. If anyone could use at
least the Cache code and see if you could reproduce the problem, I'd really
appreciate it.

I noticed that the error log with the cache enabled shows that subsequent
internal requests (such as those you see when requesting a directory instead
of a named file) don't reset the handler stack to what is in the
configuration. See about line 65 of each log file for this difference.

Regards,
Christian

-
Christian Gilmore
Infrastructure & Tools Team Lead
Web & Multimedia Development
Tivoli Systems, Inc.

 AuthzCache.pm
 AuthzLDAP.pm
Title: Index of /home/passwd/group


 
 
Index of /home/passwd/group
 NameLast modified   Size  Description

 Parent Directory18-May-2000 11:25  -  
 display_group_info.p..> 07-Jun-2000 10:4511k  
 group.phtml 08-Jun-2000 17:3818k  
 index.phtml 05-Jun-2000 12:13 7k  

Apache/1.3.12 Server at dw3.tivoli.com Port 81

 error_log_with_cache
 error_log_without_cache


Re: Apache/mod_perl

2000-07-07 Thread Blue

On Fri, 7 Jul 2000, Paul wrote:
 
> Stronghold would give you professional tech support, but if all you
> want is SSL, check out Ralph Engelschall's mod_ssl (www.modssl.org)
> based on the OpenSSL protocol (www.openssl.org).  It works well with
> vanilla Apache, and it's *free* -- thanks again, Ralph. =o)

Let me echo all of the above - I just installed mod_ssl'ed apache on linux
and solaris with no problems, and it works great. Thanks Ralph, and 
everyone else involved.

> 
> --- Pramod Sokke <[EMAIL PROTECTED]> wrote:
> > Has anybody used stronghold? I'm considering using stronghold for SSL
> > support since ours is a commercial application. Would mod_perl and
> > all related modules work as fine with Stronghold as with plain
> Apache?
> > 
> > Thanks,
> > Pramod
> > 
> > At 10:24 AM 7/7/00 -0400, Vivek Khera wrote:
> > >> "PS" == Pramod Sokke <[EMAIL PROTECTED]> writes:
> > >PS> We are running Netscape Enterprise server with cgis written in
> > perl
> > and C.
> > >PS> I'm looking at moving over to Apache and start using mod_perl.
> > How
> > > [ .. ]
> > >PS> over to Apache/mod_perl going to be a simple plug-in or would it
> > involve
> > >PS> re-writing lots of stuff?
> > >
> > >The C stuff will probably not be worth rewriting, but that depends
> > on
> > >what it does.
> > >
> > >The perl stuff will need to be "cleaned" if it is sloppy code.  That
> > >is, if it is clean running in Perl under "-w" and "use strict"
> > you're
> > >most likely going to have little difficulty with them.
> > >
> > >But what you should do is use the two-server performance enhancement
> > >(using mod_proxy and mod_rewrite) and have your legacy apps run on
> > the
> > >front-end server, and then migrate your perl to the mod_perl backend
> > >one at a time.
> > >
> > >-- 
> >
> >=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> > >Vivek Khera, Ph.D.Khera Communications, Inc.
> > >Internet: [EMAIL PROTECTED]   Rockville, MD  
> > +1-301-545-6996
> > >GPG & MIME spoken herehttp://www.khera.org/~vivek/
> > > 
> 
> 
> =
> "Seize the wildness of the moment, Feel the movement of the moon -- Swans fly with 
>wings wide open to the sky." -- B-52's 
> -
> Real friends are those whom, when you inconvenience them, it bothers you more than 
>them. -- me. =o) 
> -
> "There are trivial truths and there are great Truths. The opposite of a trival truth 
>is obviously false. The opposite of a great Truth is also true."  -- Neils Bohr 
> -
> TEMPVS PECVDEM COLLARE EST - It's time to thin the herd.
> -
> [http://www.catfishforbreakfast.com/letgod.html]
> -
> 
> 
> __
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/
> 

-- 
Blue Lang  Unix Systems Admin
QSP, Inc., 3200 Atlantic Ave, Ste 100, Raleigh, NC, 27604
Home: 919 835 1540  Work: 919 875 6994  Fax: 919 872 4015





Re: Apache/mod_perl

2000-07-07 Thread Paul


Stronghold would give you professional tech support, but if all you
want is SSL, check out Ralph Engelschall's mod_ssl (www.modssl.org)
based on the OpenSSL protocol (www.openssl.org).  It works well with
vanilla Apache, and it's *free* -- thanks again, Ralph. =o)

--- Pramod Sokke <[EMAIL PROTECTED]> wrote:
> Has anybody used stronghold? I'm considering using stronghold for SSL
> support since ours is a commercial application. Would mod_perl and
> all related modules work as fine with Stronghold as with plain
Apache?
> 
> Thanks,
> Pramod
> 
> At 10:24 AM 7/7/00 -0400, Vivek Khera wrote:
> >> "PS" == Pramod Sokke <[EMAIL PROTECTED]> writes:
> >PS> We are running Netscape Enterprise server with cgis written in
> perl
> and C.
> >PS> I'm looking at moving over to Apache and start using mod_perl.
> How
> > [ .. ]
> >PS> over to Apache/mod_perl going to be a simple plug-in or would it
> involve
> >PS> re-writing lots of stuff?
> >
> >The C stuff will probably not be worth rewriting, but that depends
> on
> >what it does.
> >
> >The perl stuff will need to be "cleaned" if it is sloppy code.  That
> >is, if it is clean running in Perl under "-w" and "use strict"
> you're
> >most likely going to have little difficulty with them.
> >
> >But what you should do is use the two-server performance enhancement
> >(using mod_proxy and mod_rewrite) and have your legacy apps run on
> the
> >front-end server, and then migrate your perl to the mod_perl backend
> >one at a time.
> >
> >-- 
>
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> >Vivek Khera, Ph.D.Khera Communications, Inc.
> >Internet: [EMAIL PROTECTED]   Rockville, MD  
> +1-301-545-6996
> >GPG & MIME spoken herehttp://www.khera.org/~vivek/
> > 


=
"Seize the wildness of the moment, Feel the movement of the moon -- Swans fly with 
wings wide open to the sky." -- B-52's 
-
Real friends are those whom, when you inconvenience them, it bothers you more than 
them. -- me. =o) 
-
"There are trivial truths and there are great Truths. The opposite of a trival truth 
is obviously false. The opposite of a great Truth is also true."  -- Neils Bohr 
-
TEMPVS PECVDEM COLLARE EST - It's time to thin the herd.
-
[http://www.catfishforbreakfast.com/letgod.html]
-


__
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/



Re: Apache/mod_perl

2000-07-07 Thread Rob Tanner



--On Friday, July 07, 2000 11:09 AM -0700 Alan Sparks 
<[EMAIL PROTECTED]> wrote:

> Can't speak much to Stronghold, got a copy and ultimately put it on the
> shelf.  I rather like Raven (covalent.com), works like a peach with
> mod_perl etc.
> Just wish Apache didn't have to be patched to install the damn stuff...
> -Alan
>

If you can patiently wait till September 21 when the RSA patents expire 
covering the SSL algorithms, then you can use mod_ssl without fear of 
patent violations or lawsuits.  In fact, I recollect reading somewhere 
(might even been on this list) that Stronghold is going to or is now using 
mod_ssl as the underlying Apache/SSL interface (along with openSSL for the 
RSA stuff).

-- Rob

   _ _ _ _   __ _ _ _ _
  /\_\_\_\_\/\_\ /\_\_\_\_\_\
 /\/_/_/_/_/   /\/_/ \/_/_/_/_/_/  QUIDQUID LATINE DICTUM SIT,
/\/_/__\/_/ __/\/_//\/_/  PROFUNDUM VIDITUR
   /\/_/_/_/_/ /\_\  /\/_//\/_/
  /\/_/ \/_/  /\/_/_/\/_//\/_/ (Whatever is said in Latin
  \/_/  \/_/  \/_/_/_/_/ \/_/  appears profound)

  Rob Tanner
  McMinnville, Oregon
  [EMAIL PROTECTED]



Re: Apache/mod_perl

2000-07-07 Thread John Armstrong

We use stronghold here and its great. Our configuration handles like this :

Stronghold : Handles Port 80 and 443 requests. It then Reverse 
Proxies dynamic content back to the mod perl servers.

I've used stronghold in 3 or 4 high demand apps and its a fantastic 
low cost solution. However, we are starting moving to more hardware 
based solutions and away from stronghold.

John Armstrong

At 11:01 AM -0700 7/7/00, Pramod Sokke wrote:
>Has anybody used stronghold? I'm considering using stronghold for SSL
>support since ours is a commercial application. Would mod_perl and all
>related modules work as fine with Stronghold as with plain Apache?
>
>Thanks,
>Pramod
>
>At 10:24 AM 7/7/00 -0400, Vivek Khera wrote:
> >> "PS" == Pramod Sokke <[EMAIL PROTECTED]> writes:
> >
> >PS> We are running Netscape Enterprise server with cgis written in perl
>and C.
> >PS> I'm looking at moving over to Apache and start using mod_perl. How
> > [ .. ]
> >PS> over to Apache/mod_perl going to be a simple plug-in or would it involve
> >PS> re-writing lots of stuff?
> >
> >The C stuff will probably not be worth rewriting, but that depends on
> >what it does.
> >
> >The perl stuff will need to be "cleaned" if it is sloppy code.  That
> >is, if it is clean running in Perl under "-w" and "use strict" you're
> >most likely going to have little difficulty with them.
> >
> >But what you should do is use the two-server performance enhancement
> >(using mod_proxy and mod_rewrite) and have your legacy apps run on the
> >front-end server, and then migrate your perl to the mod_perl backend
> >one at a time.
> >
> >--
> >=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> >Vivek Khera, Ph.D.Khera Communications, Inc.
> >Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
> >GPG & MIME spoken herehttp://www.khera.org/~vivek/
> >




Re: Apache/mod_perl

2000-07-07 Thread Alan Sparks

Can't speak much to Stronghold, got a copy and ultimately put it on the
shelf.  I rather like Raven (covalent.com), works like a peach with mod_perl
etc.
Just wish Apache didn't have to be patched to install the damn stuff...
-Alan

-Original Message-
From: Pramod Sokke <[EMAIL PROTECTED]>
To: Vivek Khera <[EMAIL PROTECTED]>; [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Friday, July 07, 2000 11:03 AM
Subject: Re: Apache/mod_perl


>Has anybody used stronghold? I'm considering using stronghold for SSL
>support since ours is a commercial application. Would mod_perl and all
>related modules work as fine with Stronghold as with plain Apache?
>
>Thanks,
>Pramod
>
>At 10:24 AM 7/7/00 -0400, Vivek Khera wrote:
>>> "PS" == Pramod Sokke <[EMAIL PROTECTED]> writes:
>>
>>PS> We are running Netscape Enterprise server with cgis written in perl
>and C.
>>PS> I'm looking at moving over to Apache and start using mod_perl. How
>> [ .. ]
>>PS> over to Apache/mod_perl going to be a simple plug-in or would it
involve
>>PS> re-writing lots of stuff?
>>
>>The C stuff will probably not be worth rewriting, but that depends on
>>what it does.
>>
>>The perl stuff will need to be "cleaned" if it is sloppy code.  That
>>is, if it is clean running in Perl under "-w" and "use strict" you're
>>most likely going to have little difficulty with them.
>>
>>But what you should do is use the two-server performance enhancement
>>(using mod_proxy and mod_rewrite) and have your legacy apps run on the
>>front-end server, and then migrate your perl to the mod_perl backend
>>one at a time.
>>
>>--
>>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>Vivek Khera, Ph.D.Khera Communications, Inc.
>>Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
>>GPG & MIME spoken herehttp://www.khera.org/~vivek/
>>




Re: Apache/mod_perl

2000-07-07 Thread Pramod Sokke

Has anybody used stronghold? I'm considering using stronghold for SSL
support since ours is a commercial application. Would mod_perl and all
related modules work as fine with Stronghold as with plain Apache?

Thanks,
Pramod

At 10:24 AM 7/7/00 -0400, Vivek Khera wrote:
>> "PS" == Pramod Sokke <[EMAIL PROTECTED]> writes:
>
>PS> We are running Netscape Enterprise server with cgis written in perl
and C.
>PS> I'm looking at moving over to Apache and start using mod_perl. How
> [ .. ]
>PS> over to Apache/mod_perl going to be a simple plug-in or would it involve
>PS> re-writing lots of stuff?
>
>The C stuff will probably not be worth rewriting, but that depends on
>what it does.
>
>The perl stuff will need to be "cleaned" if it is sloppy code.  That
>is, if it is clean running in Perl under "-w" and "use strict" you're
>most likely going to have little difficulty with them.
>
>But what you should do is use the two-server performance enhancement
>(using mod_proxy and mod_rewrite) and have your legacy apps run on the
>front-end server, and then migrate your perl to the mod_perl backend
>one at a time.
>
>-- 
>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>Vivek Khera, Ph.D.Khera Communications, Inc.
>Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
>GPG & MIME spoken herehttp://www.khera.org/~vivek/
> 



RE: Apache::ASP and post-POST redirect

2000-07-07 Thread Geoffrey Young



> -Original Message-
> From: Joshua Chamas [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 07, 2000 12:46 PM
> To: Dmitry Beransky
> Cc: [EMAIL PROTECTED]; Ken Williams
> Subject: Re: Apache::ASP and post-POST redirect
> 
> 
> 
> I bet its an ASP->Apache::Filter issue, because in general
> there has been quite a lot with of issues coordinating
> between filtered modules on the headers.
> 

I haven't really been following this thread, since I don't use asp, but
Apache::Filter (1.09?) introduced a new mechanism for sending the headers.
basically, it waits to see the first print to STDOUT from the last filter
before calling $r->send_http_headers(), whereas previously it was sending
headers right at the call to $r->filter_input by the last filter.

I don't see how this would make a difference to anyone (except to the
positive), though, but I thought I'd bring it up just in case...

HTH

--Geoff



Re: Apache::Session::Object

2000-07-07 Thread Nathan Wiger

Perrin-

> modifying Apache::Session to support both interfaces and sending Jeffrey
> the patch. 

This is a good suggestion. I'll try modifying Apache::Session first and
sending Jeff the patch. If he doesn't want to integrate it I'll package
it as a separate module.

-Nate



Re: Apache::ASP and post-POST redirect

2000-07-07 Thread Joshua Chamas

Dmitry Beransky wrote:
> 
> Uh, I found what it was!
> 
> After receiving Joshua's email, I experimented some more and while trying
> to get the simplest possible configuration disabled the 'Filter' flag
> (which I had turned on because I used Apache::SSI in conjunction with
> ASP).   And this did the trick.  As soon as filtering was gone, redirects
> started working again.
> 
> Hmm, I don't think I ever mentioned that ASP post-POST redirects just all
> of a sudden stopped working for me.  A browser would send a POST request
> and never get anything back.  The logs showed that the request was
> processed to the point of $Response->Redirect, but nothing would ever come
> out from the other side.  The server was simply closing the connection
> without sending any data back to the client.  I did find a hack that made
> redirects work by replacing ASP's Redirect with the following lines:
> 
> Apache->print("HTTP/1.0 301 Moved Permanantly\n");
> Apache->print("Location: http://www.ucsd.edu\n");
> Apache->print("\n");
> $Response->Redirect('http://mill.ucsd.edu/index.html');
> 
> (where the last line was simply used to force apache to close the
> connection) This worked as expected.
> 

I bet its an ASP->Apache::Filter issue, because in general
there has been quite a lot with of issues coordinating
between filtered modules on the headers.

Note that in recent versions of Apache::ASP, I have started
to return the 302 status for redirects from the handler 
which might be affecting this behavior.

Also the new $Server->Transfer() feature might make this
issue go away for you too, as it is an internal redirect.

Until I can look at what's causing this, you might want to
just override the *Apache::ASP::Response::Redirect sub 
in your global.asa or so, so you don't have to directly
hacking Apache::ASP

sub Apache::ASP::Response::Redirect {
my($self, $location) = @_;
 Apache->print("HTTP/1.0 301 Moved Permanantly\n");
 Apache->print("Location: $location\n");
 Apache->print("\n");
$self->End();
}

--Joshua

> At 08:26 AM 7/7/00, Joshua Chamas wrote:
> 
> >I imagine that if you just do:
> >
> >  $Response->Clear();
> >  $Response->Redirect();
> >
> >you will get what you are going for.  A POST should
> >not follow a redirect.  A redirect at the top of your
> >scripts should likely not need the clear, which is
> >how I tend to use it.  Note with the latest release
> >there is also a $Server->Transfer() which is faster
> >than a redirect, and maybe useful for your needs.
> >
> >[...]
> >
> >>
> >>Dmitry Beransky wrote:
> >> > [...]
> >> > In a mod_perl module, if I want to return a redirect after processing a
> >> > POST, I need to make sure to reset the method to 'GET' and content length
> >> > to 0.  How does Apache::ASP handle this case or, rather, how do I handle
> >> > after POST redirects in ASP?
> >> >



Re: Apache::ASP and post-POST redirect

2000-07-07 Thread Dmitry Beransky

Uh, I found what it was!

After receiving Joshua's email, I experimented some more and while trying 
to get the simplest possible configuration disabled the 'Filter' flag 
(which I had turned on because I used Apache::SSI in conjunction with 
ASP).   And this did the trick.  As soon as filtering was gone, redirects 
started working again.

Hmm, I don't think I ever mentioned that ASP post-POST redirects just all 
of a sudden stopped working for me.  A browser would send a POST request 
and never get anything back.  The logs showed that the request was 
processed to the point of $Response->Redirect, but nothing would ever come 
out from the other side.  The server was simply closing the connection 
without sending any data back to the client.  I did find a hack that made 
redirects work by replacing ASP's Redirect with the following lines:

Apache->print("HTTP/1.0 301 Moved Permanantly\n");
Apache->print("Location: http://www.ucsd.edu\n");
Apache->print("\n");
$Response->Redirect('http://mill.ucsd.edu/index.html');

(where the last line was simply used to force apache to close the 
connection) This worked as expected.

I swear this used to work before with filters on.  Did something change in 
Apache::Filter?

Thanks
Dmitry

PS I'm running Apache/1.3.12 and mod_perl/1.24 (all hand-compiled) on 
RedHat 6.2.  Apache::ASP v.0.19 (I did try the newest version, it behaved 
the same), Apache::Filter v.1.011 and Apache::SSI v.2.13

At 08:26 AM 7/7/00, Joshua Chamas wrote:

>I imagine that if you just do:
>
>  $Response->Clear();
>  $Response->Redirect();
>
>you will get what you are going for.  A POST should
>not follow a redirect.  A redirect at the top of your
>scripts should likely not need the clear, which is
>how I tend to use it.  Note with the latest release
>there is also a $Server->Transfer() which is faster
>than a redirect, and maybe useful for your needs.
>
>[...]
>
>>
>>Dmitry Beransky wrote:
>> > [...]
>> > In a mod_perl module, if I want to return a redirect after processing a
>> > POST, I need to make sure to reset the method to 'GET' and content length
>> > to 0.  How does Apache::ASP handle this case or, rather, how do I handle
>> > after POST redirects in ASP?
>> >




Re: Hang in $r->print w/ POST

2000-07-07 Thread Bruce W. Hoylman


> "heddy" == heddy Boubaker <[EMAIL PROTECTED]> writes:

>> I liked the CGI functions to generate HTML ... it seems there is no
>> simple way to tell CGI module not to eat POST data. HTML::StickyForms
>> could be an option for forms ... the others (Template, Mason) are not
>> for what I'm trying to do. I'm just looking for a simple but complete
>> html generator (instead of hard coding all html tags in my code),
>> does such a beast exists or have I to write my own?
 
>From the CGI docs:

To create an empty query, initialize it from an empty string
or hash:

   $empty_query = new CGI("");

  -or-

   $empty_query = new CGI({});

This gives you a CGI object that you can use to generate your html and
leave the query content alone.

HTHYO.

Peace.



Re: R. Berjon's Mod_perl site (was "Re: Coldfusion vs. apache/mod_perl")

2000-07-07 Thread brian moseley

On Fri, 7 Jul 2000, Robin Berjon wrote:

> No need to apologize, we've all got a lot to do. Is it
> just a matter of committing the cvs or is there more to
> be done ? I have a little bit of time between now and
> the middle of the month, I can help if need be.

jim took a snapshot of a subset of the site and applied his
changes to it. i need to incorporate changes that have been
made since the snapshot, and apply the template to the rest
of the site. it'll be a fair amount of work, but perhaps i
can do it in chunks, and i'll certainly commit the template,
so perhaps folks can help with that part.





Re: Apache::ASP

2000-07-07 Thread Joshua Chamas

I just meant, if you build/rebuild your modperl httpd,
make sure you copy it to your normal httpd place, like
/usr/local/apache/bin or something.  People often forget
this step so that even when they build it and passes all the 
tests, they still get the PerlSetVar not defined error from 
apache, since they are using their old apache binary still.

Check out a related documented FAQ for more info:
  
http://www.nodeworks.com/asp/faq.html#Apache%20errors%20on%20the%20PerlHandler%20directive%20%3F

--Joshua

Vincent Bruijnes wrote:
> 
> How do you mean with copy it to over to where my httpd resides?
> my apache resides in /www and where and what file should i place
> in /www/ ? btw i don't use DSO
> 
> Sincerely Vincent Bruijnes
> 
> At 00:57 6-7-00 -0700, you wrote:
> >Vincent Bruijnes wrote:
> > >
> > > I got this error always when running /site/eg/index.html
> > >
> > > /www/htdocs/site/eg/.htaccess: Invalid command 'PerlSetVar', perhaps
> > > mis-spelled or defined by a module not included in the server
> > configuration.
> > >
> > > Is there a clue ?
> > >
> >
> >Install mod_perl, or make sure its active.  If using DSO,
> >make sure the module is built and commented in.  If you
> >haven't built mod_perl, build it, statically link it with
> >Apache, and make sure you copy it over to where your httpd
> >resides on disk ( common error ).
> >
> >If you have any questions about the above, be sure to read
> >the guide http://perl.apache.org/guide
> >
> >-- Joshua
> >



Re: mod_perl + 3rd party module loading problem

2000-07-07 Thread Francesc Guasch



Tatiana Tarassenko wrote:
> 
> Hi,
> 
> we're running Apache1.3.12 on linux, both mod_perl and mod_3rdparty are
> compiled as DSOs and are working fine while being loaded separately.
> 
> on the attempt of loading them altogether server produces a message that
> httpd started while there's no sign httpd.pid. error_log is clear as
> well.

It look like the X-file case it happened to me before I fresh
compiled and installed perl and apache from tar.gz getting rid
of the rpms



Re: Apache::ASP and clock times

2000-07-07 Thread Carl Lipo


We are not sure why but it appears that the time problem may end up being
specific to a DSO enabled, debian distribution of apache. When we
recompiled a static version, the time that the ASP processes reported
remained the same as the system clock (no changes from PDT to GMT). It
looks like this is a bad-compilation problem or an effect of DSO. 

On Fri, 7 Jul 2000, Vivek Khera wrote:

> > "JC" == Joshua Chamas <[EMAIL PROTECTED]> writes:
> 
> JC> It may be possible that the time calculation is based
> JC> on some TZ* environment variable that is not consistent,
> 
> It has been my experience that the first time any of the system
> date/time routines are called and TZ is set, that becomes the
> permanent time zone until the process goes away.  So it could be
> something totally other than ASP setting the time zone for the
> process.
> 
> 




Re: Apache/mod_perl

2000-07-07 Thread David Hodgkinson


>
Vivek Khera <[EMAIL PROTECTED]> writes:

>  "PS" == Pramod Sokke <[EMAIL PROTECTED]> writes:
> 
> PS> We are running Netscape Enterprise server with cgis written in perl and C.
> PS> I'm looking at moving over to Apache and start using mod_perl. How
>  [ .. ]
> PS> over to Apache/mod_perl going to be a simple plug-in or would it involve
> PS> re-writing lots of stuff?
> 
> The C stuff will probably not be worth rewriting, but that depends on
> what it does.
> 
> The perl stuff will need to be "cleaned" if it is sloppy code.  That
> is, if it is clean running in Perl under "-w" and "use strict" you're
> most likely going to have little difficulty with them.
> 
> But what you should do is use the two-server performance enhancement
> (using mod_proxy and mod_rewrite) and have your legacy apps run on the
> front-end server, and then migrate your perl to the mod_perl backend
> one at a time.

My first thought would be to do some 80/20 analysis and see which bits
are REALLY important.

If it's the C code, do the fastcgi thing (or Velocigen if you want
actual support).

If it's the perl code, then as Vivek says.

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



mod_perl + 3rd party module loading problem

2000-07-07 Thread Tatiana Tarassenko

Hi,

we're running Apache1.3.12 on linux, both mod_perl and mod_3rdparty are
compiled as DSOs and are working fine while being loaded separately.

on the attempt of loading them altogether server produces a message that
httpd started while there's no sign httpd.pid. error_log is clear as
well.

it looks like the server really starts, mod_3rdparty passes
initialization (it writes logfile), and then server dies after the
restart. 

the behavior is pretty close to one with more than one VirtualHosts and
disabled suEXEC, but how to cure it with mod_perl, when you can't use
any wrappers?

thanks in advance for any tips or directions on how to make it work
together.

Tatiana Tarassenko, Software Developer 
Inline Internet Systems, Inc.



Re: Apache/mod_perl

2000-07-07 Thread Vivek Khera

> "PS" == Pramod Sokke <[EMAIL PROTECTED]> writes:

PS> We are running Netscape Enterprise server with cgis written in perl and C.
PS> I'm looking at moving over to Apache and start using mod_perl. How
 [ .. ]
PS> over to Apache/mod_perl going to be a simple plug-in or would it involve
PS> re-writing lots of stuff?

The C stuff will probably not be worth rewriting, but that depends on
what it does.

The perl stuff will need to be "cleaned" if it is sloppy code.  That
is, if it is clean running in Perl under "-w" and "use strict" you're
most likely going to have little difficulty with them.

But what you should do is use the two-server performance enhancement
(using mod_proxy and mod_rewrite) and have your legacy apps run on the
front-end server, and then migrate your perl to the mod_perl backend
one at a time.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
GPG & MIME spoken herehttp://www.khera.org/~vivek/



Re: Apache::ASP and clock times

2000-07-07 Thread Vivek Khera

> "JC" == Joshua Chamas <[EMAIL PROTECTED]> writes:

JC> It may be possible that the time calculation is based
JC> on some TZ* environment variable that is not consistent,

It has been my experience that the first time any of the system
date/time routines are called and TZ is set, that becomes the
permanent time zone until the process goes away.  So it could be
something totally other than ASP setting the time zone for the
process.




New mod_perl site goes live...

2000-07-07 Thread David Hodgkinson


Well, the site's old, but the mod_perl bit of it is brand spanking
new. Thanks to sterling work by Ged Haywood and a little bit of
tweaking by me:

http://www.bargainholidays.com/

Is now mod_perl. Well, the most important script on the site it.

Response times are now roughly ten times better than they were, but
the most impressive thing is that the system load now looks like a
dead person's cardiogram as opposed to that of someone in bad
ventricular fibrillation.

It ate today's lunchtime peak without breaking a sweat.

There are still a couple of CPU wastes in the perl itself but I'll fix
those in due course.

Thanks for a great tool!

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -



Re: Hang in $r->print w/ POST

2000-07-07 Thread heddy Boubaker


 <> "Darren" == darren chamberlain <[EMAIL PROTECTED]> writes:

 Darren> But using CGI's methods invoke CGI's self_or_default meethod, which
 Darren> will either use the object passed in or create one internally ($Q)
 Darren> and use that to perform its output. So, even though you are not
 Darren> explicitly creating a CGI object, you are creating one implicitly,
 Darren> which is what is grabbing the POSTed data, which is why the script
 Darren> hangs right where you first try to use a CGI method.

 Agh! You'r right this is THE reason !! the CGI->init method eat all the
 POST data !! Is this documented anywhere ? Couldn't this be in the mod_perl
 Guide or FAQ ? 
 
 Darren> If you need the HTML generation methods (it looks like this is all
 Darren> you use CGI for), look into HTML::StickyForm for the forms, and
 Darren> extend it with your own package for other HTML elements, or use a
 Darren> templating system like HTML::Template or TemplateToolkit. I prefer to
 Darren> use HTML::Template, or HTML::Mason when possible, for exactly this
 Darren> reason.  Another option, of course, is to use CGI in an object
 Darren> oriented fashion, and preload it with -compile to have the entirety
 Darren> of it reside in the parent process.

 I liked the CGI functions to generate HTML ... it seems there is no simple
 way to tell CGI module not to eat POST data. HTML::StickyForms could be an
 option for forms ... the others (Template, Mason) are not for what I'm trying
 to do. I'm just looking for a simple but complete html generator (instead of
 hard coding all html tags in my code), does such a beast exists or have I to
 write my own?
 
 thanks a lot for you answers.
 
-- 
 /   From the last station before the end of the neT   \
 \ Centre d'Etudes de la Navigation Aerienne,  div SSS /
 / 7, av edouard Belin - 31055 Toulouse CEDEX - France \
 \ Tel:(+33|0)5.62.25.95.22 | Fax:(+33|0)5.62.25.95.99 /



Re: AIX, dlopen problem?

2000-07-07 Thread Jens-Uwe Mager

On Thu, Jul 06, 2000 at 07:08:03PM -0500, John Marquart wrote:

> Environment:
> AIX 4.3.3
> xlc 
> apache 1.3.12
> mod_perl 1.22
> perl 5.00503  (compiled w/ INSTALL patch, details below)
> 
> I have had various difficulties trying to get mod_perl to compile
> successfully using perl 5.6.0, also w/ mod_perl 1.24.  However, with the
> above configuration I have had no compilation problems.  When I try to
> include a module in httpd.conf w/ a "PerlModule
> Apache::IU::AuthenKerberos" statement & then run apachectl start I get the
> following error message:
> 
> bash-2.01# ./apachectl start 
> Syntax error on line 191 of /usr/local/apache_perl.4/conf/httpd.conf: 
> Can't load
> 
>'/usr/local/lib/perl5/site_perl/5.005/aix/auto/Apache/IU/AuthenKerberos/AuthenKerberos.so'
> for module Apache::IU::AuthenKerberos: dlopen:
> 
>/usr/local/lib/perl5/site_perl/5.005/aix/auto/Apache/IU/AuthenKerberos/AuthenKerberos.so:
> 30
> 
>/usr/local/lib/perl5/site_perl/5.005/aix/auto/Apache/IU/AuthenKerberos/AuthenKerberos.so36
> ap_add_module 20 httpd36 ap_null_cleanup 21 httpd36 ap_palloc 22 httpd36
> ap_register_cleanup 23 httpd at
> /usr/local/lib/perl5/5.00503/aix/DynaLoader.pm line 169.

This suspicially looks like you have some imports in the AuthenKerberos
wrong. Modules that are plug-ins to Perl but at the same time need to
reference Apache symbols need some more ld flags to compile. The
Apache::src modules knows which:

$ perl -MApache::src -le 'print Apache::src->new->otherldflags;'
-bI:/usr/local/lib/perl5/site_perl/5.005/aix/auto/Apache/mod_perl.exp 
-bI:/usr/local/apache/libexec/httpd.exp

Add these to the link line of the AuthenKerberos module. If that still
does not work, I would need to examine the exact link command line and
the output of "dump -nv AuthenKerberos.so".

-- 
Jens-Uwe Mager

HELIOS Software GmbH
Steinriede 3
30827 Garbsen
Germany

Phone:  +49 5131 709320
FAX:+49 5131 709325
Internet:   [EMAIL PROTECTED]



Re: Hang in $r->print w/ POST

2000-07-07 Thread darren chamberlain

heddy Boubaker ([EMAIL PROTECTED]) said something to this effect:
> 
>  <> "Darren" == darren chamberlain <[EMAIL PROTECTED]> writes:
> 
>  Darren> Apache::Request retrieves the POSTed content, so if you try to get
>  Darren> it, the server will hang, waiting for input. With Apache::Request,
>  Darren> just call the
>  Darren> $r->param method to fetch the data, and don't try to call it yourself.
> 
>  Yes I know that, I didn't try to read something (POST data from stdin) I try
>  to write (print to stdout). BTW my code act the same if I use Apache::Request
>  or not... And I forgot to say that I use CGI module in my handler, and that
>  no other handler eat r->content ...

But using CGI's methods invoke CGI's self_or_default meethod, which will
either use the object passed in or create one internally ($Q) and use that
to perform its output. So, even though you are not explicitly creating a CGI
object, you are creating one implicitly, which is what is grabbing the
POSTed data, which is why the script hangs right where you first try to
use a CGI method.

If you need the HTML generation methods (it looks like this
is all you use CGI for), look into HTML::StickyForm for the forms, and 
extend it with your own package for other HTML elements, or use a templating
system like HTML::Template or TemplateToolkit. I prefer to use
HTML::Template, or HTML::Mason when possible, for exactly this reason.
Another option, of course, is to use CGI in an object oriented fashion,
and preload it with -compile to have the entirety of it reside in the parent
process.

Recommendation: Abondon CGI, and go with Apache::Request (or
Apache::RequestNote), HTML::StickyForm, and HTML::Template.

(darren)

-- 
The goal of technology is to build something that will last at least until
we finish building it.



Re: Apache : mod_perl vs fastcgi

2000-07-07 Thread Gunther Birznieks

In addition, you can read the CGI.pm documentation on the use of 
Perl/CGI.pm with FastCGI and you'll be good to go with that get next 
request technique.

At 08:14 AM 7/7/00 +0100, David Hodgkinson wrote:

>Dana Powers <[EMAIL PROTECTED]> writes:
>
> > FastCGI with perl may or may not be that fast. I could be totally wrong 
> here
> > but I believe that FastCGI will be able to cache the perl runtime, but perl
> > will still have to reload and recompile any scripts during every hit.
>
>Not true.
>
>You put some code in your CGI to "get next CGI request". Your fully
>compiled program does this for as many times as it needs to.
>
>See the paper linked off my homepage *plug* *plug* ;-)
>
>--
>Dave Hodgkinson, http://www.hodgkinson.org
>Editor-in-chief, The Highway Star   http://www.deep-purple.com
>   Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
>   -




Re: Hang in $r->print w/ POST

2000-07-07 Thread heddy Boubaker


 <> "Darren" == darren chamberlain <[EMAIL PROTECTED]> writes:

 Darren> Apache::Request retrieves the POSTed content, so if you try to get
 Darren> it, the server will hang, waiting for input. With Apache::Request,
 Darren> just call the
 Darren> $r->param method to fetch the data, and don't try to call it yourself.

 Yes I know that, I didn't try to read something (POST data from stdin) I try
 to write (print to stdout). BTW my code act the same if I use Apache::Request
 or not... And I forgot to say that I use CGI module in my handler, and that
 no other handler eat r->content ...
 
 Apache v1.3.9
 mod_perl v1.21
 CGI.pm v2.62
 
 This piece of code illustrate the pb (thanks to give me any hint):
 
#!/usr/local/bin/perl
# 
# Test.pm: Apache::CENA::Test
# 
package Apache::CENA::Test;

use diagnostics -verbose;
use strict; 
use Apache::Constants qw(:common);
use CGI qw(:html :form :cgi);

sub handler {
  my $r = shift;
  # Do not bother with HEAD requests
  return DECLINED if $r->header_only();
  # Do not bother with internal sub-requests
  return DECLINED unless $r->is_main();
  # Get POST content & GET args
  $r->log->info( "Getting args ... " );
  my %Args = ($r->args(), $r->content());
  my $this = $r->subprocess_env('SCRIPT_URL');
  $r->log->info( "Sending headers ... " );
  $r->content_type( 'text/html' );
  $r->send_http_header();
  $r->log->info( "Sending start_html ... " );
  # Hangs here in POST methods!!!
  $r->print( start_html(-title=> $this ));
  $r->print( h1( $this ), hr());
  map{ $r->print( "$_ = ", strong($Args{$_}), br());} keys %Args; 
  $r->print( 
hr(),  
a({-href=> "$this?get-arg1=1&get-arg2=2"}, 'GET' ), 
start_form(-method => 'POST', 
   -action => "$this?get-arg3=3&get-arg4=4"), 
hidden( -name => 'post-content1', -default => 5 ),
hidden( -name => 'post-content2', -default => 5 ),
submit( 'POST', 'POST' ), 
end_form(), 
end_html()
   );
  $r->log->info( "Done" );
  return OK;
}

1;
# Test.pm ends here  


-- 
 /   From the last station before the end of the neT   \
 \ Centre d'Etudes de la Navigation Aerienne,  div SSS /
 / 7, av edouard Belin - 31055 Toulouse CEDEX - France \
 \ Tel:(+33|0)5.62.25.95.22 | Fax:(+33|0)5.62.25.95.99 /



Re: What is *.xs file?

2000-07-07 Thread Francesc Guasch

James G Smith wrote:
> 
> I would start with `man h2xs' (only a start), and get _Programming Perl_,
> which talks about it some, as does _The Perl Cookbook_, I believe.  Then

Advanced Perl programming talks about it also.

-- 
 - frankie -



Re: Apache : mod_perl vs fastcgi

2000-07-07 Thread David Hodgkinson


Dana Powers <[EMAIL PROTECTED]> writes:

> FastCGI with perl may or may not be that fast. I could be totally wrong here
> but I believe that FastCGI will be able to cache the perl runtime, but perl
> will still have to reload and recompile any scripts during every hit.

Not true.

You put some code in your CGI to "get next CGI request". Your fully
compiled program does this for as many times as it needs to.

See the paper linked off my homepage *plug* *plug* ;-)

-- 
Dave Hodgkinson, http://www.hodgkinson.org
Editor-in-chief, The Highway Star   http://www.deep-purple.com
  Apache, mod_perl, MySQL, Sybase hired gun for, well, hire
  -