cvs commit: modperl-2.0/ModPerl-Registry/t special_blocks.t

2002-05-14 Thread stas

stas02/05/14 08:47:12

  Modified:ModPerl-Registry/t/cgi-bin special_blocks.pl
   ModPerl-Registry/t special_blocks.t
  Log:
  - use Apache::RequestRec
  - move away from Apache::compat, meaning $r-args is a string
  
  Revision  ChangesPath
  1.3   +3 -3  modperl-2.0/ModPerl-Registry/t/cgi-bin/special_blocks.pl
  
  Index: special_blocks.pl
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/special_blocks.pl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- special_blocks.pl 21 Oct 2001 06:58:24 -  1.2
  +++ special_blocks.pl 14 May 2002 15:47:12 -  1.3
   -1,6 +1,7 
   #!perl -w
   
   # test BEGIN/END blocks
  +use Apache::RequestRec ();
   
   use vars qw($query);
   $query = '' unless defined $query;
   -12,8 +13,7 
   print Content-type: text/plain\r\n\r\n;
   
   my $r = shift;
  -my %args = $r-Apache::args;
  -our $test = exists $args{test} ? $args{test} : '';
  +our $test = $r-args || '';
   
   if ($test eq 'uncache') {
   # mark the script as non-cached for the next execution
   -21,7 +21,7 
   ModPerl::RegistryCooker::uncache_myself();
   }
   elsif ($test eq 'begin') {
  -print begin ok if $query eq 'test=begin';
  +print begin ok if $query eq 'begin';
   # reset the global
   $query = '';
   }
  
  
  
  1.3   +10 -10modperl-2.0/ModPerl-Registry/t/special_blocks.t
  
  Index: special_blocks.t
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/special_blocks.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- special_blocks.t  21 Oct 2001 06:53:28 -  1.2
  +++ special_blocks.t  14 May 2002 15:47:12 -  1.3
   -27,25 +27,25 
   
   ok t_cmp(
begin ok,
  - req($same_interp, $url?test=begin),
  + req($same_interp, $url?begin),
$modules{$alias} is running BEGIN blocks on the first req,
   );
   
   ok t_cmp(
begin ok,
  - req($same_interp, $url?test=begin),
  + req($same_interp, $url?begin),
$modules{$alias} is running BEGIN blocks on the second req,
   );
   
   ok t_cmp(
end ok,
  - req($same_interp, $url?test=end),
  + req($same_interp, $url?end),
$modules{$alias} is running END blocks on the first req,
   );
   
   ok t_cmp(
end ok,
  - req($same_interp, $url?test=end),
  + req($same_interp, $url?end),
$modules{$alias} is running END blocks on the second req,
   );
   }
   -60,32 +60,32 
   my $same_interp = Apache::TestRequest::same_interp_tie($url);
   
   # clear the cache of the registry package for the script in $url
  -req($same_interp, $url?test=uncache);
  +req($same_interp, $url?uncache);
   
   ok t_cmp(
begin ok,
  - req($same_interp, $url?test=begin),
  + req($same_interp, $url?begin),
$modules{$alias} is running BEGIN blocks on the first req,
   );
   
   ok t_cmp(
,
  - req($same_interp, $url?test=begin),
  + req($same_interp, $url?begin),
$modules{$alias} is not running BEGIN blocks on the second req,
   );
   
   # clear the cache of the registry package for the script in $url
  -req($same_interp, $url?test=uncache);
  +req($same_interp, $url?uncache);
   
   ok t_cmp(
end ok,
  - req($same_interp, $url?test=end),
  + req($same_interp, $url?end),
$modules{$alias} is running END blocks on the first req,
   );
   
   ok t_cmp(
end ok,
  - req($same_interp, $url?test=end),
  + req($same_interp, $url?end),
$modules{$alias} is running END blocks on the second req,
   );
   
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t/cgi-bin require.pl

2002-05-14 Thread stas

stas02/05/14 08:53:05

  Modified:ModPerl-Registry/t/cgi-bin require.pl
  Log:
  this test is temporary becoming TODO, need to solve the require() relative
  to the script's dir problem.
  
  Revision  ChangesPath
  1.2   +6 -4  modperl-2.0/ModPerl-Registry/t/cgi-bin/require.pl
  
  Index: require.pl
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/require.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- require.pl9 Oct 2001 12:47:38 -   1.1
  +++ require.pl14 May 2002 15:53:05 -  1.2
   -2,8 +2,10 
   
   print Content-type: text/plain\r\n\r\n;
   
  -use lib qw(.);
  -my $file = ./local-conf.pl;
  -require $file;
  +# XXX: fixme!
  +#use lib qw(.);
  +#my $file = ./local-conf.pl;
  +#require $file;
   
  -print defined $test_require  $test_require;
  +#print defined $test_require  $test_require;
  +print it works;
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t/conf extra.conf.in

2002-05-14 Thread stas

stas02/05/14 08:55:21

  Modified:ModPerl-Registry/t/conf extra.conf.in
  Log:
  - must define the INC changes in one touch, or the order becoming
reversed, and that's not what we want.
  - use Apache2 (to cover the case where Apache2/ prefix is needed)
  
  Revision  ChangesPath
  1.4   +10 -6 modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in
  
  Index: extra.conf.in
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- extra.conf.in 13 Nov 2001 04:33:06 -  1.3
  +++ extra.conf.in 14 May 2002 15:55:21 -  1.4
   -3,14 +3,18 
   # make sure that we test under Taint mode
   PerlSwitches -T
   
  +PerlModule Apache2
  +
  +PerlSwitches -Mlib=@ServerRoot/../lib  \
  + -Mlib=@ServerRoot/../../Apache-Test/lib   \
  + -Mlib=@ServerRoot/../../lib   \
  + -Mlib=@ServerRoot/../../blib/lib/Apache2  \
  + -Mlib=@ServerRoot/../../blib/arch/Apache2 \
  + -Mlib=@ServerRoot/../../blib/lib  \
  + -Mlib=@ServerRoot/../../blib/arch
  +
   # run on startup
   PerlRequire ServerRoot/conf/modperl_extra_startup.pl
  -
  -PerlSwitches -Mlib=@ServerRoot/../lib
  -PerlSwitches -Mlib=@ServerRoot/../../Apache-Test/lib
  -PerlSwitches -Mlib=@ServerRoot/../../lib
  -PerlSwitches -Mlib=@ServerRoot/../../blib/lib
  -PerlSwitches -Mlib=@ServerRoot/../../blib/arch
   
    DEVMODE: Remove in production ###
   PerlModule Apache::Reload
  
  
  



Re: Moving from CGI to mod_perl

2002-05-14 Thread Stas Bekman

[Please make sure to post follow-ups to the list! Thanks!]

Anton Permyakov wrote:
 Hi, all.
 
 I have perl CGI-script, and i wanna run it as mod_perl script.
 
 Is it enought to correctly edit only httpd.conf, or i've to add something
 special in my CGI-script? Maybe something like
 
 use Apache::Registry;
 
 or something else
 
 Also is it needed to write some special script like startup.pl or not?
 
 Thank you all, and sorry for this easy question...
 In doc i could not find How to migrate from CGI to mod_perl - step by step
 easy example.


http://perl.apache.org/preview/modperl-docs/dst_html/docs/1.0/guide/getwet.html#Porting_Existing_CGI_Scripts_to_run_under_mod_perl


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: Moving from CGI to mod_perl

2002-05-14 Thread Anton Permyakov

Thank you, Stas.

It's really good place to learn about mod_perl.

Good luck,
Anton

