Re: piggybacking data on request ?

1999-12-12 Thread Stas Bekman

> Hi everybody!
> 
> I am looking for way to pass data (e.g. hash reference)
> from one handler (e.g. from URI Translation to Response).
> 
> Probably I could derive from Apache request class, and
> pass data on the request. Or there is simpler way to
> do this?

http://perl.apache.org/guide/porting.html#Passing_and_preserving_custom_da

___
Stas Bekmanmailto:[EMAIL PROTECTED]  http://www.stason.org/stas
Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC
perl.apache.orgmodperl.sourcegarden.org   perlmonth.comperl.org
single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com



Re: ANNOUNCE: Apache::SafeHang

1999-12-12 Thread Stas Bekman

> >Interesting. Actually that's why I'm not releasing it yet. I've packaged
> >it so it would be easier for you to install and try it. But yes, the name
> >isn't final and your suggestions sounds like a better one. 
> >
> >The question is: what other functionality would you like to see?
> 
> Hmm - well, if it's polling the server every so often, it might as well
> generate a periodic report of what it finds.  How many processes, how long each
> has been running, how much memory, etc.

That's what Apache::VMonitor is doing.


___
Stas Bekmanmailto:[EMAIL PROTECTED]  http://www.stason.org/stas
Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC
perl.apache.orgmodperl.sourcegarden.org   perlmonth.comperl.org
single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com



Re: piggybacking data on request ?

1999-12-12 Thread Eric L. Brine


> I am looking for way to pass data (e.g. hash reference)
> from one handler (e.g. from URI Translation to Response).

If the data is request-specific, look into $r->notes() and $r->pnotes().
I don't know what the difference is, but at least one of them does what
you want.

ELB

--
Eric L. Brine  |  Chicken: The egg's way of making more eggs.
[EMAIL PROTECTED]  |  Do you always hit the nail on the thumb?
ICQ# 4629314   |  An optimist thinks thorn bushes have roses.



Re: piggybacking data on request ?

1999-12-12 Thread Ask Bjoern Hansen

On 12 Dec 1999, Evgenii Bazarov wrote:

> I am looking for way to pass data (e.g. hash reference)
> from one handler (e.g. from URI Translation to Response).

Look at the $r->pnotes method (need v1.20+ to have it documented, but it 
have worked since v1.18).


  - ask

-- 
ask bjoern hansen - 
more than 60M impressions per day, 



more then one PerlTransHandler

1999-12-12 Thread Evgenii Bazarov

Hi!

I tried to set more then one PerlTransHandler but
if I specify both on the same line, Apache says
"syntax error", otherwise it see only the last one.

Apache 1.3.6 on Linux with mod_perl 1.19

According to "Apache Modules" book it should be
possible... Any advice will be highly appreciated!

Cheers,
Evg


Get free email and a permanent address at http://www.netaddress.com/?N=1



piggybacking data on request ?

1999-12-12 Thread Evgenii Bazarov

Hi everybody!

I am looking for way to pass data (e.g. hash reference)
from one handler (e.g. from URI Translation to Response).

Probably I could derive from Apache request class, and
pass data on the request. Or there is simpler way to
do this?

Cheers,
Evg


Get free email and a permanent address at http://www.netaddress.com/?N=1



RE: EmbPerl use HTML::Embperl failed

1999-12-12 Thread Gerald Richter

>
> "nmake test" did (and does) not work correct !!!

First nmake test must run correct, then I guess we have the reason, why
offline mode doesn't work

>
> "nmake test" produces:
>
> Microsoft (R) Program Maintenance-Dienstprogramm: Version 6.00.8168.0
> Copyright (C) Microsoft Corp 1988-1998. Alle Rechte vorbehalten.
>
>  SET
> PATH=C:\MVS\COMMON\msdev98\BIN;C:\MVS\VC98\BIN;C:\MVS\COMMON\TOOLS
> \WIN95;C:\
> MVS\COMMON\TOOLS;C:\WINDOWS\SYSTEM;C:\PATH;C:\APACHE\;C:\PERL5\5.0
> 0561\BIN\M
> SWIN32-X86;C:\PERL5\5.00561\BIN;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\4
> NT;C:\IBMV
> JAVA\EAB\BIN;C:\JDK1.1\BIN;C:\PROGRA~1\ULTRAEDT;C:\PROGRAMME\MTS;C
> :\IFOR\WIN
> \BIN;C:\IFOR\WIN\BIN\DE_DE;C:\IFOR\WIN\BIN;C:\IFOR\WIN\BIN\DE_DE;C
> :\IMNNQ_95
> ;c:/apache/apache_1.3.9/src/CoreR
>

>
> As you see in "nmake test", inside the PATH there is "c:\apache\" where
> ApacheCore.dll resides so what's wrong?
> Anything in my Perl-Configuration? Here it is:
>

Embperl is linked against the
c:\apache\apache_1.3.9\src\CoreR\ApacheCore.dll and I guess the
ApacheCore.dll in c:\apache and c:\apache\apache_1.3.9\src\CoreR are not the
same. Is this possible? As you see from the path nmake test adds the
location where it "thinks" ApacheCore.dll could be found to the end of the
path, but because c:\apche is in your path, this one will be found first.


