Re: performance regarding mod_perl vs mod_c with embedded perl

2002-09-24 Thread Igor Sysoev

On Wed, 18 Sep 2002, Peter Bi wrote:

 Problem in authentication:  if mod_perl returns cached header and the
 document is proxy cached in the plain Apache, the backend authentication
 handler (in the mod_perl server) will not be able to protect it.

If you use HTTP Basic authentication then response to request
with Authorization header will never be cached by mod_proxy or mod_accel.
However mod_accel can ignore Authorization header by per location/files basis.


Igor Sysoev
http://sysoev.ru




ModPerl and Net::Z3950

2002-09-24 Thread Ian Stuart

We are using Apache/1.3.26 (on a Sun Solaris box), with mod_perl/1.27,
in an ASP/Event-driven service that does Z39:50 database queries to get
the data.

We have been getting errors saying that the connection dies, causing
Net/Z3950/Manager.pm to die.

This problem occurs randomly, and we cannot work out if it is
time-the-servers-been-up-based or number-of-connections-to-date-based.
We *do* know that the problem is cleared if we do a graceful restart of
the apache server.

So:
1) Has anyone successfully used Net/Z3950 in a mod_perl environment?
2) Has anyone tried, met a similar (and unresolvable?) problem?
3) Has anyone had a similar problem, and solved it a different way?

In anticipation...

-- 
--==++
Ian Stuart: Edinburgh University Data Library.

Information is not knowledge
Knowledge is not wisdom
Wisdom is not truth
Truth is not beauty
Beauty is not love
Love is not music
  -- Mary.

 Personal web site: http://lucas.ucs.ed.ac.uk/ 




mod perl and apache with ssl and openssl

2002-09-24 Thread Allan P. Magmanlac

Hello,

   Can anyone advise me on how to build
apache server with ssl and openssl and
using mod perl.

this is how I do it WITHOUT mod perl support
cd to modssl soure directory and then run the following command
./configure \
--with-apache=../apache_1.3.26 \
--with-ssl=../openssl-0.9.6g  \
--prefix=/usr/local/root/httpd_1.3.26 \
--with-crt=/usr/local/root/httpd/usr/local/www/conf/ssl.crt/server.crt \
--with-key=/usr/local/root/httpd/usr/local/www/conf/ssl.key/server.key \
--enable-module=proxy

So how would I do it WITH mod perl support. (exact commands would
be appreciated)

Thanks




Re: Image Problem

2002-09-24 Thread Ged Haywood

Hi there,

On Tue, 24 Sep 2002, AdItYa wrote:

 I'm using httpd -l then mod_perl is in the list.
 
 Then I starting Apache, and run Test Page, but the image/icons cannot
 display just x (unknown.gif). 
 I'm using standard httpd.conf from instalation, without editing.

What does it say in the error_log?

73,
Ged.




Re: ModPerl and Net::Z3950

2002-09-24 Thread Ged Haywood

Hi there,

On 24 Sep 2002, Ian Stuart wrote:

 We are using Apache/1.3.26 (on a Sun Solaris box), with mod_perl/1.27,
[snip]
 getting errors saying that the connection dies
[snip]
 
 This problem occurs randomly,

I rather doubt that... :)

[snip]
 problem is cleared if we do a graceful restart
[snip]
 1) Has anyone successfully used Net/Z3950 in a mod_perl environment?
 2) Has anyone tried, met a similar (and unresolvable?) problem?
 3) Has anyone had a similar problem, and solved it a different way?

No, no and almost everybody in that order :).  Have you tried
adjusting the value of MaxRequestsPerChild to see if it helps?

73,
Ged.




Re: Documentation for Apache::exit()?

2002-09-24 Thread Francisco Corella

Hi Ged,

 Sorry it took a long time to reply.  Been to Spain.

Thanks for replying.  I hope you had a good time in my old country :-)

 If you're writing new code then I would recommend writing handlers and
 avoiding Apache::Registry altogether.

I had been thinking about whether to do this.  Why do you recommend avoiding
Apache::Registry?  Is there a performance penalty for using it?

Thanks,

Francisco

---
Francisco Corella
[EMAIL PROTECTED]




PATCH Apache::Status.pm

2002-09-24 Thread Dan Sully

This makes the syntax tree dump work for Apache::Status