- Original Message -
From: Stas Bekman [EMAIL PROTECTED]
To: Anton Permyakov [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, May 14, 2002 1:17 PM
Subject: Re: Moving from CGI to mod_perl


 [Please make sure to post follow-ups to the list! Thanks!]

 Anton Permyakov wrote:
  Hi, all.
 
  I have perl CGI-script, and i wanna run it as mod_perl script.
 
  Is it enought to correctly edit only httpd.conf, or i've to add
something
  special in my CGI-script? Maybe something like
 
  use Apache::Registry;
 
  or something else
 
  Also is it needed to write some special script like startup.pl or not?
 
  Thank you all, and sorry for this easy question...
  In doc i could not find How to migrate from CGI to mod_perl - step by
step
  easy example.



http://perl.apache.org/preview/modperl-docs/dst_html/docs/1.0/guide/getwet.h
tml#Porting_Existing_CGI_Scripts_to_run_under_mod_perl


 __
 Stas BekmanJAm_pH -- Just Another mod_perl Hacker
 http://stason.org/ mod_perl Guide --- http://perl.apache.org
 mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
 http://modperlbook.org http://apache.org   http://ticketmaster.com




Memory usage option in Apache::Status

2002-05-14 Thread victor

Hope someone can give me a hand on this, I am having some problem using
the Memory Usage option in the main menu of Apache::Status.  

It always return me a 500 with the following error.

[Tue May 14 08:48:21 2002] [error] Can't call method size on unblessed
reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
94.


This is the config I added to httpd.conf to enable the feature.

Location /perl-status
  SetHandler perl-script
  PerlModule Apache::Status
  PerlModule B::TerseSize
  PerlHandler Apache::Status

  PerlSetVar StatusOptionsAll On
  PerlSetVar StatusTerse On
  PerlSetVar StatusTerseSize On
  PerlSetVar StatusTerseSizeMainSummary On
/Location


Any idea what I have missed?


Tor.



Re: Memory usage option in Apache::Status

2002-05-14 Thread Stas Bekman

[EMAIL PROTECTED] wrote:
 Hope someone can give me a hand on this, I am having some problem using
 the Memory Usage option in the main menu of Apache::Status.  
 
 It always return me a 500 with the following error.
 
 [Tue May 14 08:48:21 2002] [error] Can't call method size on unblessed
 reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
 94.

Do you have B::Size installed?

   perl -MB::Size -e1

Can you use TerseSize from the command line?

   perl -MO=TerseSize -e '1'

Also 5.6.0 is *very* buggy, so upgrading to 5.6.1 is a very good idea.


 This is the config I added to httpd.conf to enable the feature.
 
 Location /perl-status
   SetHandler perl-script
   PerlModule Apache::Status
   PerlModule B::TerseSize
   PerlHandler Apache::Status
 
   PerlSetVar StatusOptionsAll On
   PerlSetVar StatusTerse On
   PerlSetVar StatusTerseSize On
   PerlSetVar StatusTerseSizeMainSummary On
 /Location

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: Memory usage option in Apache::Status

2002-05-14 Thread victor

 
 [EMAIL PROTECTED] wrote:
  Hope someone can give me a hand on this, I am having some problem using
  the Memory Usage option in the main menu of Apache::Status.
 
  It always return me a 500 with the following error.
 
  [Tue May 14 08:48:21 2002] [error] Can't call method size on unblessed
  reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
  94.


Thanks for you prompt reply stats.

 
 Do you have B::Size installed?
 
perl -MB::Size -e1
 
 Can you use TerseSize from the command line?
 
perl -MO=TerseSize -e '1'
 

  yes, I have both installed. and here's the return running the command
you gave.


[]$ perl -MB::Size -e1
[]$ perl -MO=TerseSize -e '1'
LISTOP leave 0x818acf0 {36 bytes}
OP enter 0x81c6c90 {24 bytes}

COPnextstate 0x8173900 {24 bytes}
OP null  0x81d6140 {24 bytes} [const - constant item]
-e syntax OK


 Also 5.6.0 is *very* buggy, so upgrading to 5.6.1 is a very good idea.


  Would love to, but it's a production machine, so .. I can't upgrade it
unless something major breaks.  (^_^!)


Tor.



mod_perl: User Authentication recommendations requested

2002-05-14 Thread Jeff AA


I have a requirement to protect all pages on a website, and to only
allow in users with a valid user id, password, client certificate and
recognised IP.

I know this is asking a lot, but I would appreciate an
overview/recommendation of approaches that are 1st safe, and 2nd fast.

I think something like:

Scenario 1: unauthenticated user gets authenticated
1) user hits site - no session = unauthenticated
   create new session, remember requested page, redirect to /login page
2) /login page: collect username/password, POST action is /authenticate
3) /authenticate page: perform checks, if all ok set
$session-is_logged_in(TRUE);
   and redirect to originally requested page [stored in session]

Scenario 2: authenticated user accesses site
1) user hits page - has session
   redirect to /login if ( not $session-is_logged_in() );
   redirect to /login?message=inactivity+timeout if (
time-$session-last_access()1hr );

Which seems to fit the functionality bill - users can bookmark their
favourite part of the system. When they come in but have not yet
authenticated, they get momentarily diverted through the
/login/authenticate pages.

Is this safe? 
How should I ensure that the sessions never get hijacked?

I am thinking along the lines of an additional transient cookie issued
when
the session authenticates the user that contains
md5(some_secret+session_id) that
is also checked?

And... is there already a nifty mod_perl class that does all this? I
have Apache::AuthCookie working from examples, but don't know what the
security implications of using it are, without reading the code [which I
will do soon I guess]. I also have problems with the LOGIN POST saying
POST: METHOD NOT ALLOWED when I try to get mod_perl to be the handler
for Location /.

Any recommendations/feedback appreciated! Even if it's a recipe I
haven't yet reached!

Thanks in advance,
Jeff





RE: mod_perl: User Authentication recommendations requested

2002-05-14 Thread Jeff Armstrong

And then he reads on p360 that there are tantalising recipes in chapter
13...

I would still appreciate the lists thoughts and experience.

-Original Message-
From: Jeff AA [mailto:[EMAIL PROTECTED]] 
Sent: 14 May 2002 09:07
To: [EMAIL PROTECTED]
Subject: mod_perl: User Authentication recommendations requested



I have a requirement to protect all pages on a website, and to only
allow in users with a valid user id, password, client certificate and
recognised IP.

I know this is asking a lot, but I would appreciate an
overview/recommendation of approaches that are 1st safe, and 2nd fast.

I think something like:

Scenario 1: unauthenticated user gets authenticated
1) user hits site - no session = unauthenticated
   create new session, remember requested page, redirect to /login page
2) /login page: collect username/password, POST action is /authenticate
3) /authenticate page: perform checks, if all ok set
$session-is_logged_in(TRUE);
   and redirect to originally requested page [stored in session]

Scenario 2: authenticated user accesses site
1) user hits page - has session
   redirect to /login if ( not $session-is_logged_in() );
   redirect to /login?message=inactivity+timeout if (
time-$session-last_access()1hr );

Which seems to fit the functionality bill - users can bookmark their
favourite part of the system. When they come in but have not yet
authenticated, they get momentarily diverted through the
/login/authenticate pages.

Is this safe? 
How should I ensure that the sessions never get hijacked?

I am thinking along the lines of an additional transient cookie issued
when
the session authenticates the user that contains
md5(some_secret+session_id) that
is also checked?

And... is there already a nifty mod_perl class that does all this? I
have Apache::AuthCookie working from examples, but don't know what the
security implications of using it are, without reading the code [which I
will do soon I guess]. I also have problems with the LOGIN POST saying
POST: METHOD NOT ALLOWED when I try to get mod_perl to be the handler
for Location /.

Any recommendations/feedback appreciated! Even if it's a recipe I
haven't yet reached!

Thanks in advance,
Jeff






Re: $r-args vs $r-content

2002-05-14 Thread Issac Goldstand

Quoting Mike Melillo [EMAIL PROTECTED]:

 
 Hi,
 

 One of the fields is an image file that will be uploaded so I need to
 use POST requests.  Is this a job for Apache::Request?  The eagle book
 doesn't cover it much because it was experimental at the time of
 publishing.
 
There's a version 1.0 out by now.  That means stable as it's ever gonna get :-)
 I use it all the time, go for it!

  Issac


Internet is a wonderful mechanism for making a fool of
yourself in front of a very large audience.
  --Anonymous

Moving the mouse won\'t get you into trouble...  Clicking it might.
  --Anonymous