> 
>
> "perl -V" produces:
>
> Summary of my perl5 (revision 5.0 version 5 subversion 61) configuration:

I didn't try perl 5.005_61 (the highest was _57), I don't think so (because
it work under mod_perl), but maybe there could be another problem.

Gerald
-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925151
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-



Getting/storing big text

1999-12-12 Thread mjhns

Hi,

Can folks please tell me what's the best way to pass large-ish amounts of
data between invocations of a CGI script. I want to solicit large-ish
sections of text and store them in a database. (So friends can maintain
their own web-pages.)

As I understand it, the user fills out the form (in my case, one of these
fields might contain several k of text), presses a button to submit, then
the CGI script is resubmitted to the server, then and only then can the
text be written to the database. I've mostly used param fields to pass
information between invocations of the script. But I've heard a rumor that
this might not work well, or possibly at all, if one of the parameters is,
say, 3k of (html) text.

I've also heard that with mod_perl there's some way to store info inside
server memory. Is this recommended? At what size of text?

All suggestions will be gratefully received.

Mike H

Thanks for your help




Re: Can you get the mod_perl performance gains under NT?

1999-12-12 Thread Bill


   Check out FastCGI (http://www.fastcgi.com/) for what looks 
like a pretty good, language-independent and 
server-independent (as long as the server supports 
FastCGI) solution. I think that http://www.fastengines.com/
sells a FastCGI thingy for IIS.

- Bill

Scott Chapman wrote:
> 
> It seems that mod_perl is _wonderful_ for gaining performance
> improvements under UNIX.
> 
> Can these types of performance gains be done under Windows NT?
> 
> What technologies/produts do this on NT?
> 
> It doesn't appear that a person can put mod_perl under IIS!
> 
> - CGI language interpreter loading with web server
> - CGI is done directly to the web server API
> - Code compiled to PCode and PCode subsequently executed
> - Persistent database connections
> 
> - Did I miss any and do I have these right?
> 
> --
> Scott Chapman
> Technical Support Specialist
> Lund Performance Solutions
> [EMAIL PROTECTED] or [EMAIL PROTECTED]
> Phone: 541-926-3800 www.lund.com



Re: ANNOUNCE: Apache::SafeHang

1999-12-12 Thread Ken Williams

[EMAIL PROTECTED] (Stas Bekman) wrote:
>> [EMAIL PROTECTED] (Stas Bekman) wrote:
>> >Regading Apache::SafeHang, I'll wait for your comments before I upload it
>> >to CPAN. Please try to use it.
>> 
>> If this might become a more general utility, you might want to give
>> it a more general name like Apache::Watchdog or something so it has
>> room to grow. SafeHang kind of sounds like it might have something to
>> do with the Safe.pm module, too.
>
>Interesting. Actually that's why I'm not releasing it yet. I've packaged
>it so it would be easier for you to install and try it. But yes, the name
>isn't final and your suggestions sounds like a better one. 
>
>The question is: what other functionality would you like to see?

Hmm - well, if it's polling the server every so often, it might as well
generate a periodic report of what it finds.  How many processes, how long each
has been running, how much memory, etc.

Personally I find my Apache processes to be pretty well-behaved, so I'm not
speaking of actual needs I have, but rather just neat features you might add.


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum




Re: ANNOUNCE: Apache::SafeHang

1999-12-12 Thread Stas Bekman

> [EMAIL PROTECTED] (Stas Bekman) wrote:
> >Regading Apache::SafeHang, I'll wait for your comments before I upload it
> >to CPAN. Please try to use it.
> 
> If this might become a more general utility, you might want to give it a more
> general name like Apache::Watchdog or something so it has room to grow. 
> SafeHang kind of sounds like it might have something to do with the Safe.pm
> module, too.

Interesting. Actually that's why I'm not releasing it yet. I've packaged
it so it would be easier for you to install and try it. But yes, the name
isn't final and your suggestions sounds like a better one. 

The question is: what other functionality would you like to see?

Thanks
___
Stas Bekmanmailto:[EMAIL PROTECTED]  http://www.stason.org/stas
Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC
perl.apache.orgmodperl.sourcegarden.org   perlmonth.comperl.org
single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com



Re: ANNOUNCE: Apache::SafeHang

1999-12-12 Thread Ken Williams

[EMAIL PROTECTED] (Stas Bekman) wrote:
>Regading Apache::SafeHang, I'll wait for your comments before I upload it
>to CPAN. Please try to use it.

If this might become a more general utility, you might want to give it a more
general name like Apache::Watchdog or something so it has room to grow. 
SafeHang kind of sounds like it might have something to do with the Safe.pm
module, too.


  ------
  Ken Williams Last Bastion of Euclidity
  [EMAIL PROTECTED]The Math Forum




Re: Book: guestbook.cgi

1999-12-12 Thread Aaron Turner

On Sun, 12 Dec 1999, Michael Dearman wrote:

> 
> Spotted this
> 
> sub view_guestbook {
>   my $show_sign_button = shift;
>   print start_form,
>   submit(-name => 'Sign Guestbook'),   <<<
>   end_form if $show_sign_button;
>   ...
> 
> changed to
>   submit(-name => 'action', -value => 'Sign Guestbook'),

[snip]

> Could someone please confirm if this is the code in their book?
> (book == Writing Apache Modules with Perl and C, March 1999 -
> first edition.)
> 

On both page 158 and 154, it's:
submit(-name => 'Sign Guestbook'),

--
Aaron Turner, Core Developer   http://vodka.linuxkb.org/~aturner/
Linux Knowledge Base Organization  http://linuxkb.org/
Because world domination requires quality open documentation.
aka: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]



Re: Book: guestbook.cgi

1999-12-12 Thread Michael Dearman


Spotted this

sub view_guestbook {
my $show_sign_button = shift;
print start_form,
submit(-name => 'Sign Guestbook'),   <<<
end_form if $show_sign_button;
...

changed to
submit(-name => 'action', -value => 'Sign Guestbook'),

And at least the forms behave correctly. Still not sure
if the many logs about subroutine redefines should be happening.

Could someone please confirm if this is the code in their book?
(book == Writing Apache Modules with Perl and C, March 1999 -
first edition.)

Thanks for your patience,
M. Dearman



Book: guestbook.cgi

1999-12-12 Thread Michael Dearman

I've copied example 4-15 and multi-checked it, for the
past couple of days. Finally used a copy of the example
obtained from the book site. But still have problems.

[note: the example from the book sight used strftime(time, '%D')
in sub write_guestbook. Changing that to strftime('%D', localtime)
helped]

Using apache 1.3.9 and mod_perl 1.21.

With 'use strict' there is this error:
Can't use string ("1") as a symbol ref while "strict refs" in use 
at .

That's a 1 (one) used by 'sub lock()', given as the second arg
as a flag to turn on an exclusive lock on the file.

There are other warnings, and another error when I comment out
'use strict' - like:
Can't call method "close" without a package or object reference at ...

But any help on that first error would be appreciated.

I've tried this script in the cgi-bin dir and a perl/ dir I've used
to run all the other example .pl scripts. In each dir the .htaccess
file given in the book was used. Permissions checked. But just to make
sure, a PerlSetVar GuestbookFile /usr/local/apache/projects/guests.txt
was added to the appropriate directives in httpd.conf for the
the cgi-bin directory, and in the perl.conf for the perl dir.

in httpd.conf

AllowOverride All   # added this
Options None
Order allow,deny
Allow from all
PerlSetVar GuestbookFile /usr/local/apache/projects/guests.txt # added
this


in perl.conf
Alias /perl/ /usr/local/apache/perl/

AllowOverride All
SetHandler  perl-script
PerlHandler Apache::Registry
PerlSendHeader  On
Options +ExecCGI
PerlSetVar  GuestbookFile /usr/local/apache/projects/guests.txt


Or where and how should I be trying to run this script?

Appreciate any help.
Thanks,
M. Dearman



$r->handler returning undef

1999-12-12 Thread Bill Moseley

I'm wondering why $r->handler returns undef for perl-script handlers.

I'd like to be able to tally the number of requests by type: perl-script,
cgi-script, and other (.html, image) requests.  $r->handler returns
cgi-script as expected, but returns undef for perl-script.

I'm checking $r->handler in a PerlLogHandler.

I was also looking to further break down the perl-script requests.  I
looked into using $r->current_callback() in a PerlDisapatchHandler, but I'm
unclear how to continue processing the request when the PerlDispatchHandler
is passed a module name instead of a code reference.

What I'm really after is an idea of what percent of requests require mod_perl.

Any suggestions? 

Bill Moseley
mailto:[EMAIL PROTECTED]



ANNOUNCE: Apache::SafeHang

1999-12-12 Thread Stas Bekman

Hi,

This is a new module. Please evaluate it.

Basically it kills off the processes that are running for too long (you
control the timeout). If you have a problem of hanging processes, this
module is for you. If you encounter a problem of hanging processes on your
production server -- use this module to keep the server up, while
debugging the problem on your development server.

You can use either a Perl API or a hangmon perl utility that comes bundled
with Apache::SafeHang and allows you to start/stop/restart the monitor
just like apachectl does. 

Do:

  perldoc Apache::SafeHang
  perldoc hangmon 

for indepth explanation.

The PAUSE server is down so grab it from my server:
http://www.singlesheaven.com/stas/modules/Apache-SafeHang-0.01.tar.gz

A new Apache::VMonitor is available as well (not yet on CPAN!):
http://www.singlesheaven.com/stas/modules/Apache-VMonitor-0.04.tar.gz

Regading Apache::SafeHang, I'll wait for your comments before I upload it
to CPAN. Please try to use it.

Comments are welcome.

Enjoy!

___
Stas Bekmanmailto:[EMAIL PROTECTED]  http://www.stason.org/stas
Perl,CGI,Apache,Linux,Web,Java,PC http://www.stason.org/stas/TULARC
perl.apache.orgmodperl.sourcegarden.org   perlmonth.comperl.org
single o-> + single o-+ = singlesheavenhttp://www.singlesheaven.com