Re: caching dynamic content in the reverse proxy

2002-09-06 Thread Charlie Garrison

Good afternoon,

On 6/9/02 at 12:12 AM, pascal barbedor [EMAIL PROTECTED] wrote:

but any content sent by a modperl handler is not cached although I set headers 
Last-Modified and Expires to compatibles dates (with Apache::Util::ht_time) and 
Cache-content to public from the modperl handler with $r-header_out..

Has any one succeeeded is caching dynamic content in this configuration

When I have caching problems, I run my pages through cachability to find out
where they are failing. Check it out at:

  http://www.web-caching.com/cgi-web-caching/cacheability.py

It reports on page headers as well as gives useful info like the following:

  This object doesn't have any explicit freshness information set, so a
  cache may use Last-Modified to determine how fresh it is with an
  adaptive TTL (at this time, it could be, depending on the adaptive
  percent used, considered fresh for: 2 weeks 20 hr (20%), 5 weeks 2
  days (50%), 10 weeks 4 days (100%)). It can be validated with
  Last-Modified.

The site is a great resource for a variety of caching issues.

Charlie
-- 
   Charlie Garrison[EMAIL PROTECTED]
   PO Box 141, Windsor, NSW 2756, Australia 



Re: [mp2.0] wrong crypt behavior

2002-09-06 Thread Enrico Sorcinelli

On Fri, 6 Sep 2002 08:23:33 +0200
Tomá¹ Procházka [EMAIL PROTECTED] wrote:

 Hello,
 I use own PerlAuthenHandler module to verify users' login and password from
 database.
 
 For comparsion of password user entered and password stored in database is
 crypt function used.
 
 Here is the code:
 my $real_pass = $d-[0][0];   # crypted password from database
 my $salt = substr $real_pass,0,2; # salt
 my $test_pass = crypt $sent_pw,$salt; # in $sent_pw is the password user entered
 if ($real_pass eq $test_pass) {
   $r-subprocess_env(REMOTE_USER = $user);
   return OK;
 } else {
   $r-note_basic_auth_failure;
   return AUTH_REQUIRED;
 }
 
 Problem:  Sometimes, although user entered correct password, is authentication
 rejected. I tried logging values of $real_pass and $test_pass and they
 differed. When I add line
 
 $r-log_reason(User $user tested (.$real_pass./.$test_pass.)...,);
 
 just before 'if' statement behavior is most of time correct.
 
 Can anybody help me? Thanks.
 
 Kacer

Hi,
It seems to be not a mod_perl related problem.
However, try with:

$test_pass = crypt $sent_pw,$real_pass;

Bye,
- Enrico




Re: [mp2.0] wrong crypt behavior

2002-09-06 Thread Tom Prochzka

Fri, Sep 06, 2002 ve 09:57:01AM +0200 Enrico Sorcinelli napsal(a):
 On Fri, 6 Sep 2002 08:23:33 +0200
 Tom? Prochzka [EMAIL PROTECTED] wrote:
 
  Hello,
  I use own PerlAuthenHandler module to verify users' login and password from
  database.
  
  For comparsion of password user entered and password stored in database is
  crypt function used.
  
  Here is the code:
  my $real_pass = $d-[0][0]; # crypted password from database
  my $salt = substr $real_pass,0,2;   # salt
  my $test_pass = crypt $sent_pw,$salt;   # in $sent_pw is the password user 
entered
  if ($real_pass eq $test_pass) {
  $r-subprocess_env(REMOTE_USER = $user);
  return OK;
  } else {
  $r-note_basic_auth_failure;
  return AUTH_REQUIRED;
  }
  
  Problem:  Sometimes, although user entered correct password, is authentication
  rejected. I tried logging values of $real_pass and $test_pass and they
  differed. When I add line
  
  $r-log_reason(User $user tested (.$real_pass./.$test_pass.)...,);
  
  just before 'if' statement behavior is most of time correct.
  
  Can anybody help me? Thanks.
  
  Kacer
 
 Hi,
 It seems to be not a mod_perl related problem.
 However, try with:
 
   $test_pass = crypt $sent_pw,$real_pass;