PGP Key 0xE0FA561B - Fingerprint:
7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B



unable to use method type handlers?

2002-05-14 Thread Jeff AA

Whenever I try to set up a method type handler 

  PerlHandler my::classes-mymethod

I get the following in the error log:

  Undefined subroutine my::classes-mymethod::handler called.

using:
  Apache/1.3.23 (Unix) Debian GNU/Linux 
  mod_perl/1.26 mod_ssl/2.8.7 OpenSSL/0.9.6c

any hints would be appreciated





Re: unable to use method type handlers?

2002-05-14 Thread victor

Try per load the class my::class via startup.pl or PerlModule

Tor.


Jeff AA wrote:
 
 Whenever I try to set up a method type handler
 
   PerlHandler my::classes-mymethod
 
 I get the following in the error log:
 
   Undefined subroutine my::classes-mymethod::handler called.
 
 using:
   Apache/1.3.23 (Unix) Debian GNU/Linux
   mod_perl/1.26 mod_ssl/2.8.7 OpenSSL/0.9.6c
 
 any hints would be appreciated



Re: Memory usage option in Apache::Status

2002-05-14 Thread Stas Bekman

[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:

Hope someone can give me a hand on this, I am having some problem using
the Memory Usage option in the main menu of Apache::Status.

It always return me a 500 with the following error.

[Tue May 14 08:48:21 2002] [error] Can't call method size on unblessed
reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
94.

   yes, I have both installed. 

ok, next trace to the offending code. Put in your startup.pl:

use Carp;
$SIG{__DIE__} = \Carp::confess;

hopefully nobody redefines $SIG{__DIE__}


Also 5.6.0 is *very* buggy, so upgrading to 5.6.1 is a very good idea.
 
 
 
   Would love to, but it's a production machine, so .. I can't upgrade it
 unless something major breaks.  (^_^!)

This is a *major* reason for updating :)


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




RE: mod_perl2: nmake test crashes apache

2002-05-14 Thread Alessandro Forghieri

Greetings.

A few updates...

i) modperl-2.0_20020514042137.tar.gz 
   Now tests cleanly on:
   WinNT SP6/MSDEV 6 SP3/AS perl 5.6.1 b630/httpd-2.0_20020506161223.tar.gz

ii) It does however crash on my testbed app (which runs as standard CGI,
FastCGI and
moperl1). The crash itself appears to happen when a number of
nearly-simultaneous requests
arrive to the server and is fatal to modperl (but the static-serving part of
apache appears to survive)

iia) On non-debug modperl in post-mortem examination within msdev I have
been able to observe a seemingly incorrect r-pool thingy (casted to
something else within table related something_palloc) triggering the
segfault.

iib) I then set out to build a debug version. That ain't easy I finally
got it with
semiautomatic Makefile mangling:

perl Makefile.PL MP_INST_APACHE2=1 MP_AP_PREFIX=D:\Apache2
MP_GENERATE_XS=1 MP_DEBUG=1 MP_TRACE=1 

find . -name Makefile -print   | xargs perl -spi.bak -e
s/-O1//g;s/-DNDEBUG//g;s/-release/-DEBUG -PDB:vc60.pdb/g;

nmake

[Explanation: the generated Makefiles have sequences of -O1 -Od -O1 *AND*
the linkline misses the critical -DEBUG option. the PDB and -DNDEBUG things
may not be needed.]

After this the crash location moves (darn) and the debugger brings me in a
location with nothing obviously wrong in sight. It is wedged on
modperl_get_perl_module_config, called from
XS_Apache_RequestRec_send_cgi_header etc. etc.


Note: After switching to the debug version, I have started 
seeing apache errors - Your script did not blah blah - that were not there
before, coupled to diagnostics from ModPerl::Registry complaining about not
being able to call  send_cgi_header on an undefined value. This may be
significant.


I will sendo more info when I have it...
Cheers,
alf


 



Re: Memory usage option in Apache::Status

2002-05-14 Thread victor


 ok, next trace to the offending code. Put in your startup.pl:
 
 use Carp;
 $SIG{__DIE__} = \Carp::confess;
 
 hopefully nobody redefines $SIG{__DIE__}


ok, this is what I get in the error log 


[Tue May 14 10:38:19 2002] [error] Can't call method size on unblessed
reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
94.
B::AV::size(1, 'B::AV=SCALAR(0xa063444)') called at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 438
B::TerseSize::PADLIST_size('B::CV=SCALAR(0xa0674a0)',
'B::CV=SCALAR(0xa0674a0)', 'B::CV=SCALAR(0xa0674a0)',
'B::CV=SCALAR(0xa0674a0)') called at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 190
B::TerseSize::CV_walk('slow', 'B::NULL::size', 'op_size') called
at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 123
B::TerseSize::package_size('B::NULL') called at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 542
B::TerseSize::apache_package_size('B::HV', 'B::Terse',
'B::SPECIAL', 'B::NULL') called at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 563
B::TerseSize::status_memory_usage('Apache=SCALAR(0x9e4ae5c)',
'CGI=HASH(0x9e4aa8c)') called at
/usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache/Status.pm line 66
Apache::Status::handler('Apache=SCALAR(0x9e4ae5c)') called at
/usr/lib/perl5/5.6.0/Carp.pm line 119
require 0 called at /usr/lib/perl5/5.6.0/Carp.pm line 119


Would love to, but it's a production machine, so .. I can't upgrade it
  unless something major breaks.  (^_^!)
 
 This is a *major* reason for updating :)
 

I will see if I can borrow a testing machine tomorrow to try the
upgrade.

Tor.



RE: automatic redirect to https

2002-05-14 Thread Aaron J Mackey


Yes: simply because I want to be able to install the software at new
sites with minimal httpd.conf twiddling (and the user has a configuration
file in which they can switch on/off the SSL requirement).

Thanks for the easier answer though - it should probably be the first
answer in the FAQ (is there a FAQ file somewhere that I could patch in the
answers to this question and send it to someone?)

-Aaron

On Mon, 13 May 2002, Christian Gilmore wrote:

 Is there a reason you don't just use a Redirect?

   VirtualHost__default__:80
   Redirect/   https://secure.server.com/
   /VirtualHost

 Regards,
 Christian

 -
 Christian Gilmore
 Technology Leader
 GeT WW Global Applications Development
 IBM Software Group


  -Original Message-
  From: Aaron J Mackey [mailto:[EMAIL PROTECTED]]
  Sent: Monday, May 13, 2002 1:12 PM
  To: [EMAIL PROTECTED]
  Subject: automatic redirect to https
 
 
 
  Can anyone see something wrong with this, or suggest a better
  mechanism:
 
  unless ( $ENV{HTTPS} ) {
  # bounce request to secure port
  my $uri = $r-parsed_uri();
  $uri-scheme('https');
  $r-header_out(Location = $uri-unparse());
  return REDIRECT;
  }
 
  This doesn't seem to work for me; the browser acts as if it's in an
  eternal redirection loop.  And the server's error log says
  that a child
  segfaulted in the process.  The $uri-unparse yields a string like
  https:/mydirectory when I access
  http://myserver.org/mydirectory;.  Do
  I need to rebuild the entire URI manually?
 
  Thanks,
 
  -Aaron
 




Re: automatic redirect to https

2002-05-14 Thread Geoffrey Young



Aaron J Mackey wrote:

 Yes: simply because I want to be able to install the software at new
 sites with minimal httpd.conf twiddling (and the user has a configuration
 file in which they can switch on/off the SSL requirement).


in that case, you probably want to check $r-subprocess_env('HTTPS') instead of 
$ENV{HTTPS}, since PerlSetupEnv Off will cause $ENV{HTTPS} to be false.


--Geoff





Re: Memory usage option in Apache::Status

2002-05-14 Thread Stas Bekman

[EMAIL PROTECTED] wrote:
ok, next trace to the offending code.

 [Tue May 14 10:38:19 2002] [error] Can't call method size on unblessed
 reference at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/Size.pm line
 94.
 B::AV::size(1, 'B::AV=SCALAR(0xa063444)') called at
 /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 438