--- lib/Apache/Status.pm.orig   Tue May 28 09:33:28 2002
+++ lib/Apache/Status.pmTue Sep 24 12:09:56 2002
 -345,6 +345,7 
 
 sub noh_b_terse {
 my $r = shift;
+return unless eval { require B::Terse };
 $r-send_http_header(text/plain);
 no strict 'refs';
 my($arg, $name) = (split /, $r-uri)[-2,-1];

-D
-- 
You know, for kids.



Re: Error compiling mod_perl/1.27/Apache-1.3.26/Perl-5.8.0 for Native Win32

2002-09-24 Thread Issac Goldstand

Worked.  Thanks.

  Issac
- Original Message -
From: Randy Kobes [EMAIL PROTECTED]
To: Issac Goldstand [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, September 23, 2002 1:37 AM
Subject: Re: Error compiling mod_perl/1.27/Apache-1.3.26/Perl-5.8.0 for
Native Win32


 On Sun, 22 Sep 2002, Issac Goldstand wrote:

  I keep getting the following error when compiling mod_perl under
MS-Dev-6.0
 
  Constants.xs(158) : error C2065: 'errno' : undeclared identifier
 
  It's the only compilation error I'm stuck on, but I've been stuck for 2
  weeks now...  Everything is natively built for Win32 from source (read:
no
  activestate, no binary packages)
 
  HELP!!!  (I'm not going to include other files in this post, as I have
no
  idea what is needed - it's my first production Win32 Apache/Perl system
and
  I'm floundering a lot during compilation)
 
Issac

 I don't have this problem with the cvs mod_perl sources - maybe
 try giving those a shot.

 --
 best regards,
 randy kobes





Re: mod perl and apache with ssl and openssl

2002-09-24 Thread Brian Hirt

here's a simple script i use to build one of my servers, it builds
openssl, and apache with mod_ssl / mod_perl

On Tue, 2002-09-24 at 09:07, Allan P. Magmanlac wrote:
 Hello,
 
Can anyone advise me on how to build
 apache server with ssl and openssl and
 using mod perl.
 
 this is how I do it WITHOUT mod perl support
 cd to modssl soure directory and then run the following command
 ./configure \
 --with-apache=../apache_1.3.26 \
 --with-ssl=../openssl-0.9.6g  \
 --prefix=/usr/local/root/httpd_1.3.26 \
 --with-crt=/usr/local/root/httpd/usr/local/www/conf/ssl.crt/server.crt \
 --with-key=/usr/local/root/httpd/usr/local/www/conf/ssl.key/server.key \
 --enable-module=proxy
 
 So how would I do it WITH mod perl support. (exact commands would
 be appreciated)
 
 Thanks



# build script
#

export MOD_PERL=mod_perl-1.27
export MOD_PERL_TGZ=${MOD_PERL}.tar.gz

export MOD_SSL=mod_ssl-2.8.10-1.3.26
export MOD_SSL_TGZ=${MOD_SSL}.tar.gz

export OPENSSL=openssl-0.9.6g
export OPENSSL_TGZ=${OPENSSL}.tar.gz
export OPENSSL_PREFIX=/usr/local
export SSL_BASE=../${OPENSSL}

export APACHE=apache_1.3.26
export APACHE_TGZ=${APACHE}.tar.gz
export APACHE_SRC=../$APACHE/src;
export APACHE_PREFIX=/usr

rm -rf $APACHE
rm -rf $MOD_PERL
rm -rf $OPENSSL
rm -rf $MOD_SSL

gunzip  $OPENSSL_TGZ | tar xfop -
gunzip  $APACHE_TGZ | tar xfop -
gunzip  $MOD_SSL_TGZ | tar xfop -
gunzip  $MOD_PERL_TGZ | tar xfop -

cd $OPENSSL
./config --prefix=$OPENSSL_PREFIX
make  make install

cd ../$MOD_SSL
./configure \
--with-apache=../$APACHE \
--with-ssl=../$OPENSSL \
--with-crt=$APACHE_PREFIX/conf/ssl.crt/server.crt \
--with-key=$APACHE_PREFIX/conf/ssl.key/server.key \
--prefix=$APACHE_PREFIX



cd ../$MOD_PERL

perl Makefile.PL \
APACHE_PREFIX=$APACHE_PREFIX \
APACHE_SRC=../$APACHE/src \
DO_HTTPD=1 \
USE_APACI=1 \
EVERYTHING=1 \
APACI_ARGS=' --enable-module=so, \
--enable-module=ssl, \
--enable-module=proxy, \
--disable-module=imap, \
--disable-module=cgi, \
--disable-module=asis, \
--disable-module=autoindex, \
--disable-module=actions, \
--enable-module=info, \
--enable-module=usertrack'

make  make install



Re: Documentation for Apache::exit()?

2002-09-24 Thread Ged Haywood

Hi Francisco,

On Tue, 24 Sep 2002, Francisco Corella wrote:

 Thanks for replying.  I hope you had a good time in my old country :-)

You probably saw the reports on the news about roads being washed away
by the rain in Sevilla.  I went on a motor-cycle.  Camping.

  If you're writing new code then I would recommend writing handlers and
  avoiding Apache::Registry altogether.
 
 Why do you recommend avoiding Apache::Registry?

Apache::Registry is essentially just to get you going with mod_perl
and your old CGI scripts.  See for example mod_perl_traps.pod which deals
with some of the 'gotchas' that you can run into.  You can make better
use of the Perl API using handlers.  (Of course you might not need to.:)

 Is there a performance penalty for using it?

Handlers can be faster, yes, but since you get such a big performance
boost from mod_perl to begin with it's not usually serious.  Read the
the Eagle Book, the mod_perl Guide and the mod_perl CookBook.  (That
will take you most of the rest of the year...:)  The details are on
the mod_perl home page.

73,
Ged.




Prototypes and $r

2002-09-24 Thread Ken Miller

Got a phone call yesterday from a user who was complaining that every few
times a link was clicked on they were getting an Internal Server Error.
They could click back, try again, and be successful.  Further investigation
led me to find that one of the instances of my back end server was always
generating an error.

Restarts would not fix the problem - one or two of the app servers would
always throw errors

The error was this:

[Mon Sep 23 19:12:21 2002] [error] Can't call method dir_config on an
undefined value at /webroot/lib/Husky/Web/Apache
/MasonHandler.pm line 68.

The line in question is this:

my $appl_id = $r-dir_config( 'ApplID' );

So, you can see that '$r' was undefined.

The interesting thing is that the handler that's invoked for this request
has a prototype:

sub handler( $$ ) { my $class = shift; my $r = shift; ... }

and the handler is either invoked by Apache directly, or from internal logic
when a request is passed off.  The handler is invoked in one of two ways:

  __PACKAGE__-a_method_name( $r );

or

Foo::Bar::Bah-a_method_name( $r );

Now, it appears that every now and then the class reference is NOT being
sent; hence, $class actually contains $r, and $r is undefined.  This is
obviously bad, since $r-dir_config dies a horrible death.

Has anyone had a problem with this?  Is there something that might give me a
clue as to why this is failing?  In the meantime, I've when back to
referencing the sub directly, as opposed to going through the class.  It
works, but it's not as nice as a class method...

Cheers!

-klm.

+-+-+
| Kenneth (Ken) L. Miller | There are 10 kinds of people in the |
| Shetland Software Services Inc. | world: Those who understand binary, |
| [EMAIL PROTECTED]| and those who don't. (unknown)  |
+-+-+




modules and pragmas - part II

2002-09-24 Thread pilsl

Thnx for all the people contributing in the previous thread which gave
me deeper insight and a very easy solution ($CGI::XHTML = 0;)

But now I played around and found out that if loading a modules with
pragmas this pragma only is valid for the first call and not valid for
all further call.

I wrote a tiny script to show this:

--
#!/usr/bin/perl -w
 
use CGI qw(standard -no_xhtml);
 
my $q=new CGI;
print $q-header,$q-start_html,\n;
print $$,\n;
--

At the first request each instance prints out the no_xhtml-header, but
at the second call the no_xhtml-pragma is forgotten and the
xhtml-header is printed out.

Is this a problem in the CGI-module or is there a deeper reason for
this in mod_perl ?

btw and OT : in the previous thread there have been rumours about
better things than the CGI-module. What could you recommend instead ?
(compatible modules prefered cause I really use the sticky- and
nostickyfeatures :)

thnx,
peter





-- 
mag. peter pilsl
IT-Consulting
tel: +43-699-1-3574035
fax: +43-699-4-3574035
[EMAIL PROTECTED]



RE: Documentation for Apache::exit()?

2002-09-24 Thread Kyle Oppenheim

  If you're writing new code then I would recommend writing handlers and
  avoiding Apache::Registry altogether.

 I had been thinking about whether to do this.  Why do you
 recommend avoiding
 Apache::Registry?  Is there a performance penalty for using it?

We sometimes use Apache::Registry scripts to implement a simple MVC model
(look back in the archives for about a thousand different implementations of
MVC using mod_perl!).  Perl modules are the model, the Apache::Registry
scripts are the controller, and a template provides the view.  It keeps our
configuration brain-dead since there are no PerlModule directives other than
Apache::Registry.

There are a few performance penalties when using Apache::Registry:

* Scripts are compiled at first request instead of server start unless you
use something like Apache::RegistryLoader.  So, the first request per child
will be a little bit slower and you don't get to share memory between httpd
children.  (Memory sharing can be a big problem.)

* Every request runs through Apache::Registry::handler before your script
gets called which has overhead including some setup code, an extra stat(),
and a chdir().  (PerlRun and RegistryNG uses $r-finfo but Registry does an
extra stat() -- not sure if there's a reason for that.)

- Kyle




Re: modules and pragmas - part II

2002-09-24 Thread Perrin Harkins

[EMAIL PROTECTED] wrote:
 At the first request each instance prints out the no_xhtml-header, but
 at the second call the no_xhtml-pragma is forgotten and the
 xhtml-header is printed out.

Are you setting $CGI::XHTML to 0 somewhere?

 btw and OT : in the previous thread there have been rumours about
 better things than the CGI-module. What could you recommend instead ?
 (compatible modules prefered cause I really use the sticky- and
 nostickyfeatures :)

There are many.  The most compatible is CGI::Simple.  If you need CGI 
stuff but not the HTML generation, you can use Apache::Request or CGI_Lite.

- Perrin




Re: Prototypes and $r

2002-09-24 Thread Michael Johnson

What does MasonHandler actually look like?

-mj

On Tue, 24 Sep 2002, Ken Miller wrote:

 Got a phone call yesterday from a user who was complaining that every few
 times a link was clicked on they were getting an Internal Server Error.
 They could click back, try again, and be successful.  Further investigation
 led me to find that one of the instances of my back end server was always
 generating an error.

 Restarts would not fix the problem - one or two of the app servers would
 always throw errors

 The error was this:

 [Mon Sep 23 19:12:21 2002] [error] Can't call method dir_config on an
 undefined value at /webroot/lib/Husky/Web/Apache
 /MasonHandler.pm line 68.

 The line in question is this:

 my $appl_id = $r-dir_config( 'ApplID' );

 So, you can see that '$r' was undefined.

 The interesting thing is that the handler that's invoked for this request
 has a prototype:

 sub handler( $$ ) { my $class = shift; my $r = shift; ... }

 and the handler is either invoked by Apache directly, or from internal logic
 when a request is passed off.  The handler is invoked in one of two ways:

   __PACKAGE__-a_method_name( $r );

 or

 Foo::Bar::Bah-a_method_name( $r );

 Now, it appears that every now and then the class reference is NOT being
 sent; hence, $class actually contains $r, and $r is undefined.  This is
 obviously bad, since $r-dir_config dies a horrible death.

 Has anyone had a problem with this?  Is there something that might give me a
 clue as to why this is failing?  In the meantime, I've when back to
 referencing the sub directly, as opposed to going through the class.  It
 works, but it's not as nice as a class method...

 Cheers!

 -klm.

 +-+-+
 | Kenneth (Ken) L. Miller | There are 10 kinds of people in the |
 | Shetland Software Services Inc. | world: Those who understand binary, |
 | [EMAIL PROTECTED]| and those who don't. (unknown)  |
 +-+-+





Re: mod perl and apache with ssl and openssl

2002-09-24 Thread Mike P. Mikhailov

Hello Allan P. Magmanlac,

Tuesday, September 24, 2002, 9:07:55 PM, you wrote:

APM Hello,

APMCan anyone advise me on how to build
APM apache server with ssl and openssl and
APM using mod perl.

APM this is how I do it WITHOUT mod perl support
APM cd to modssl soure directory and then run the following command
APM ./configure \
APM --with-apache=../apache_1.3.26 \
APM --with-ssl=../openssl-0.9.6g  \
APM --prefix=/usr/local/root/httpd_1.3.26 \
APM --with-crt=/usr/local/root/httpd/usr/local/www/conf/ssl.crt/server.crt \
APM --with-key=/usr/local/root/httpd/usr/local/www/conf/ssl.key/server.key \
APM --enable-module=proxy

APM So how would I do it WITH mod perl support. (exact commands would
APM be appreciated)

APM Thanks

Look at INSTALL file in the mod_ssl distribution directory. It contains
an example which describes actions needed to build apache with
mod_ssl and mod_perl support. I'm using these instructions without any
problem (RH7.2 on i686). The topic is 'Example', subtopic called 'Apache +
mod_ssl/OpenSSL + mod_perl/Perl'.

Good luck :)


-- 
WBR, Mike P. Mikhailov
mailto:[EMAIL PROTECTED]

This seems dangerously close to COBOL,something difficult to argue in favor of.