This is what I tried first (it's common in examples). Results were terrible.

Kacer



[ANNOUNCE] Apache::AuthDigest 0.01

2002-09-06 Thread Geoffrey Young

The URL

 
http://www.modperlcookbook.org/~gyoung/modules/Apache-AuthDigest-0.01.tar.gz

has entered CPAN as

   file: $CPAN/authors/id/G/GE/GEOFF/Apache-AuthDigest-0.01.tar.gz
   size: 10195 bytes
md5: 305f6bfdbdcbd267760bbed9bdc130c7



from the README:

This is a suite of applications for using Digest authentication
with mod_perl.  It contains:

Apache::AuthDigest - re-implementation of the authentication part of
  mod_digest.c in Perl

Apache::AuthzDigest - pick up the authorization pieces of mod_digest

Apache::AuthDigest::API - mod_perl API for Digest authentication a
   la mod_digest

Apache::AuthDigest::API::Full - fully RFC 2617 compliant Digest API
 (not yet implemented)

Apache::AuthDigest::API::Session - experimental interface that uses
the nonce part of a Digest
challenge as a state
maintenance mechanism

enjoy

--Geoff




lame load balancer, mod_proxy, and sticky sessions

2002-09-06 Thread Calbazana, Al
Title: lame load balancer, mod_proxy, and sticky sessions





Hello,

I'd like to know if it is possible to use mod_proxy as a sticky session manager. Basically, I'd like to put mod_proxy behind the load balancer and allow the proxy servers to talk to the mod_perl servers. Unfortunately, the load balancer does not allow for "sticky" sessions and only bounces the user round-robin style. I am playing with the idea of sending a cookie down to the client and using it to stick a user to a particular mod_perl server, but I'd like mod_proxy to figure it out which server and send the user to the defined machine. I'd also like to enable a "checking" mechanism to determine if a mod_perl server is up before the user is sent to the location specified in the cookie. If the machine that the client is stuck to is down, I'd like to reroute.

I know high powered load balancers do this already, but I'd like to explore dedicating a few medium sized servers to do as there is surplus of these and f5's cost $$$. I apologize in advance if this is a bit off topic!

Thanks,

Al



**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**




Re: lame load balancer, mod_proxy, and sticky sessions

2002-09-06 Thread Paul Lindner

On Fri, Sep 06, 2002 at 08:44:39AM -0400, Calbazana, Al wrote:
 Hello,
 
 I'd like to know if it is possible to use mod_proxy as a sticky session
 manager.  Basically, I'd like to put mod_proxy behind the load balancer and
 allow the proxy servers to talk to the mod_perl servers.  Unfortunately, the
 load balancer does not allow for sticky sessions and only bounces the user
 round-robin style.  I am playing with the idea of sending a cookie down to
 the client and using it to stick a user to a particular mod_perl server, but
 I'd like mod_proxy to figure it out which server and send the user to the
 defined machine.  I'd also like to enable a checking mechanism to
 determine if a mod_perl server is up before the user is sent to the location
 specified in the cookie.  If the machine that the client is stuck to is
 down, I'd like to reroute.
 
 I know high powered load balancers do this already, but I'd like to explore
 dedicating a few medium sized servers to do as there is surplus of these and
 f5's cost $$$.  I apologize in advance if this is a bit off topic!

Two things come to mind.  First mod_rewrite has plenty of features that
will let you do primitive load balancing.  See

  http://httpd.apache.org/docs/misc/rewriteguide.html

Look at the examples that show how to combine a cookie with the URI and
you can use regexes to control which host is chosen.

Also check out mod_backhand (discussed on this list, check the archives)

  http://www.backhand.org/

-- 
Paul Lindner[EMAIL PROTECTED]   | | | | |  |  |  |   |   |

mod_perl Developer's Cookbook   http://www.modperlcookbook.org/
 Human Rights Declaration   http://www.unhchr.ch/udhr/



Re: [ANNOUNCE] Apache::AuthDigest 0.01

2002-09-06 Thread Geoffrey Young

nuts... or, rather, bugs.  specifically one largish one in 
AuthDigest.pm that prevented the entire test suite from running.

http://www.modperlcookbook.org/~gyoung/modules/Apache-AuthDigest-0.02.tar.gz

being pushed to CPAN as we speak.  version 0.01 should be tossed and 
will be deleted from CPAN shortly.

Geoffrey Young wrote:
 The URL
 
 
 http://www.modperlcookbook.org/~gyoung/modules/Apache-AuthDigest-0.01.tar.gz 
 
 
 has entered CPAN as
 
   file: $CPAN/authors/id/G/GE/GEOFF/Apache-AuthDigest-0.01.tar.gz
   size: 10195 bytes
md5: 305f6bfdbdcbd267760bbed9bdc130c7
 
 
 
 from the README:
 
 This is a suite of applications for using Digest authentication
 with mod_perl.  It contains:
 
 Apache::AuthDigest - re-implementation of the authentication part of
  mod_digest.c in Perl
 
 Apache::AuthzDigest - pick up the authorization pieces of mod_digest
 
 Apache::AuthDigest::API - mod_perl API for Digest authentication a
   la mod_digest
 
 Apache::AuthDigest::API::Full - fully RFC 2617 compliant Digest API
 (not yet implemented)
 
 Apache::AuthDigest::API::Session - experimental interface that uses
the nonce part of a Digest
challenge as a state
maintenance mechanism
 
 enjoy
 
 --Geoff





Re: lame load balancer, mod_proxy, and sticky sessions

2002-09-06 Thread Perrin Harkins

Calbazana, Al wrote:
 I'd like to know if it is possible to use mod_proxy as a sticky session 
 manager.

It's possible in the sense that you could write a sticky session manager 
and glom it onto mod_proxy.  It's certainly not there right now.

If you just want a free load-balancer, take a look at one of the many 
open source projects out there like http://linux-ha.org/.

- Perrin




Apache::Util::ht_time outputs dates in local language

2002-09-06 Thread pascal barbedor


 When I have caching problems, I run my pages through cachability to find
out
 where they are failing. Check it out at:

   http://www.web-caching.com/cgi-web-caching/cacheability.py

 It reports on page headers as well as gives useful info like the
following:


Hi thanks

this helped me determine why the cache did not work
is it because the date format of Expires or Last-Modified was not RFC
correct

I noted on the occasion that Apache::Util::ht_time()
outputs dates in locale language format (french for me)
Mar, 12 Sept 2002 18:50:20 GMT
instead of english ones


is there a way to correct this ?
thanks
pascal







Re: Apache::Util::ht_time outputs dates in local language

2002-09-06 Thread Paul Lindner

On Fri, Sep 06, 2002 at 05:03:32PM +0200, pascal barbedor wrote:
 
  When I have caching problems, I run my pages through cachability to find
 out
  where they are failing. Check it out at:
 
http://www.web-caching.com/cgi-web-caching/cacheability.py
 
  It reports on page headers as well as gives useful info like the
 following:
 
 
 Hi thanks
 
 this helped me determine why the cache did not work
 is it because the date format of Expires or Last-Modified was not RFC
 correct
 
 I noted on the occasion that Apache::Util::ht_time()
 outputs dates in locale language format (french for me)
 Mar, 12 Sept 2002 18:50:20 GMT
 instead of english ones

This function wraps an apache function (apr_ht_time()) which in
turn uses strftime() to do the conversion.

Try changing your LC_TIME or LANG variable before you start your
web server.  Perhaps start by setting LANG=C and go from there.

Consult the strftime() man page for details on the interaction
between the environment variables and the time output.

Cheers,
Paul

-- 
Paul Lindner[EMAIL PROTECTED]   | | | | |  |  |  |   |   |

mod_perl Developer's Cookbook   http://www.modperlcookbook.org/
 Human Rights Declaration   http://www.unhchr.ch/udhr/



libapreq-1.0 Seg Faults

2002-09-06 Thread ODELL, TODD E (SWBT)

I installed libapreq-1.0 on an AIX 4.3.3 with Perl 5.6.1( build at bottom of
page)/Apache 1.3.26/PHP-4.2.2. I read the README and INSTALL which came w/
the libapreq.1-0 and everything went fine. I compiled it with the same VAC
4.4.0.3 as I had used for the Perl/Apache. But when I try to use the
Apache::Request it gives a 'segmentation fault (11)' in the error_log. An
example is using the Apache::Status module which uses Apache::Request if
loaded. With no args it'll print the screen fine but when I select something
it does a segfault. Not sure how to correct this.

I tried debugging it using dbx running httpd -X.
After the fault:
Segmentation fault in my_memstr at 0xd0ec3be8 ($t1)
0xd0ec3be8 (my_memstr+0x6c0) 800clwz   r0,0x0(r12)

I typed thread:
 thread  state-k wchanstate-uk-tid   mode held scope function
$t1 run  running38005 k   no   pro  my_memstr 

Thanks for any ideas!

The Makefile.PL on mod_perl was:
 % perl Makefile.PL APACHE_SRC=../apache_1.3.26/src
NO_HTTPD=1 \
USE_APACI=1 PREP_HTTPD=1 EVERYTHING=1

perl -V:
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
  Platform:
osname=aix, osvers=4.3.3.0, archname=aix
uname='aix sbctss 3 4 000200554c00 '
config_args=''
hint=previous, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
  Compiler:
cc='cc', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-qmaxmem=16384 -DUSE_NATIVE_DLOPEN -q32 -D_LARGE_FILES -qlonglong',
optimize='-O',
cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384
-DUSE_NATIVE_DLOPEN -q32 -D_LARGE_FILES -qlonglong'
ccversion='4.4.0.3', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=8, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='ld', ldflags ='-brtl -b32'
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lbind -lnsl -ldbm -ldl -lld -lm -lc -lcrypt -lbsd -lPW -liconv
perllibs=-lbind -lnsl -ldl -lld -lm -lc -lcrypt -lbsd -lPW -liconv
libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef,
ccdlflags='-bE:/usr/opt/perl5/lib/5.6.1/aix/CORE/perl.exp
-bE:/usr/opt/perl5/lib/5.6.1/aix/CORE/perl.exp'
cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp
-bE:$(BASEEXT).exp -b noentry -lc'


Characteristics of this binary (from libperl): 
  Compile-time options: USE_LARGE_FILES
  Built under aix
  Compiled at Mar  5 2002 14:17:17
  @INC:
/usr/opt/perl5/lib/5.6.1/aix
/usr/opt/perl5/lib/5.6.1
/usr/opt/perl5/lib/site_perl/5.6.1/aix
/usr/opt/perl5/lib/site_perl/5.6.1
/usr/opt/perl5/lib/site_perl
.

Todd E. O'Dell
Network Services - TSS Staff
Room 1118
500 E. 8th
Kansas City, MO 64106
Office: (816)275-3626
Alpha Page: [EMAIL PROTECTED]
[EMAIL PROTECTED]




Re: libapreq-1.0 Seg Faults

2002-09-06 Thread Bill

Sorry, this bounced from my Mac.com acct :P


On Friday, September 6, 2002, at 12:50 PM, William C (Bill) Jones wrote:

 This is a USELARGEFILES support issue.

 On Friday, September 6, 2002, at 12:16 PM, ODELL, TODD E (SWBT) wrote:

 ...
 Apache::Request it gives a 'segmentation fault (11)' in the error_log.


 Here, in Perl, it is defined:

 useperlio=3Dundef d_sfio=3Dundef uselargefiles=3Ddefine =
 usesocks=3Dundef

 And here:

 Characteristics of this binary (from libperl):
   Compile-time options: USE_LARGE_FILES


 To avoid this issue please try the following:

 Leave PERL alone!

 Rebuild mod_perl -- for example:

 perl Makefile.PL \
 USE_APXS=3D1 \
 WITH_APXS=3D/usr/local/apache/bin/apxs \
 EVERYTHING=3D1 \
 USE_DSO=3D1

 #  build mod_php -
 ./configure --with-apxs=3D/usr/local/apache/bin/apxs \
 =A0 --enable-force-cgi-redirect \
 =A0 --enable-discard-path \
 =A0 --with-pear \
 =A0 --enable-safe-mode \
 =A0 --with-openssl \
 =A0 --enable-bcmath \
 =A0 --with-bz2 \
 =A0 --with-gdbm \
 =A0 --with-ndbm \
 =A0 --enable-dio \
 =A0 --enable-ftp \
 =A0 --with-ldap \
 =A0 --with-mysql=3D/usr/local/ \
 =A0 --with-pgsql \
 =A0 --enable-memory-limit

 # You may wish to remove those options which you might not already 
 have=20=

 installed - like maybe pgsql, openssl, or ldap...

 Please correct for your filesys layout.

 Also, you may wish to see http://www.apachetoolbox.com/

 HTH/Sx :]