I cannot reproduce the problem, but it seems that the problem is in
B/Size.pm:93my @vals = $sv-ARRAY;

which returns values which aren't references (at least one). You may 
want to muck around this code and print what's inside @vals.

 B::TerseSize::PADLIST_size('B::CV=SCALAR(0xa0674a0)',
 'B::CV=SCALAR(0xa0674a0)', 'B::CV=SCALAR(0xa0674a0)',
 'B::CV=SCALAR(0xa0674a0)') called at
 /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 190
 B::TerseSize::CV_walk('slow', 'B::NULL::size', 'op_size') called
 at /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 123
 B::TerseSize::package_size('B::NULL') called at
 /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 542
 B::TerseSize::apache_package_size('B::HV', 'B::Terse',
 'B::SPECIAL', 'B::NULL') called at
 /usr/lib/perl5/site_perl/5.6.0/i386-linux/B/TerseSize.pm line 563
 B::TerseSize::status_memory_usage('Apache=SCALAR(0x9e4ae5c)',
 'CGI=HASH(0x9e4aa8c)') called at
 /usr/lib/perl5/site_perl/5.6.0/i386-linux/Apache/Status.pm line 66
 Apache::Status::handler('Apache=SCALAR(0x9e4ae5c)') called at
 /usr/lib/perl5/5.6.0/Carp.pm line 119
 require 0 called at /usr/lib/perl5/5.6.0/Carp.pm line 119

 I will see if I can borrow a testing machine tomorrow to try the
 upgrade.

Please check if the problem does go away with 5.6.1. if not please
provide a short script/module that reproduces the problem (via
Apache::Status of course)



__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




filtering mod_proxy output

2002-05-14 Thread Charles Bueche

Hi all,

I want to implement a transparent reverse proxy, to export an intranet web
server to the Internet.

I know about the ProxyPass friends, but with such a mapping :

ProxyPass /toto http://intra.company.com

the returned HTML page contains links that must be filtered (IMG SRC,
etc).

My original attempt was to create a Content Handler to filter the HTML
flow (add /toto on all links), but apparently, I can't hook my handler
after mod_proxy. Is there a way to realize this ?

The O'Reilly book mention writing my own proxy. Or would Apache 2.0
filters solve this in an elegant way ?

Thanks for any hint,

Charles
-- 
Charles Bueche [EMAIL PROTECTED]
sand, snow, wave, wind and net -surfer



Embed Apache+Mod_perl into a application

2002-05-14 Thread Vitor

Hello Folks,

Does anybody tried to embed mod_perl and apache inside an windows
application ?

Thanks,

Vitor




Re: filtering mod_proxy output

2002-05-14 Thread Drew Taylor

At 04:25 PM 5/14/02 +0200, Charles Bueche wrote:
Hi all,

I want to implement a transparent reverse proxy, to export an intranet web
server to the Internet.

I know about the ProxyPass friends, but with such a mapping :

 ProxyPass /toto http://intra.company.com

the returned HTML page contains links that must be filtered (IMG SRC,
etc).

Read up on the ProxyPassReverse directive of mod_proxy. This will do 
exactly what you are looking for.

Drew

==
Drew Taylor  |  Freelance web development using
http://www.drewtaylor.com/   |  perl/mod_perl/MySQL/postgresql/DBI
mailto:[EMAIL PROTECTED]   |  Email jobs at drewtaylor.com
--
Speakeasy.net: A DSL provider with a clue. Sign up today.
http://www.speakeasy.net/refer/29655
==




we need mod_perl banners

2002-05-14 Thread Stas Bekman

Nobody has volunteered to lead the modperl banners effort, so if you are 
an artist or know someone who is and willing to help please send the 
banners to me.

The story:
--
Some people want to advertise mod_perl on their sites. We need banners 
for that. Your help is appreciated.

Approx Banner Spec:
---
Format: PNG
Dimensions: 468x60 and 150x40 (pixels)
Size:   about 10k.

BTW, we still don't have a button derived from the winner logo!
should be 88x31px or something like that.

Ideas for banners:
--
* world domination chapter 1 (only 20% achieved, see netcraft)
* world domination chapter 2 (50% target)
* include the 2.0 theme


Try to re-use the new logo:
---
http://wypug.digital-word.com/mod_perl/winner/

You can use Apache's feather:
-
http://apache.org/~stas/feather.gif
http://apache.org/~stas/feather_transbg.gif

And ORA's camel:

http://perl.oreilly.com/usage/
and probably can cut images from
http://wypug.digital-word.com/mod_perl/


Thanks.
__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com




Re: we need mod_perl banners

2002-05-14 Thread Mark Fowler

On Tue, 14 May 2002, Stas Bekman wrote:

 [ creating banners, etc ]

Do we have the source for those banners anywhere?  Preferably vector, or 
at least telling us what font the original was in.  I don't think anyone 
wants to work from bitmap.

I seem to remember matts doing something with SVG a while back, but him 
waiting on the correct font (my memory is a bit vague on this)

(Insert joke about needing the src and closed source banners here)

Later.

Mark.

-- 
s''  Mark Fowler London.pm   Bath.pm
 http://www.twoshortplanks.com/  [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t-Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t-Tgoto(cm,$_,$y). $w;select$k,$k,$k,.03}$y+=2}





Re: we need mod_perl banners

2002-05-14 Thread Stas Bekman

Mark Fowler wrote:
 On Tue, 14 May 2002, Stas Bekman wrote:
 
 
[ creating banners, etc ]
 
 
 Do we have the source for those banners anywhere?  Preferably vector, or 
 at least telling us what font the original was in.  I don't think anyone 
 wants to work from bitmap.
 
 I seem to remember matts doing something with SVG a while back, but him 
 waiting on the correct font (my memory is a bit vague on this)

Only the new mod_perl logo:
http://wypug.digital-word.com/mod_perl/svg_version/

(the svg version will feature on the new site as well)

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com





RE: we need mod_perl banners

2002-05-14 Thread Jonathan M. Hollin

Do we have the source for those banners anywhere?  Preferably 
vector, or 
at least telling us what font the original was in.  I don't 
think anyone 
wants to work from bitmap.

I seem to remember matts doing something with SVG a while 
back, but him 
waiting on the correct font (my memory is a bit vague on this)

Spec's are as follows:

Font:  Trebuchet MS, sans-serif (Trebuchet is available for download
from the M$ website)
Size:  60pt
Grey:  #99
Blue:  #326696

And the text was rendered in Bold.

An SVG version of the new logo is available at:
http://wypug.digital-word.com/mod_perl/svg_version/


Regards,

Jonathan M. Hollin - WYPUG Co-ordinator

West Yorkshire Perl User Group
http://wypug.pm.org/
http://wypug.digital-word.com/




Re: Moving from CGI to mod_perl

2002-05-14 Thread Jason

Probably the BIGGEST mod_perl pitfall is variable scoping/initialization.

I recommend that you try to

use strict;

whenever possible ESPECIALLY in mod_perl.

- Original Message - 
From: Anton Permyakov [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, May 14, 2002 12:15 AM
Subject: Moving from CGI to mod_perl


 Hi, all.
 
 I have perl CGI-script, and i wanna run it as mod_perl script.
 
 Is it enought to correctly edit only httpd.conf, or i've to add something
 special in my CGI-script? Maybe something like
 
 use Apache::Registry;
 
 or something else
 
 Also is it needed to write some special script like startup.pl or not?
 
 Thank you all, and sorry for this easy question...
 In doc i could not find How to migrate from CGI to mod_perl - step by step
 easy example.
 
 Good luck,
 Anton Permyakov.




How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Erchinger, Ethan

Hi all,
I saw a posting about this subject from earlier this year.  I'm unable to
make this work, and was hoping for some help.  I have a Location directive
for / (for the entire docroot).   I would like to make one subdirectory not
be handled by perl-script, but am unable to do so.  Excerpt from httpd.conf:

~snip~
PerlModule Apache::DBI
PerlFreshRestart On
PerlRequire /etc/apache/handler.pl
Directory /var/www
Options FollowSymLinks
AllowOverride None
order allow,deny
allow from all
/Directory

Location /
   SetHandler perl-script
   PerlHandler HTML::Mason
/Location
~snip~

I'm trying to make it so that, a subdir, like /yadda-yadda, is _not_ handled
by Mason.  Here is what I've tried to do:

Location /yadda-yadda
RemoveHandler .html
/Location

I've also tried moving the Location / directive contents into the above
Directory, seeing as the docs mention that Location directives override
a Directory directive, with no luck.

Yet these files are still being served through Mason, and I can't figure out
why.  Should my handler.pl (startup.pl) be moved so that it's not executed
in that Location?  I've read as much as I can find on Apache's site, with no
luck.

Debian 2.2r3
Apache/1.3.9
Mod_perl 1.21

Thanks all,
Ethan Erchinger



Re: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Tim Burden

Try
Location /yadda-yadda
SetHandler default-handler
/Location


- Original Message -
From: Erchinger, Ethan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, May 14, 2002 11:50 AM
Subject: How to disable mod_perl in a subdir (apache)


 Hi all,
 I saw a posting about this subject from earlier this year.  I'm unable to
 make this work, and was hoping for some help.  I have a Location
directive
 for / (for the entire docroot).   I would like to make one subdirectory
not
 be handled by perl-script, but am unable to do so.  Excerpt from
httpd.conf:

 ~snip~
 PerlModule Apache::DBI
 PerlFreshRestart On
 PerlRequire /etc/apache/handler.pl
 Directory /var/www
 Options FollowSymLinks
 AllowOverride None
 order allow,deny
 allow from all
 /Directory

 Location /
SetHandler perl-script
PerlHandler HTML::Mason
 /Location
 ~snip~

 I'm trying to make it so that, a subdir, like /yadda-yadda, is _not_
handled
 by Mason.  Here is what I've tried to do:

 Location /yadda-yadda
 RemoveHandler .html
 /Location

 I've also tried moving the Location / directive contents into the above
 Directory, seeing as the docs mention that Location directives
override
 a Directory directive, with no luck.

 Yet these files are still being served through Mason, and I can't figure
out
 why.  Should my handler.pl (startup.pl) be moved so that it's not executed
 in that Location?  I've read as much as I can find on Apache's site, with
no
 luck.

 Debian 2.2r3
 Apache/1.3.9
 Mod_perl 1.21

 Thanks all,
 Ethan Erchinger




RE: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Erchinger, Ethan


 Try
 Location /yadda-yadda
 SetHandler default-handler
 /Location

I tried that as well.  Do you think it could be the startup.pl (handler.pl),
shouldn't that only get run when the handler is perl-script?

EE


 Subject: How to disable mod_perl in a subdir (apache)


 Hi all,
 I saw a posting about this subject from earlier this year.  I'm unable to
 make this work, and was hoping for some help.  I have a Location
directive
 for / (for the entire docroot).   I would like to make one subdirectory
not
 be handled by perl-script, but am unable to do so.  Excerpt from
httpd.conf:

 ~snip~
 PerlModule Apache::DBI
 PerlFreshRestart On
 PerlRequire /etc/apache/handler.pl
 Directory /var/www
 Options FollowSymLinks
 AllowOverride None
 order allow,deny
 allow from all
 /Directory

 Location /
SetHandler perl-script
PerlHandler HTML::Mason
 /Location
 ~snip~

 I'm trying to make it so that, a subdir, like /yadda-yadda, is _not_
handled
 by Mason.  Here is what I've tried to do:

 Location /yadda-yadda
 RemoveHandler .html
 /Location

 I've also tried moving the Location / directive contents into the above
 Directory, seeing as the docs mention that Location directives
override
 a Directory directive, with no luck.

 Yet these files are still being served through Mason, and I can't figure
out
 why.  Should my handler.pl (startup.pl) be moved so that it's not
executed
 in that Location?  I've read as much as I can find on Apache's site, with
no
 luck.

 Debian 2.2r3
 Apache/1.3.9
 Mod_perl 1.21

 Thanks all,
 Ethan Erchinger



RE: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Drew Taylor

At 08:58 AM 5/14/02 -0700, Erchinger, Ethan wrote:

  Try
  Location /yadda-yadda
  SetHandler default-handler
  /Location

I tried that as well.  Do you think it could be the startup.pl (handler.pl),
shouldn't that only get run when the handler is perl-script?

If you have a PerlRequire startup.pl statement in your httpd.conf, 
startup.pl will always be run as Apache is starting up. It has nothing to 
do with the Set/AddHandler directives. I'm sure there is a section in the 
guide (http://perl.apache.org/guide/) which has more info, but I don't have 
a link handy.

Drew

==
Drew Taylor  |  Freelance web development using
http://www.drewtaylor.com/   |  perl/mod_perl/MySQL/postgresql/DBI
mailto:[EMAIL PROTECTED]   |  Email jobs at drewtaylor.com
--
Speakeasy.net: A DSL provider with a clue. Sign up today.
http://www.speakeasy.net/refer/29655
==




Re: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Tim Tompkins

Make sure you put it after the Location directive that sets HTML::Mason

Location /
SetHandler perl-script
PerlHandler HTML::Mason
/Location

/Location /yadda-yadda
SetHandler default-handler
/Location


Regards,

Tim Tompkins
--
Programmer
http://www.arttoday.com/
http://www.rebelartist.com/
--
- Original Message -
From: Erchinger, Ethan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, May 14, 2002 8:58 AM
Subject: RE: How to disable mod_perl in a subdir (apache)



 Try
 Location /yadda-yadda
 SetHandler default-handler
 /Location

I tried that as well.  Do you think it could be the startup.pl (handler.pl),
shouldn't that only get run when the handler is perl-script?

EE


 Subject: How to disable mod_perl in a subdir (apache)


 Hi all,
 I saw a posting about this subject from earlier this year.  I'm unable to
 make this work, and was hoping for some help.  I have a Location
directive
 for / (for the entire docroot).   I would like to make one subdirectory
not
 be handled by perl-script, but am unable to do so.  Excerpt from
httpd.conf:

 ~snip~
 PerlModule Apache::DBI
 PerlFreshRestart On
 PerlRequire /etc/apache/handler.pl
 Directory /var/www
 Options FollowSymLinks
 AllowOverride None
 order allow,deny
 allow from all
 /Directory

 Location /
SetHandler perl-script
PerlHandler HTML::Mason
 /Location
 ~snip~

 I'm trying to make it so that, a subdir, like /yadda-yadda, is _not_
handled
 by Mason.  Here is what I've tried to do:

 Location /yadda-yadda
 RemoveHandler .html
 /Location

 I've also tried moving the Location / directive contents into the above
 Directory, seeing as the docs mention that Location directives
override
 a Directory directive, with no luck.

 Yet these files are still being served through Mason, and I can't figure
out
 why.  Should my handler.pl (startup.pl) be moved so that it's not
executed
 in that Location?  I've read as much as I can find on Apache's site, with
no
 luck.

 Debian 2.2r3
 Apache/1.3.9
 Mod_perl 1.21

 Thanks all,
 Ethan Erchinger





RE: unable to use method type handlers?

2002-05-14 Thread Jeff AA


 Try per load the class my::class via startup.pl or PerlModule

I already had PerlModule my::classes in httpd.conf
Tried PerlRequire as well - still the same error

help??


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of
[EMAIL PROTECTED]
Sent: 14 May 2002 09:58
To: Jeff AA
Cc: [EMAIL PROTECTED]
Subject: Re: unable to use method type handlers?


Try per load the class my::class via startup.pl or PerlModule

Tor.


Jeff AA wrote:
 
 Whenever I try to set up a method type handler
 
   PerlHandler my::classes-mymethod
 
 I get the following in the error log:
 
   Undefined subroutine my::classes-mymethod::handler called.
 
 using:
   Apache/1.3.23 (Unix) Debian GNU/Linux
   mod_perl/1.26 mod_ssl/2.8.7 OpenSSL/0.9.6c
 
 any hints would be appreciated





Re: we need mod_perl banners

2002-05-14 Thread Matt Sergeant

On Tuesday 14 May 2002 4:12 pm, Stas Bekman wrote:
 Nobody has volunteered to lead the modperl banners effort, so if you are
 an artist or know someone who is and willing to help please send the
 banners to me.

 The story:
 --
 Some people want to advertise mod_perl on their sites. We need banners
 for that. Your help is appreciated.

 Approx Banner Spec:
 ---
 Format: PNG
 Dimensions: 468x60 and 150x40 (pixels)
 Size:   about 10k.

 BTW, we still don't have a button derived from the winner logo!
 should be 88x31px or something like that.

I made SVG that was perfect for the button. I'm not sure why nobody took a 
snapshot of it. http://take23.org/modperl.svg

Matt.



Re: we need mod_perl banners

2002-05-14 Thread Matt Sergeant

On Tuesday 14 May 2002 4:12 pm, Stas Bekman wrote:
 Nobody has volunteered to lead the modperl banners effort, so if you are
 an artist or know someone who is and willing to help please send the
 banners to me.

 Approx Banner Spec:
 ---
 Format: PNG
 Dimensions: 468x60 and 150x40 (pixels)
 Size:   about 10k.

 BTW, we still don't have a button derived from the winner logo!
 should be 88x31px or something like that.

http://take23.org/modperl.svg

I'm surprised nobody has taken a snapshot of it yet to use as a banner or 
button (it's resizable - do a view-source for some details).

Matt.



Re: Load Balancing, mod_proxy, rewrite problem

2002-05-14 Thread Perrin Harkins

mire wrote:
 I have code like this:
 
 RewriteEngine On
  
 RewriteLog /var/site/rewrite.log
 RewriteMaplb  prg:/tmp/lb
 
 RewriteRule  ^/trta$  http://${lb:prvi|drugi}  [proxy,last] 
 
 and a perl script (a copy from mod_proxy manual) but it doesn't work, it seems
 like perl script is waiting indeffinetly for input.

Sorry, this is not a mod_perl problem.  You should try the general 
Apache user mailing lists, or see if there's a list or newsgroup for 
mod_rewrite.

- Perrin




RE: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Erchinger, Ethan

I have it setup that way, thanks, still no dice.


 Subject: Re: How to disable mod_perl in a subdir (apache)
 
 
 Make sure you put it after the Location directive that sets 
 HTML::Mason
 
 Location /
 SetHandler perl-script
 PerlHandler HTML::Mason
 /Location
 
 /Location /yadda-yadda
 SetHandler default-handler
 /Location
 
 
 Regards,
 
 Tim Tompkins
 --
 Programmer
 http://www.arttoday.com/
 http://www.rebelartist.com/
 --
 - Original Message -
 From: Erchinger, Ethan [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, May 14, 2002 8:58 AM
 Subject: RE: How to disable mod_perl in a subdir (apache)
 
 
 
  Try
  Location /yadda-yadda
  SetHandler default-handler
  /Location
 
 I tried that as well.  Do you think it could be the 
 startup.pl (handler.pl),
 shouldn't that only get run when the handler is perl-script?
 
 EE
 
 
  Subject: How to disable mod_perl in a subdir (apache)
 
 
  Hi all,
  I saw a posting about this subject from earlier this year. 
  I'm unable to
  make this work, and was hoping for some help.  I have a Location
 directive
  for / (for the entire docroot).   I would like to make one 
 subdirectory
 not
  be handled by perl-script, but am unable to do so.  Excerpt from
 httpd.conf:
 
  ~snip~
  PerlModule Apache::DBI
  PerlFreshRestart On
  PerlRequire /etc/apache/handler.pl
  Directory /var/www
  Options FollowSymLinks
  AllowOverride None
  order allow,deny
  allow from all
  /Directory
 
  Location /
 SetHandler perl-script
 PerlHandler HTML::Mason
  /Location
  ~snip~
 
  I'm trying to make it so that, a subdir, like 
 /yadda-yadda, is _not_
 handled
  by Mason.  Here is what I've tried to do:
 
  Location /yadda-yadda
  RemoveHandler .html
  /Location
 
  I've also tried moving the Location / directive contents 
 into the above
  Directory, seeing as the docs mention that Location directives
 override
  a Directory directive, with no luck.
 
  Yet these files are still being served through Mason, and 
 I can't figure
 out
  why.  Should my handler.pl (startup.pl) be moved so that it's not
 executed
  in that Location?  I've read as much as I can find on 
 Apache's site, with
 no
  luck.
 
  Debian 2.2r3
  Apache/1.3.9
  Mod_perl 1.21
 
  Thanks all,
  Ethan Erchinger
 
 



RE: How to disable mod_perl in a subdir (apache)

2002-05-14 Thread Erchinger, Ethan

 
 At 08:58 AM 5/14/02 -0700, Erchinger, Ethan wrote:
 
 Do you think it could be the 
 startup.pl (handler.pl),
 shouldn't that only get run when the handler is perl-script?
 
 If you have a PerlRequire startup.pl statement in your httpd.conf, 
 startup.pl will always be run as Apache is starting up. It 
 has nothing to 
 do with the Set/AddHandler directives. I'm sure there is a 
 section in the 
 guide (http://perl.apache.org/guide/) which has more info, 
 but I don't have 
 a link handy.

Thanks.  So in the handler.pl I now have a stanza that looks for my
/yadda-yadda uri in $r, and just return 1; if that's the case, put this in
the handler() sub.  So I believe the startup.pl should no longer be causing
problems.  I find it interesting that if I comment out the Location /
directive which sets the SetHandler perl-script, then the problem
disappears, maybe no so interesting, probably more obvious.  By the way,
this directory /yadda-yadda is actually being redirected via the mod_jk
ajp13 protocol to a Tomcat server.  If that helps at all.

Thanks,
EE



Re: Load Balancing, mod_proxy, rewrite problem

2002-05-14 Thread Tom Lancaster

I think I had a similar problem. It's a while since I tackled it, so I might
be wrong. In any case, I was having problems doing proxy with a rewritemap.
My reason for wanting to do this was so I could use the weighting feature of
rewritemaps to do weighted load balancing between frontend and backend 
apaches.

I mailed Engelschall, but I hear he gets so much mail about mod_rewrite that
it takes him years to respond.

In any case, I have a patch to mod_rewrite that fixed the problem for me.
The breakdown of the issue was that mod_rewrite wouldn't do a proxy on a
subrequest.

Be warned: I think this patch causes problems with the automatic adding of 
trailing /'s on URLs.

Tom



On Tue, May 14, 2002 at 12:19:44PM -0400, Perrin Harkins wrote:
 mire wrote:
  I have code like this:
  
  RewriteEngine On
   
  RewriteLog /var/site/rewrite.log
  RewriteMaplb  prg:/tmp/lb
  
  RewriteRule  ^/trta$  http://${lb:prvi|drugi}  [proxy,last] 
  
  and a perl script (a copy from mod_proxy manual) but it doesn't work, it seems
  like perl script is waiting indeffinetly for input.
 
 Sorry, this is not a mod_perl problem.  You should try the general 
 Apache user mailing lists, or see if there's a list or newsgroup for 
 mod_rewrite.
 
 - Perrin

-- 
Tom Lancaster   Red Hat, Inc.
[EMAIL PROTECTED] (510)-986-8770 x 354


This patch is necessary to allow rewriterules to be applied to subrequests when
they are meant to be proxied. We need this to allow mod_include to get 
/apps/include/pane.html from the app servers by proxy.

--- apache_1.3.19/src/modules/standard/mod_rewrite.c.proxy-subreq   Wed Jan 31 
20:12:26 2001
+++ apache_1.3.19/src/modules/standard/mod_rewrite.cWed May 23 16:39:47 2001
@@ -1604,10 +1604,10 @@
 /*
  *  Ignore this rule on subrequests if we are explicitly
- *  asked to do so or this is a proxy-throughput or a
+ *  asked to do so or if this is a
  *  forced redirect rule.
  */
 if (r-main != NULL 
 (p-flags  RULEFLAG_IGNOREONSUBREQ ||
- p-flags  RULEFLAG_PROXY  ||
+/*   p-flags  RULEFLAG_PROXY  ||  */
  p-flags  RULEFLAG_FORCEREDIRECT)) {
 continue;



$r-args vs $r-content

2002-05-14 Thread Mike Melillo














Ok, I've switched to A::Request,
but it still seems my parameters table is empty. I'll paste in the form data,
as well as some code snippets to see if that helps find the bug.



form
method=post ENCTYPE=multipart/form-data
action=/join input type=hidden name=action value=submit



usernamebr

input type=text size=30 maxlength=255
name=username value=[% username %] p



passwordbr

input type=password
size=30 maxlength=20 name=password value=[% password%]



input type=submit
name=submit value=ADD PROFILE



/form



**End HTML Template**



** Join.pm **



sub submit {

 my $DEBUG = 1;

 my ($r) = shift;

 my $apr = Apache::Request-new($r);

 my $status = $apr-parse;

 my @param = $apr-param;

 $DEBUG 
print STDERR Dumper($apr-parms)

 $DEBUG 
print STDERR Dumper(@param);



...

}





The first Data::Dumper print
statement sends this to the errlog - 

$VAR1 = bless( {}, 'Apache::Table'
);



The second print statement
prints nothing.



I looked at perldoc Apache::Request,
but didnt see anything wrong...



Help?



Mike







-Original Message-

From: Issac Goldstand [mailto:[EMAIL PROTECTED]] 

Sent: Tuesday, May 14, 2002
4:39 AM

To: Mike Melillo

Cc: [EMAIL PROTECTED]

Subject: Re: $r-args vs
$r-content



Quoting Mike Melillo
[EMAIL PROTECTED]:



 

 Hi,

 



 One of the fields is an
image file that will be uploaded so I need to 

 use POST requests. Is
this a job for Apache::Request? The eagle book 

 doesn't cover it much
because it was experimental at the time of 

 publishing.

 

There's a version 1.0 out by
now. That means stable as it's ever gonna get :-) I use it all the time, go
for it!



 Issac





Internet is a wonderful
mechanism for making a fool of

yourself in front of a very
large audience.

 --Anonymous



Moving the mouse won\'t get
you into trouble... Clicking it might.

 --Anonymous



PGP Key 0xE0FA561B -
Fingerprint:

7E18 C018 D623 A57B 7F37
D902 8C84 7675 E0FA 561B












Re: Load Balancing, mod_proxy, rewrite problem

2002-05-14 Thread Tom Lancaster

On closer examination, I don't think this will solve your problem - this 
helps when you want to proxy something that's been included via mod_include.

Tom


On Tue, May 14, 2002 at 09:32:54AM -0700, Tom Lancaster wrote:
 I think I had a similar problem. It's a while since I tackled it, so I might
 be wrong. In any case, I was having problems doing proxy with a rewritemap.
 My reason for wanting to do this was so I could use the weighting feature of
 rewritemaps to do weighted load balancing between frontend and backend 
 apaches.
 
 I mailed Engelschall, but I hear he gets so much mail about mod_rewrite that
 it takes him years to respond.
 
 In any case, I have a patch to mod_rewrite that fixed the problem for me.
 The breakdown of the issue was that mod_rewrite wouldn't do a proxy on a
 subrequest.
 
 Be warned: I think this patch causes problems with the automatic adding of 
 trailing /'s on URLs.
 
 Tom
 
 
 
 On Tue, May 14, 2002 at 12:19:44PM -0400, Perrin Harkins wrote:
  mire wrote:
   I have code like this:
   
   RewriteEngine On

   RewriteLog /var/site/rewrite.log
   RewriteMaplb  prg:/tmp/lb
   
   RewriteRule  ^/trta$  http://${lb:prvi|drugi}  [proxy,last] 
   
   and a perl script (a copy from mod_proxy manual) but it doesn't work, it seems
   like perl script is waiting indeffinetly for input.
  
  Sorry, this is not a mod_perl problem.  You should try the general 
  Apache user mailing lists, or see if there's a list or newsgroup for 
  mod_rewrite.
  
  - Perrin
 
 -- 
 Tom Lancaster Red Hat, Inc.
 [EMAIL PROTECTED]   (510)-986-8770 x 354

 This patch is necessary to allow rewriterules to be applied to subrequests when
 they are meant to be proxied. We need this to allow mod_include to get 
/apps/include/pane.html from the app servers by proxy.
 
 --- apache_1.3.19/src/modules/standard/mod_rewrite.c.proxy-subreq Wed Jan 31 
20:12:26 2001
 +++ apache_1.3.19/src/modules/standard/mod_rewrite.c  Wed May 23 16:39:47 2001
 @@ -1604,10 +1604,10 @@
  /*
   *  Ignore this rule on subrequests if we are explicitly
 - *  asked to do so or this is a proxy-throughput or a
 + *  asked to do so or if this is a
   *  forced redirect rule.
   */
  if (r-main != NULL 
  (p-flags  RULEFLAG_IGNOREONSUBREQ ||
 - p-flags  RULEFLAG_PROXY  ||
 +/*   p-flags  RULEFLAG_PROXY  ||  */
   p-flags  RULEFLAG_FORCEREDIRECT)) {
  continue;


-- 
Tom Lancaster   Red Hat, Inc.
[EMAIL PROTECTED] (510)-986-8770 x 354



Re: unable to use method type handlers?

2002-05-14 Thread Geoffrey Young



Jeff AA wrote:

Try per load the class my::class via startup.pl or PerlModule

 
 I already had PerlModule my::classes in httpd.conf
 Tried PerlRequire as well - still the same error

the steps are outlined pretty well in recipe 10.3 (since you mentioned the cookbook 
earlier).  from the looks of your error message in your earlier post, I'd say you 
forgot 
to prototype your handler, since mod_perl was adding the ::handler stuff to your 
PerlHandler argument.  you might want to make sure you built with EVERYTHING=1 as 
well, 
since I'm not sure what mod_perl does if built with PERL_METHOD_HANDLERS=0 (check 
perl-status?hooks for PerlMethodHandlers to be sure).

however there could also be other things amiss, like the package name doesn't match 
what 
you have in your PerlHandler line or whatnot.  if I were you, I'd follow all the 
normal 
method handler steps in 10.3 but create a functional handler instead to make sure 
there 
aren't any typos in there or anything.  in other words, get

   sub mymethod { my $r = shift; ... }

to work first.  then, just change the prototype and recover ($self, $r) as a second 
step.

I know this may not be much help, but the basic steps are pretty much the same and are 
very simple - it's probably something little and unseen that is tripping you up.

HTH

--Geoff




mod_perl 2.0 - writing a proxy handler

2002-05-14 Thread Douglas Younger

Hello,
   Has anyone written a proxy handler in 2.0 similar to example 7-12 of the 
O`Reilly book? I've tried converting it without much luck. I don't need the 
add-blocker stuff, just a generic proxy handle that I can add some 
additional lines to parse the output.

I've had some problems with Apache's default mod_proxy so I'd like to just 
do everything with mod_perl. (problems include chunked data and empty pages)

Thanks!
   -Doug




Re: MLDBM Tie Errors

2002-05-14 Thread Joshua Chamas

Franck PORCHER wrote:
 
 Well, I'm not 100% sure, but I recently switched for MLDBM and got this
 problem too. Here is what I found, and did to remedy the situation :
 
 It *seemed* to me that the physical MLDBM repository was not physically created
 until I actually wrote something into it, eventhough it was reported as
 correctly open RW.
 

This is correct.  This is a performance enhancement, with the side effect
that write errors will occur at runtime.

 So, any ends of my application trying to fetch value during this
 transcient stage got this kind of error (I do not remember
 precisely which one I got, but very close indeed).
 
 I solved the problem by doing an awful trick on each RW opening, such as
 :
 
 eval {
tie %hash, MLDBM::Sync, $storage, O_RDWR | O_CREAT, 0660;
$hash{'__DuMmY__'} = 'OK';
delete $hash{'__DuMmY__'};
  };
 
 That solved the problem in the midtime, waiting for something
 much better...
 

You could also 

  tie %hash, MLDBM::Sync, $storage, O_RDWR | O_CREAT, 0660;
  tied(%hash)-Lock;

to similar effect, as Lock() will actually force a tie to 
the dbm on disk.

The basic premise of MLDBM::Sync is that the tie/untie actually
occur at the reads  writes, so that i/o is flushed correctly.

--Josh
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks Founder   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



Re: MLDBM Tie Errors

2002-05-14 Thread Mike Martinet

Are you suggesting that I modify Sync.pm?


MjM

[EMAIL PROTECTED] wrote:

  Franck PORCHER wrote:
 
 Well, I'm not 100% sure, but I recently switched for MLDBM and got this
 problem too. Here is what I found, and did to remedy the situation :
 
 It *seemed* to me that the physical MLDBM repository was not 
physically created
 until I actually wrote something into it, eventhough it was reported as
 correctly open RW.
 
 
 
  This is correct.  This is a performance enhancement, with the side effect
  that write errors will occur at runtime.
 
 
 So, any ends of my application trying to fetch value during this
 transcient stage got this kind of error (I do not remember
 precisely which one I got, but very close indeed).
 
 I solved the problem by doing an awful trick on each RW opening, such as
 :
 
 eval {
tie %hash, MLDBM::Sync, $storage, O_RDWR | O_CREAT, 0660;
$hash{'__DuMmY__'} = 'OK';
delete $hash{'__DuMmY__'};
  };
 
 That solved the problem in the midtime, waiting for something
 much better...
 
 
 
  You could also
 
tie %hash, MLDBM::Sync, $storage, O_RDWR | O_CREAT, 0660;
tied(%hash)-Lock;
 
  to similar effect, as Lock() will actually force a tie to
  the dbm on disk.
 
  The basic premise of MLDBM::Sync is that the tie/untie actually
  occur at the reads  writes, so that i/o is flushed correctly.
 
  --Josh
  _
  Joshua Chamas   Chamas Enterprises Inc.
  NodeWorks Founder   Huntington Beach, CA  USA
  http://www.nodeworks.com1-714-625-4051
 





Re: HTTP version conflict with proxy setup.

2002-05-14 Thread Ian Macdonald

Just a quick note on the successful resolution of this; it's a bug in
Apache
1.3.24 with the handling of chunked data from proxies, details here:

http://marc.theaimsgroup.com/?l=apache-httpd-devm=101805692511019w=2
http://marc.theaimsgroup.com/?l=apache-httpd-devm=101810478231242w=2

and there's a patch available here (or your local equivalent):

http://apache.planetmirror.com.au/dist/httpd/patches/apply_to_1.3.24/proxy_http1.1_chunking.patch


Anybody who wants to use the ProxyPass feature in a front-end Apache
1.3.24 to get to a mod_perl-enabled server should install this patch.

Thanks
Ian Macdonald

Ian Macdonald wrote:

 Hi,

 More info on my problem with my proxied (via Rewrite rules) mod_perl
 apache giving responses that were a) topped  tailed with message size
 and 0 respectively, and b) delayed for about 15 seconds; thanks to
 Igor S. for tipping me off that this was chunking and therefore it was a
 HTTP 1.0 vs 1.1 problem, but I still haven't managed to completely solve
 it.

 Short version:

 Can I tell my mod_perl apache to either only ever respond with 1.0 HTTP,
 or to not use chunking? (Or how do I tell my main server not to
 promote the version when it routes the original request to the
 mod_perl server?)

 Setting force-response-1.0  downgrade-1.0 to 1 doesn't seem to work
 (completely).

 Long version:

 The problem appears to be that the browser I'm using for testing
 (Netscape 4.78 on Redhat) is issuing GET xxx 1.0 requests; these are
 recognised as perl resources and passed to the mod_perl apache but the
 new requests are like GET xxx 1.1. The mod_perl apache obediently sends
 back a chunked 1.1 answer, which the browser can't handle. As
 confirmation I tried a different test machine running Netscape 6.? and
 the aberrant behaviour disappeared.  When I go straight to the mod_perl
 server by specifying the port in the URL, it works because the original
 request is 1.0 and so that is what is returned.

 I've tried adding SetEnv force-response-1.0 1 and SetEnv
 downgrade-1.0 1 in both servers config, but the only effect I've
 noticed is when I add force-response-1.0 to the main server, the delay
 goes away; the size  0 (ie the chunking info) still top  tail the
 response.

 Thanks
 Ian Macdonald
 [EMAIL PROTECTED]



cvs commit: modperl STATUS

2002-05-14 Thread geoff

geoff   02/05/14 04:50:49

  Modified:.STATUS
  Log:
  added Apache::Status enhancement request (forwarded from Stas)
  
  Revision  ChangesPath
  1.17  +9 -1  modperl/STATUS
  
  Index: STATUS
  ===
  RCS file: /home/cvs/modperl/STATUS,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- STATUS22 Apr 2002 19:50:40 -  1.16
  +++ STATUS14 May 2002 11:50:48 -  1.17
   -1,5 +1,5 
   mod_perl 1.3 STATUS:
  -   Last modified at [$Date: 2002/04/22 19:50:40 $]
  +   Last modified at [$Date: 2002/05/14 11:50:48 $]
   
   
   Release:
   -24,6 +24,14 
 just not enough things or Registry specific things? --Geoff
 patch available at
 http://marc.theaimsgroup.com/?l=apache-modperlm=101862462900504w=2
  +
  +* Apache::Status allows standard keys to be overridden
  +Report: http://marc.theaimsgroup.com/?l=apache-modperlm=101559176217056w=2
  + Status: 
  +  I'm not sure I understand this one, since the patch seems to do
  +  the opposite of what the user is asking for --Geoff
  +  patch available at
  +  http://marc.theaimsgroup.com/?l=apache-modperlm=101559176217056w=2

   
   Needs Patch or Further Investigation
  
  
  



cvs commit: modperl STATUS

2002-05-14 Thread geoff

geoff   02/05/14 11:05:34

  Modified:.STATUS
  Log:
  more bug reports via stas...
  
  Revision  ChangesPath
  1.18  +10 -1 modperl/STATUS
  
  Index: STATUS
  ===
  RCS file: /home/cvs/modperl/STATUS,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- STATUS14 May 2002 11:50:48 -  1.17
  +++ STATUS14 May 2002 18:05:34 -  1.18
   -1,5 +1,5 
   mod_perl 1.3 STATUS:
  -   Last modified at [$Date: 2002/05/14 11:50:48 $]
  +   Last modified at [$Date: 2002/05/14 18:05:34 $]
   
   
   Release:
   -102,6 +102,15 
 it would be much better if the Apache::Registry will do that
   Report: ?
Status:
  +
  +* Apache::DProf seg-fault via Devel::DProf's prof_mark()
  +Report: http://marc.theaimsgroup.com/?l=apache-modperlm=101923951812332w=2
  + Status:
  +
  +* collisions between Apache::Status and English.pm
  +Report: http://marc.theaimsgroup.com/?l=apache-modperlm=102096856215178w=2
  + Status:
  +
   
   Open Issues or Core Enhancements:
   
  
  
  



cvs commit: modperl/src/modules/perl perl_util.c

2002-05-14 Thread dougm

dougm   02/05/14 19:08:16

  Modified:src/modules/perl perl_util.c
  Log:
  reverting fix taint issue with bleedperl change as it was not the right fix
  
  Revision  ChangesPath
  1.49  +0 -1  modperl/src/modules/perl/perl_util.c
  
  Index: perl_util.c
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/perl_util.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- perl_util.c   16 Apr 2002 02:32:22 -  1.48
  +++ perl_util.c   15 May 2002 02:08:16 -  1.49
   -503,7 +503,6 
SvREFCNT_dec(HeVAL(entry));
HeVAL(entry) = sv_undef;
MP_TRACE_g(fprintf(stderr, reloading %s\n, HeKEY(entry)));
  - TAINT_NOT;
perl_require_pv(HeKEY(entry));
}
SvREFCNT_dec(keysv);