mod_perl statistics on securityspace.com

2002-09-06 Thread Geoffrey Young

hi all...

   just FYI... mod_perl use seems to be dramatically on the rise 
again.  here'are the statistics for August from security space:

perl
august: %36.83
july:   %30.79
change: %19.64

PHP
august: %38.59
july:   %40.03
change: %-3.62

https://secure1.securityspace.com/s_survey/data/man.200208/apachemods.html

--Geoff




can't restart server

2002-09-06 Thread Ben Mathews

I'm running mod_perl on windows (Apache/2.0.40 (Win32)
mod_perl/1.99_05-dev Perl/v5.6.1) and it refuses to restart or stop the
service.  If I try, the system will eventually give me the blue screen
of death and crash.

Has anyone had a similar experience or know the solution?
 




Re: mod_perl statistics on securityspace.com

2002-09-06 Thread Chris

 hi all...
 
just FYI... mod_perl use seems to be dramatically on the rise 
 again.  here'are the statistics for August from security space:
 
 perl
 august: %36.83
 july:   %30.79
 change: %19.64
 
 PHP
 august: %38.59
 july:   %40.03
 change: %-3.62
 
 https://secure1.securityspace.com/s_survey/data/man.200208/apachemods.html
 
 --Geoff

Check the month before, I believe this is at least the second month in a 
row this trend has occured. I'm happy someone noticed.

-Chris





Re: lame load balancer, mod_proxy, and sticky sessions

2002-09-06 Thread Perrin Harkins

Ask Bjoern Hansen wrote:
 On Fri, 6 Sep 2002, Perrin Harkins wrote:
 
 
Calbazana, Al wrote:

I'd like to know if it is possible to use mod_proxy as a sticky session
manager.

It's possible in the sense that you could write a sticky session manager
and glom it onto mod_proxy.  It's certainly not there right now.
 
 
 Uh, couldn't a combination of mod_backhand and mod_rewrite (using
 cookies) do it?

I believe mod_backhand could do it alone, but that's not mod_proxy. 
None of the approaches I've seen for using mod_rewite with mod_proxy for 
load-balancing handle the high-availability part, i.e. removing servers 
that have gone down from rotation, but mod_backahand does, and it 
handles sticky sessions.

- Perrin