Re: [ANNOUNCE] Apache::ProxyRewrite 0.11

2001-01-15 Thread Stephane Bortzmeyer

On Sunday 14 January 2001, at 13 h 55, the keyboard of "Christian Gilmore" 
[EMAIL PROTECTED] wrote:


 Apache::ProxyRewrite acts as a reverse-proxy that will rewrite URLs 
 embedded in HTML documents per apache configuration directives.
  
 This module was written to allow multiple backend services with discrete 
 URLs to be presented as one service 

What about Javascript code? Or per-directory realms?





RE: Apache::Registry - END Block not being called when script reloaded

2001-01-15 Thread Geoffrey Young



 -Original Message-
 From: Chris D'Annunzio [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 12, 2001 3:25 PM
 To: [EMAIL PROTECTED]
 Subject: Apache::Registry - END Block not being called when script
 reloaded
 

[snip]
 
 The usual behavior for Apache::Registry is to explicitly call the
 END block each time the script runs. However, I have found that if I
 modify the main script and then execute a request without 
 restarting the
 server, the END block is not called in that 1st request where 
 the script
 is reloaded.
 
 After the first request, the behavior returns to normal. Is 
 this a known
 bug or is there some other reason for this behavior? Has anyone else
 encountered this? 
 

I am unable to reproduce this using the latest cvs + perl 5.6.0 under a
bunch of different settings...

are you using an old version of mod_perl and/or perl perhaps?

if not, a small test case with relevant config info would help track it
down...

--Geoff



RE: Apache::Registry - END Block not being called when script reloaded

2001-01-15 Thread Geoffrey Young



 -Original Message-
 From: Geoffrey Young 
 Sent: Monday, January 15, 2001 8:57 AM
 To: 'Chris D'Annunzio'; [EMAIL PROTECTED]
 Subject: RE: Apache::Registry - END Block not being called when script
 reloaded
 
 I am unable to reproduce this using the latest cvs + perl 
 5.6.0 under a bunch of different settings...
 
 are you using an old version of mod_perl and/or perl perhaps?
 
 if not, a small test case with relevant config info would 
 help track it down...

sorry - I didn't see your follow-up email with the relevant stuff...

I was able to recreate your problem...

others may have additional help or opinions, but I've never heard of anyone
doing an END block that way...

typically, you would preload any modules you use() using a startup.pl or
PerlModule - I guess you aren't doing either one of these since that would
cause the END block to be run when the server is shutdown (see the guide and
this thread from last week for more info:
http://forum.swarthmore.edu/epigone/modperl/nalclyskix)

anyway, sounds like you may need to re-evaluate how you are doing things...

--Geoff



[DIGEST] mod_perl digest 01/07/2001

2001-01-15 Thread Geoffrey Young

--

  mod_perl digest
 
   January 7, 2001 - January 13, 2001

--

Recent happenings in the mod_perl world...


Features

  o mod_perl status
  o cvs patches
  o module announcements
  o mailing list highlights
  o news
  o links


mod_perl status

  o mod_perl
- stable: 1.24_01 (released October 10, 2000) [1]
- development: 1.24_02-dev [2]
  o Apache
- stable: 1.3.14 (released October 13, 2000) [3]
- development: 1.3.15-dev [4]
  o Perl
- stable: 5.6 (released March 23, 2000) [5]
- development: 5.7 [6]


cvs patches

  o Minor fixes to Apache::PerlRun [7] [8]


module announcements

  o Apache::Reload 0.06 - a replacement for Apache::StatINC, with 
more features and better debugging [9]

  o Apache-AuthenLDAP 0.52 - authenticates a user against an LDAP
backend [10]

  o Apache-AuthzLDAP 0.51 - authorizes a user against an LDAP
backend [11]

  o Apache-AuthzCache 0.03 - work with a mod_perl authorization
module to provide caching of group membership [12]

  o ApacheDBI 0.88 - provides persistent database connections [13]


mailing list highlights

  o This thread discusses the possibility of differentiating between
a child exit and when the parent process is shut down [14]

  o A new version of the mod_perl Guide was released this week - 
read it and prosper [15]

  o Discussion on limiting apache processes based on virtual memory 
[16] ended up giving a nice explanation of how and why to use
Apache::SizeLimit [17]

  o Two useful non-mod_perl based modules were announced on the list:
  HTTP::GHTTP 1.03 - a very lightweight C/XS based HTTP
  downloader [18]
  HTTP::WebTest 0.01 - runs tests on remote URLs or local web 
  files and generates a detailed test report [19]


news

  o Netcraft mod_perl statistics are out for December [20]
  mod_perl: 181,1864 Domains, 214,467 IP Addresses

  o take23.org published "Introduction to Programming in mod_perl"
this week [21]


links

  o The Apache/Perl Integration Project [22]
  o mod_perl documentation [23]
  o mod_perl modules on CPAN [24]
  o mod_perl homepage [25]
  o mod_perl news and advocacy [26]
  o mod_perl list archives [27] [28]


happy mod_perling...

--Geoff
[EMAIL PROTECTED]

--
[1] http://perl.apache.org/dist/
[2] http://perl.apache.org/from-cvs/modperl/
[3] http://www.apache.org/dist/
[4] http://dev.apache.org/from-cvs/apache-1.3/
[5] http://www.perl.com/pub/language/info/software.html#stable
[6] http://www.perl.com/pub/language/info/software.html#devel
[7] http://marc.theaimsgroup.com/?l=apache-modperl-cvsm=97928337200810w=2
[8] http://marc.theaimsgroup.com/?l=apache-modperl-cvsm=97931426708751w=2
[9] http://forum.swarthmore.edu/epigone/modperl/wharzoldex
[10] http://forum.swarthmore.edu/epigone/modperl/kulmoistel
[11] http://forum.swarthmore.edu/epigone/modperl/whoireldsnend
[12] http://forum.swarthmore.edu/epigone/modperl/khonkhorkah
[13] http://take23.org/news/2001/01/14/apachedbi.xml
[14] http://forum.swarthmore.edu/epigone/modperl/nalclyskix
[15] http://forum.swarthmore.edu/epigone/modperl/clusounou
[16] http://forum.swarthmore.edu/epigone/modperl/whalglendswy
[17] http://marc.theaimsgroup.com/?t=9792418057w=2r=1
[18] http://forum.swarthmore.edu/epigone/modperl/dwermrehzee 
[19] http://forum.swarthmore.edu/epigone/modperl/zhooquoljer
[20] http://marc.theaimsgroup.com/?l=apache-modperl-cvsm=97912083608055w=2
[21] http://take23.org/articles/2001/01/08/intro.xml/1
[22] http://perl.apache.org
[23] http://perl.apache.org/#docs
[24] http://www.cpan.org/modules/by-module/Apache/
[25] http://www.modperl.com
[26] http://www.take23.org
[27] http://forum.swarthmore.edu/epigone/modperl/
[28] http://marc.theaimsgroup.com/?l=apache-modperlr=1w=2



[JOB SEEKER] Freelancer / contractor based in England (S.E)

2001-01-15 Thread Greg Cope

Dear All

I will be "available" soon for contract (tele-commuting) / freelance
work.

My skills include perl obviously! (mod_perl, OO, modules, and DBI),
Apache,
MySQL, Linux, Solaris, qmail, DNS, and iffy Sybase / Oracle.

I've been doing the usual CGI work and some mod_perl dynamic content /
custom handlers.  Also I been doing custom emailing, SMS server work,
and Sys admin (Linux and Solaris)

I can make meetings in London / South East (England, UK) if required.

URL's / code samples / references / CV etc  available on request.

Thanks,

Greg Cope





'PerlModule Apache' creates a error when include in httpd.conf-trying to fix 'Apache.pm failed to load' problem

2001-01-15 Thread pemalone

Problem:  I configure apache and mod_perl.  One day it runs fine.  The next
day I stop and start
the server and get a 'Apache.pm failed' problem.  I looked at the web site
and found I needed to 
add ' PerlModule Apache' to my httpd.conf file.  I get the error message
listed below.  I looked 
at the web site again and made sure that I was performing the 'make' and
'make install' steps for
mod_perl.  I get the same syntax error.  I looked at the 'PerlSetEnv'
command and didn't think
it was the solution.  Does anyone have any ideas?  The error message and
other details are listed
below.

Peggy Malone

System Details:
Apache version:  1.3.14
mod_perl version:  1.24_01
OS version:  SunOS Generic_106541-09 sun4u sparc SUNW,Ultra-1
perl version: 5.005_03 built for sun4-solaris
perl location:/usr/local/bin/perl
complier version:  gcc 2.95.2

-Error message
# /usr/local/apache/bin/apachectl start
[Thu Jan 11 16:08:15 2001] [error] Can't locate Apache.pm in @INC (@INC
contains: /usr/local//lib/perl5/5.00503/sun4-solaris
/usr/local//lib/perl5/5.00503
/usr/local//lib/perl5/site_perl/5.005/sun4-solaris
/usr/local//lib/perl5/site_perl/5.005 . /usr/local/apache/
/usr/local/apache/lib/perl) at (eval 1) line 3.

Syntax error on line 745 of /usr/local/apache/conf/httpd.conf:
Can't locate Apache.pm in @INC (@INC contains:
/usr/local//lib/perl5/5.00503/sun4-solaris /usr/local//lib/perl5/5.00503
/usr/local//lib/perl5/site_perl/5.005/sun4-solaris
/usr/local//lib/perl5/site_perl/5.005 . /usr/local/apache/
/usr/local/apache/lib/perl) at (eval 2) line 3.

/usr/local/apache/bin/apachectl start: httpd could not be started

-Perl configuration file
perl /apsrc/systems/mod_perl/mod_perl-1.24_01/Makefile.PL \
APACHE_SRC=/apsrc/systems/apache/apache_1.3.14/src \
DO_HTTPD=1  \
EVERYTHING=1 \
USE_APACI=1 \
PREP_HTTPD=1

---Apache configuration file
./configure --prefix=/usr/local/apache \
--verbose \
--with-port=80 \
--logfiledir=/logrpt/apache \
--server-uid=http \
--server-gid=http \
--htdocsdir=/export/www2_root \
--enable-module=so \
--activate-module=src/modules/perl/libperl.a \
--activate-module=src/modules/php4/libphp4.a  \
--enable-module=stats 




Mod Perl Vhost

2001-01-15 Thread Slash



Hello,

Can someone tell me how to setup 
mod_perl per vhost?? I would like to replace each vhost cgi-bin with 
mod_perl.. Is this possible?


RE: [ANNOUNCE] Apache::ProxyRewrite 0.11

2001-01-15 Thread Christian Gilmore

Stephane,

When you say per-directory realms, do you mean you want to be able to
define a ProxyAuthInfo variable multiple times? You can do that once per
front-end location. Currently, the ProxyAuthInfo variable is not tied to a
particular realm. Rather, it is tied to a particular URI.

As for javascript, if it is properly encased within HTML comments, it
won't be touched by the rewriting engine. If it dynamically generates URLs
on the fly, the likely case is that these URLs will be invalid or will
point directly to the backend, skipping the proxy. Two things about this:

1) If your front-end URI space maps directly onto your backend and the
javascript produces relative URIs, there shouldn't be a problem unless the
code is generating absolute URLs.

2) In order to handle all cases of dynamically rewriting javascript (or
any code, for that matter), one must first solve the halting problem. That
is an impossible task.

Regards,
Christian

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

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 15, 2001 4:10 AM
 To: Christian Gilmore
 Cc: Modperl Mailing List (E-mail)
 Subject: Re: [ANNOUNCE] Apache::ProxyRewrite 0.11


 On Sunday 14 January 2001, at 13 h 55, the keyboard of
 "Christian Gilmore"
 [EMAIL PROTECTED] wrote:


  Apache::ProxyRewrite acts as a reverse-proxy that will rewrite URLs
  embedded in HTML documents per apache configuration directives.
 
  This module was written to allow multiple backend services
 with discrete
  URLs to be presented as one service

 What about Javascript code? Or per-directory realms?







Re: Mod Perl Vhost

2001-01-15 Thread Slash

hmm.. I can't seem to figure this out.. cgi's are not working at all now..
hmmm
We have like 20+ vhost and I was thinking mod_perl would help us out alot..
We get around 200k+ hits a day and server load is unreal..   well thanks for
your help anyway..

Ken


 Hello,
 
   Can someone tell me how to setup mod_perl per vhost??  I would like
 to replace each vhost cgi-bin with mod_perl.. Is this possible?

 mod_perl is enabled throughout the Apache server.  From my experience, you
 cannot load mod_perl for specific hosts within httpd.conf; it is
 server-wide, added via LoadModule and AddModule (for a DSO).

 Within each vhost, you can do the following:

 IfModule mod_perl.c

 ...

 Location /cgi-perl/
   SetHandler perl-script
   PerlHandler Apache::Registry
   PerlSendHeader On
   Options +ExecCGI
 /Location

 ...

 /IfModule

 ..Tom

 (copy to user's email addr)
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





Re: Mod Perl Vhost

2001-01-15 Thread Tom Kralidis

hmm.. I can't seem to figure this out.. cgi's are not working at all now..
hmmm
We have like 20+ vhost and I was thinking mod_perl would help us out alot..
We get around 200k+ hits a day and server load is unreal..   well thanks 
for
your help anyway..

Ken

Is mod_perl enabled on your server, ie does $ENV{'MOD_PERL'} exist?

How are you loading mod_perl?  As a DSO?

How is mod_perl enabled in your httpd.conf?

What version of mod_perl / Apache are you using?  On which OS?

Some more information/config chunks would help to debug your problem.

..Tom
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




HTTP_REFERRER and Mod_perl

2001-01-15 Thread Stef Telford

hello,
okay, this may be a silly configuration problem, but I would
really like to know if its jst me with this problem. if it is, then i
dont mind
being hit around the hit and pointed to the appropiate place for further
reading.

I have setup Apache (1.3.14) to use mod_perl for all the 
perl scripts (.pl) on the webroot. Everything is working great, I have
written my own authentication procedures against postgreSQL 7 and
have also used the Apache::DBI. Thats not the problem.

The problems arise when i try to use HTTP_REFERRER from
the $ENV enviroment. All the other variables are set jst fine
(HTTP_HOST,
HTTP_ACCEPT, HTTPS) but no HTTP_REFERRER. What am I doing
wrong to not 'obtain' this variable. it never shows up in the $ENV list.
Is this an oversight of mod_perl (v1.24).

I need this to stop people from typing in URLS or jumping to
a location from a bookmark. If i cant do it this way, then I guess I
will
have to use the MD5 encrypted url checksum and do it that way.

Thanks for your thoughts and input.
Regards,
Stefs




Re: HTTP_REFERRER and Mod_perl

2001-01-15 Thread Balazs Rauznitz



You spell too well. Try HTTP_REFERER.

-Balazs

On Mon, 15 Jan 2001, Stef Telford wrote:

 hello,
   okay, this may be a silly configuration problem, but I would
 really like to know if its jst me with this problem. if it is, then i
 dont mind
 being hit around the hit and pointed to the appropiate place for further
 reading.
 
   I have setup Apache (1.3.14) to use mod_perl for all the 
 perl scripts (.pl) on the webroot. Everything is working great, I have
 written my own authentication procedures against postgreSQL 7 and
 have also used the Apache::DBI. Thats not the problem.
 
   The problems arise when i try to use HTTP_REFERRER from
 the $ENV enviroment. All the other variables are set jst fine
 (HTTP_HOST,
 HTTP_ACCEPT, HTTPS) but no HTTP_REFERRER. What am I doing
 wrong to not 'obtain' this variable. it never shows up in the $ENV list.
 Is this an oversight of mod_perl (v1.24).
 
   I need this to stop people from typing in URLS or jumping to
 a location from a bookmark. If i cant do it this way, then I guess I
 will
 have to use the MD5 encrypted url checksum and do it that way.
 
   Thanks for your thoughts and input.
   Regards,
   Stefs
 




Re: HTTP_REFERRER and Mod_perl

2001-01-15 Thread siberian

I think your mispelling :

HTTP_REFERER , not HTTP_REFERRER

When in doubt run a check on your %ENV hash

foreach( keys %ENV ) {
print "$_ = $ENV{ $_ }\n" ;
}

John-


On Mon, 15 Jan 2001, Stef Telford wrote:

 hello,
   okay, this may be a silly configuration problem, but I would
 really like to know if its jst me with this problem. if it is, then i
 dont mind
 being hit around the hit and pointed to the appropiate place for further
 reading.
 
   I have setup Apache (1.3.14) to use mod_perl for all the 
 perl scripts (.pl) on the webroot. Everything is working great, I have
 written my own authentication procedures against postgreSQL 7 and
 have also used the Apache::DBI. Thats not the problem.
 
   The problems arise when i try to use HTTP_REFERRER from
 the $ENV enviroment. All the other variables are set jst fine
 (HTTP_HOST,
 HTTP_ACCEPT, HTTPS) but no HTTP_REFERRER. What am I doing
 wrong to not 'obtain' this variable. it never shows up in the $ENV list.
 Is this an oversight of mod_perl (v1.24).
 
   I need this to stop people from typing in URLS or jumping to
 a location from a bookmark. If i cant do it this way, then I guess I
 will
 have to use the MD5 encrypted url checksum and do it that way.
 
   Thanks for your thoughts and input.
   Regards,
   Stefs
 
 




Re: HTTP_REFERRER and Mod_perl

2001-01-15 Thread Jeremy A. Mates

On Mon, 15 Jan 2001, Stef Telford wrote:
   The problems arise when i try to use HTTP_REFERRER from
 the $ENV enviroment. All the other variables are set jst fine
 (HTTP_HOST,
 HTTP_ACCEPT, HTTPS) but no HTTP_REFERRER. What am I doing
 wrong to not 'obtain' this variable. it never shows up in the $ENV list.
 Is this an oversight of mod_perl (v1.24).

Probably because somebody at Netscape didn't spell check when creating the
aforementioned Header field:

HTTP_REFERER
 ^
A.k.a. the internet generation's hidden agenda against referrer's third r.

-- 
Jeremy Mates   http://www.sial.org/




Re: HTTP_REFERRER and Mod_perl

2001-01-15 Thread Clint Gilders

Stef Telford wrote:
 
 The problems arise when i try to use HTTP_REFERRER from
 the $ENV enviroment. All the other variables are set jst fine
 (HTTP_HOST,
 HTTP_ACCEPT, HTTPS) but no HTTP_REFERRER. What am I doing
 wrong to not 'obtain' this variable. it never shows up in the $ENV list.
 Is this an oversight of mod_perl (v1.24).
 

Your reference the variable as HTTP_REFERRER when it is actually
HTTP_REFERER (mispelled in the header specs).  When I call
$ENV{'HTTP_REFERER'} from a script in my perl-bin it works fine. 

-- 
Clint Gilders
Servermaster Onlinehobbyist Inc.
[EMAIL PROTECTED]



RE: Specific limiting examples (was RE: Apache::SizeLimit for unsharedRAM ???)

2001-01-15 Thread Rob Bloodgood

 I think that the problem here is that we've asked for more info
 and he hasn't
 supplied it.  He's given us generics and as a result has gotten generic
 answers.

I haven't been fishing for a handout of doing the work for me. I've been
trying to see what people have done.  The reason for the waiting I've done
is, I've looked at no less than 7 CPAN modules that do some kind of
resource/server monitoring, and I couldn't figure out which one(s) would go
together as a reasonable combination.

 1) What are the average hits per second that you are projecting
 this box to handle?
Up to, say 3,000,000 hits/aday.

 2) What is the peak hits per second that you are project this box
 to handle?

This is a guesstimate, but approx 50/s

 3) We know you have a gig of ram, but give us info on the rest of
 the platform?

No, I have 2GB of ram, on a dual PIII/550 BX board, on a 8GB drive

 4) What's your OS like? Solaris, AIX, HP-UX, Linux, FreeBSD, etc.   which
 version and/or flavor

Running RedHat 6.1 updated w/ all kindsa current pathches/updates.

 5) What other processes are you running?

predominantly I'm running a Count Daemon on the same box.  My project is
http://www.exitexchange.com, and I take raw hits at the webserver and fire
them over to my count daemon which keeps load down on the Database... but
I'm ahead of myself.

 6) Do you have a Database?  Which one? A gig of ram is nothing to Oracle

Oracle 8.1.6 on a Sun 450 (4x400Mhz UltraSparc ### w/ 2GB of Ram, 7x9GB SCSI
in a software RAID for the dataspace running Solaris 8)

 6a) Will be running queries constantly or will you be caching a lot?

Whenever possible, I try to cache alot.  The largest part of the application
that is NOT cached is the part I'm working on right now... ever heard of
POE?

 7)  What other modules are you running?  PhP? SpeedyCGI? Axkit? Cocoon?

Well, the count server is only running mod_perl, with a couple of custom
server extensions, all pretty lean.  Per process is abt 12.5MB, shared is
5600k.

 In short what is the server DOING at any given moment.  Until
 folks have a feel
 for this no one is going to be able to offer you any insight
 beyond what you
 already have.

Well I get a hit, I hit the database for the response, I send it back
interpolated into the response content.   Currently about 800K times/day.
:-)

However
I got what I was looking for out of this discussion a couple of messages
back, with Perrin's example.  YES the numbers are made up.  No problem... I
have a basic syntactic skeleton to work with, now I can fine tune.

L8r,
Rob




Apache::DBI type functionality but per-request

2001-01-15 Thread Vivek Khera

I tend to write my apps in a modular fashion, so that each module
connects to the database and fetches its data and then disconnects.
Often, a program will require data from several modules resulting in a
lot of wasted connect/disconnect ops.  Apache::DBI does solve this
issue, but I don't want nor need to keep lingering connections for a
lightly-used application.  (The DB is not used for the majority of
hits to the site.)

I see two possible solutions here:

1) use a cleanup handler to run thru Apache::DBI's connection cache
   and disconnect them

2) roll my own.

Right now I've got an implementation of option 1, but I am not sure
how it interacts with auto-rollback from Apache::DBI.

Here's the function from my startup.perl script:

sub My::DBICleanup {
  my $connection_href = Apache::DBI::all_handlers();

  return unless $connection_href;

  foreach my $key (keys %$connection_href) {
delete $connection_href-{$key};
warn "DBIClenaup Purged connection $key\n";
  }
}

Apache-push_handlers('PerlCleanupHandler', \My::DBICleanup);

My guess is that my handler will clearnup the cache before
Apache::DBI's handler gets a chance to auto-rollback.  Is this some
feature others may want?  Perhaps a new feature to Apache::DBI's
cleanup handler might be the way to go?

Any comments?



Re: HTTP_REFERRER and Mod_perl

2001-01-15 Thread Stef Telford

John wrote:
 I think your mispelling :
 
 HTTP_REFERER , not HTTP_REFERRER
 
 When in doubt run a check on your %ENV hash
 
 foreach( keys %ENV ) {
   print "$_ = $ENV{ $_ }\n" ;
 }
 

you know.. thats the funny thing. I DO that. i have
changed the spelling of HTTP_REFERRER to HTTP_REFERER
but still i dont get this showing up in mod_perl. is this set via
another Apache module perhaps ? Is it okay to have the 
mod_perl handle all the .pl files instead of mod_cgi ?

here is the $ENV sorted alphabetical, as you can see.
no HTTP_REFERER of any sort. frankly i am a bit stumped
by this. 


GATEWAY_INTERFACE="CGI-Perl/1.1"
HTTPS="on"
HTTP_ACCEPT="image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
image/png, */*"
HTTP_ACCEPT_CHARSET="iso-8859-1,*,utf-8"
HTTP_ACCEPT_ENCODING="gzip"
HTTP_ACCEPT_LANGUAGE="en"
HTTP_CONNECTION="Keep-Alive"
HTTP_COOKIE="sessionid=NMqr%2Fl6Rilxfo;"
HTTP_HOST="chronozon.dyndns.org"
HTTP_PRAGMA="no-cache"
HTTP_USER_AGENT="Mozilla/4.75 [en] (X11; U; FreeBSD 4.2-RELEASE i386;
Nav)"
MOD_PERL="mod_perl/1.24"


thanks for you time
(and sorry my correct spelling ;)

regards,
Stef



Re: HTTP_REFERRER and Mod_perl

2001-01-15 Thread siberian

Are you hitting the page directly? If so then you will not get a referer.
You have to link to it from another page in order for that variable to be
set. If the page is the first to load in the browser there is no referring
page.

Just a thought!

John-

On Mon, 15 Jan 2001, Stef Telford wrote:

 John wrote:
  I think your mispelling :
  
  HTTP_REFERER , not HTTP_REFERRER
  
  When in doubt run a check on your %ENV hash
  
  foreach( keys %ENV ) {
  print "$_ = $ENV{ $_ }\n" ;
  }
  
 
 you know.. thats the funny thing. I DO that. i have
 changed the spelling of HTTP_REFERRER to HTTP_REFERER
 but still i dont get this showing up in mod_perl. is this set via
 another Apache module perhaps ? Is it okay to have the 
 mod_perl handle all the .pl files instead of mod_cgi ?
 
 here is the $ENV sorted alphabetical, as you can see.
 no HTTP_REFERER of any sort. frankly i am a bit stumped
 by this. 
 
 
 GATEWAY_INTERFACE="CGI-Perl/1.1"
 HTTPS="on"
 HTTP_ACCEPT="image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
 image/png, */*"
 HTTP_ACCEPT_CHARSET="iso-8859-1,*,utf-8"
 HTTP_ACCEPT_ENCODING="gzip"
 HTTP_ACCEPT_LANGUAGE="en"
 HTTP_CONNECTION="Keep-Alive"
 HTTP_COOKIE="sessionid=NMqr%2Fl6Rilxfo;"
 HTTP_HOST="chronozon.dyndns.org"
 HTTP_PRAGMA="no-cache"
 HTTP_USER_AGENT="Mozilla/4.75 [en] (X11; U; FreeBSD 4.2-RELEASE i386;
 Nav)"
 MOD_PERL="mod_perl/1.24"
 
 
 thanks for you time
 (and sorry my correct spelling ;)
 
 regards,
 Stef
 




Re: HTTP_REFERRER and Mod_perl

2001-01-15 Thread Stef Telford

John wrote:
 Are you hitting the page directly? If so then you will not get a
referer.
 You have to link to it from another page in order for that variable to
be
 set. If the page is the first to load in the browser there is no
referring
 page.
 Just a thought!

no, thank you. it was a good question and it got me thinking.
I use the meta tags to push the person through the custom
authentication process. The thing that i notice is that all
the pages that are 'during' and the first one thereafter
(the main menu as it is) dont have this set.

When i link, they do. So i guess the moral of the story here
is that meta tag redirects DONT set the REFERER variable
at all. 

which is good to know, but requires a bit of a hefty rewrite
on my end, and lots of checking the request_uri. Whelp. 
thank you everyone. i cant believe it was that obvious, 
but at least i will(should) have it working shortly.

satori and peace.
Stefs



RE: HTTP_REFERRER and Mod_perl

2001-01-15 Thread Khachaturov, Vassilii

Please keep in mind that what you describe is a behaviour of one particular
user agent.
Some UAs just never send referer for anonymity. (Sometimes proxy will do
that for them). Some do it for links from a web page, but not from a file://
URL. Some don't care for the URI scheme, and you get referer's from one's
bookmarks on the disk.

So, I think, the moral of the story is that basing your site logic on smth
that requires particular way of referer tracking is not the best option. You
probably want to use some means of session control if you want to make it
more standard/portable (there are many ways of doing it - discussed lots of
times around here). I agree, however, that if you are aiming at some local
community and you are pretty sure about their least common denominator of
referer-sending behaviour, the CPU wasted at your server will be less if you
check the referer.

I personally use referer only for xrefs validation/stats purposes.

Vassilii
http://www.tarunz.org/~vassilii
-Original Message-
From: Stef Telford [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 15, 2001 2:36 PM
To: siberian
Cc: [EMAIL PROTECTED]
Subject: Re: HTTP_REFERRER and Mod_perl


When i link, they do. So i guess the moral of the story here
is that meta tag redirects DONT set the REFERER variable
at all. 



[Fwd: AuthenDBI idea]

2001-01-15 Thread Edmund Mergl

any comments ?

Edmund
-- 
http://www.edmund-mergl.de
fon: +49 700 edemergl


Edmund,
I have idea for AuthenDBI.pm.  I have not tried to code it yet, however.

The function would come in two parts:
A) Provide an option to keep a count of the number of times a user logs in.
 Store this value in DBI field.  (Other field may also be considered, see
below.)
B) Provide a directive to perform a comparison on any and all fields of the
user who successfully logged in.  If the comparison is true, provide a URL
to REDIRECT the user.

The directives could be something like:
Auth_DBI_logcountusecount
Where usecount is the DBI field name to record the number of times a user
has logged in.

Auth_DBI_compare{regexp}URL
Where regexp is the compare string and  where URL is where to REDIRECT the
user.  I think that the original URL should be passed as a URL ? argument,
so that the REDIRECT cgi target could determine the original request's URL.  

The regexp would have to be able to easily use any arbitrary field values.
Perhaps simply by pre-appending the field name with a '$',  for example:

Auth_DBI_compare{$username='xyz'  $usecount%2}   /cgi/newDBIpasswd.pl
 
This would run the "/cgi/newDBIpasswd.pl?original-URL" script every other
time for user 'xyz'.

Other additional informational fields that may be considered are:
Auth_DBI_timefieldname
to keep track of when the user last logged in.

Auth_DBI_rejectfieldname
to keep track of the number of bad log in attempts.

What do you think?

What did you think of my AuthzDBI.pm, "set field environment variable"
hack, that sent you yesterday?






Confusion between script in mod_perl (fwd)

2001-01-15 Thread Pierre Laplante


I am using Registry with mod_perl and virtual host.
Some time my scripts get confuse.
If I do a stack backtrace,

For example:

/usr/local/website/caisses/cgi-bin/caisses:1:SedNove::xml,
/usr/local/website/sednove/cgi-bin/nf,1079,SedNove::xml::raise,10,
2:SedNove::oper,
/usr/local/website/sednove/cgi-bin/nf,2943,SedNove::xml::xmlread,1,0,,,0,

As you can see the program is going from one script to the other one
without any reason.

I have a startup file that look like:

$ENV{GATEWAY_INTERFACE} =~ /^CGI-Perl/ or die "GATEWAY_INTERFACE not Perl!";
 
use Apache::Registry ();   # for things in the "/programs" URL
 
 # pull in things we will use in most requests so it is read and compiled
 # exactly once

use CGI (); CGI-compile(':all');
use CGI::Carp ();
use DB_File;

The version of my program are:

Apache/1.3.12 (Unix) mod_perl/1.24

Any Idea why its doing that?


-- 
Pierre Laplante
SedNove Inc.






Re: Apache::DBI type functionality but per-request

2001-01-15 Thread Perrin Harkins

On Mon, 15 Jan 2001, Vivek Khera wrote:
 I tend to write my apps in a modular fashion, so that each module
 connects to the database and fetches its data and then disconnects.
 Often, a program will require data from several modules resulting in a
 lot of wasted connect/disconnect ops.  Apache::DBI does solve this
 issue, but I don't want nor need to keep lingering connections for a
 lightly-used application.  (The DB is not used for the majority of
 hits to the site.)

I use a singleton for the database connection:

sub get_dbh {
  my $dbh = Apache-request()-pnotes('dbh');
  if (!$dbh) {
$dbh = _new_database_connection();
Apache-request()-pnotes('dbh', $dbh);
  }
  return $dbh;
}

Using pnotes is better than using a global, because mod_perl will make
sure it gets cleaned up after the request even if something goes wrong.

You can use Apache::DBI with this or not, without changing the code.

 My guess is that my handler will clearnup the cache before
 Apache::DBI's handler gets a chance to auto-rollback.

You might get some errors about undefined methods and such from that.

- Perrin




setting lib for mod_perl installation

2001-01-15 Thread Dave Armstrong

I just moved from dedicated to virtual hosting sigh, and was
wondering how to configure mod_perl to install the modules to a
private lib, outside of @INC.

I simply built mod_perl and copied the modules manually to the
destination dir.  However, I keep getting the following error
when trying to start apache+mod_perl: Can't locate loadable
object for module Apache::Constants in @INC (@INC contains:
[correct search paths]...) at /path/to/mod_perl.pm line 14
Compilation failed in require at /path/to/Apache.pm line 6.
BEGIN failed--compilation aborted at /path/to/Apache.pm line 6.
Compilation failed in require at /path/to/Apache/Registry.pm
line 2.
BEGIN failed--compilation aborted at /path/to/Apache/Registry.pm
line 2.
Compilation failed in require at /path/to/startup.pl line 11.
BEGIN failed--compilation aborted at /path/to/startup.pl line
11.
Compilation failed in require at (eval 1) line 1.

Is there something I can pass to the makefile on the command
line to tell it to ignore the @INC and use lib 'lib'? 
Apache/Perl has correct search paths; I have 'use lib qw(lib1
lib2 etc.)' wrapped in a BEGIN block inside my startup file...

Thanks.

Dave



Re: setting lib for mod_perl installation

2001-01-15 Thread Perrin Harkins

On Mon, 15 Jan 2001, Dave Armstrong wrote:
 I just moved from dedicated to virtual hosting sigh, and was
 wondering how to configure mod_perl to install the modules to a
 private lib, outside of @INC.

http://perl.apache.org/guide/install.html#Installing_Perl_Modules_into_a_D

- Perrin




Re: setting lib for mod_perl installation

2001-01-15 Thread ___cliff rayman___

did u check out this section in the guide yet?
http://perl.apache.org/guide/install.html#Installation_Without_Superuser_P

cliff

Dave Armstrong wrote:

 I just moved from dedicated to virtual hosting sigh, and was
 wondering how to configure mod_perl to install the modules to a
 private lib, outside of @INC.


--
___cliff [EMAIL PROTECTED]http://www.genwax.com/







Re: Looking for a new distro

2001-01-15 Thread John Saylor

Hi

( 01.01.13 12:32 -0800 ) Jamie Krasnoo:
 Ok, I've had it with RH 7.0. Too many problems. What Linux distro are some
 of you using with Apache 1.3.14 and mod perl 1.24_01?

Slackware 7.1

And, I'd also consider making the leap to [Free]BSD.

-- 
\js

Milkmen deliver twice a week!



setting lib for mod_perl installation

2001-01-15 Thread Dave

I just moved from dedicated to virtual hosting sigh, and was
wondering how to configure mod_perl to install the modules to a
private lib, outside of @INC.

I simply built mod_perl and copied the modules manually to the
destination dir.  However, I keep getting the following error
when trying to start apache+mod_perl: Can't locate loadable
object for module Apache::Constants in @INC (@INC contains:
[correct search paths]...) at /path/to/mod_perl.pm line 14
Compilation failed in require at /path/to/Apache.pm line 6.
BEGIN failed--compilation aborted at /path/to/Apache.pm line 6.
Compilation failed in require at /path/to/Apache/Registry.pm
line 2.
BEGIN failed--compilation aborted at /path/to/Apache/Registry.pm
line 2.
Compilation failed in require at /path/to/startup.pl line 11.
BEGIN failed--compilation aborted at /path/to/startup.pl line
11.
Compilation failed in require at (eval 1) line 1.

Is there something I can pass to the makefile on the command
line to tell it to ignore the @INC and use lib 'lib'? 
Apache/Perl has correct search paths; I have 'use lib qw(lib1
lib2 etc.)' wrapped in a BEGIN block inside my startup file...

Thanks.

Dave



Re: Looking for a new distro

2001-01-15 Thread Jimi Thompson

Jamie,

I'm sorry you are having problems with it.  I am running it here and it's
fine.  I used Apache Toolbox to install it though, which you will probably
want to take a look at for future reference.  The site is at
www.apachetoolbox.com.  It will install Apache  and most of the major mod's
from source.  It's easy to compile and then all you have to do is adjust the
conf files.

HTH - Next time :)


Jamie Krasnoo wrote:

 Ok, I've had it with RH 7.0. Too many problems. What Linux distro are some
 of you using with Apache 1.3.14 and mod perl 1.24_01?

 Jamie

--
Jimi Thompson
Web Master
Link.com

"It's the same thing we do every night, Pinky."





DBIx::Easy

2001-01-15 Thread Aaron Johnson

Has any one  used DBIx::Easy under mod_perl?

I wrote the author and he indicated that someone had reported a memory
leak under mod_perl which they said has been fixed, but not released.  I
am curious if anyone else has had exprience with this module and if they
have used it in conjunction with Apache::DBI.

Should it work seamlessly or does it need to be overridden to work
correctly with it?

Aaron Johnson




Redirecting a multipart/form-data POST request

2001-01-15 Thread Darren Stuart Embry

I am writing a program that needs to process form data, (here's
the kicker) which is sometimes multipart/form-data, then
redirect a user to a GET request (which doesn't need to process
the form data).  I would like to use the standard mechanism for
issuing a redirect, for other reasons:

$r-header_out('Location' = $url);
return REDIRECT;

I have discovered two ways to achieve redirects from a POST
request if its content is application/x-www-form-urlencoded:

- $r-print() the headers manually and have the handler return
  DONE or HTTP_OK.  This nasty hack is what I am doing at this
  time so I can get redirects from multipart/form-data to
  somehow work.

- convert the POST request to a GET and redirect the standard
  way.  I don't understand why forcing a read of all the data
  coming in from the HTTP request allows redirects to work, but
  it does.

When I do neither, i.e., leave the POST request as is and use
the standard redirect mechanism, the browser hangs and the
server actually does not send the redirect until I hit the Stop
button (I'm using ngrep to determine this).  This also happens
if I use the $r-print($header) method and still return
REDIRECT.

The second method allows me to revert to the use of the default
redirect mechanism, but unfortunately does not work with
multipart/form-data.  I would *really* like to be able to use
the standard redirection mechanism for other reasons.  From the
Apache man page:

   $r-content
   The $r-content method will return the entity body
   read from the client, but only if the request content
   type is `application/x-www-form-urlencoded'.
   ...

Is there a similar technique I can use to read all the
multipart/form-data from the socket and then allow CGI.pm to
continue to process it, and would this work?

Thank you,
Darren

-- 
Darren Stuart Embry.  Kicking down some kind examples of how to keep
your karma clean.  http://www.webonastick.com/
``I base most of my fashion taste on what doesn't itch.''
--- Gilda Radner



Re: Specific limiting examples (was RE: Apache::SizeLimit for unsharedRAM ???)

2001-01-15 Thread Ask Bjoern Hansen

On Thu, 11 Jan 2001, Perrin Harkins wrote:

[...]
 Even a carefully coded system will leak over time, and I think killing off
 children after 1MB of growth would probably be too quick on the draw.  

I tend to set the number to N number of requests. If each httpd
child needs to be forked every 1 requests that's pretty
insignificant and it can save you from some blowups.

[...]
 It would be nice if Apache could dynamically decide how many processes to
 run at any given moment based on available memory and how busy the server
 is, 

It's really hard to take into account other processes on the system
starting and stopping too. And other processes that could be swapped
out. Or couldn't.

 but in practice the best thing I've found is to tune it for the
 worst case scenario.  If you can survive that, the rest is cake.  
 Then you can get on to really hard things, like scaling your
 database.

In my experience setting MaxClients for the mod_perl httpd really
really low (may be as low as 5-10 childs) and letting your mod_proxy
deal with hundreds of clients works great. It all depends though; in
my application I pretty much don't have anything blocking, so I
couldn't get much more done with more childs.

If most of your time to serve a request is spend waiting for the
database you will maybe want more childs going.


 - ask

-- 
ask bjoern hansen - http://ask.netcetera.dk/
more than 70M impressions per day, http://valueclick.com




Re: Redirecting a multipart/form-data POST request

2001-01-15 Thread Ask Bjoern Hansen

On Mon, 15 Jan 2001, Darren Stuart Embry wrote:

[...] 
 When I do neither, i.e., leave the POST request as is and use
 the standard redirect mechanism, the browser hangs and the
 server actually does not send the redirect until I hit the Stop
 button (I'm using ngrep to determine this).  This also happens
 if I use the $r-print($header) method and still return
 REDIRECT.

Try adding 

$r-method('GET');
$r-headers_in-unset('Content-length');

to your code before doing the return REDIRECT.


 - ask

-- 
ask bjoern hansen - http://ask.netcetera.dk/
more than 70M impressions per day, http://valueclick.com





Re: ANNOUNCE: TPC5: mod_perl track: Call For Papers

2001-01-15 Thread Gerald Richter

Hi Stas,

 Ok, the CFP is officially out, let those proposals come in:

 All the details can be found here:
 http://perl.apache.org/conferences/tpc5-us/cfp.html


I didn't found a link from anywhere to that page. I don't think it was your
intention to hide that page. Shouldn't at least on http://perl.apache.org
and on http://conferences.oreilly.com/perl5/ a link point the people, who
wants to submit something mod_perl related, to that page ? I guess the
intention was that _all_ mod_perl related things are submitted to email
there and not to the official tpc5 address, is this right?

Gerald


 Notice that while our cfp resembles the general CFP
 http://conferences.oreilly.com/perl5/ it's not the same, so don't confuse
 the two. Ours has the magic mod_perl token on the top :)

 I think I've summarized the last CFP thread into a pretty long wishlist of
 topics. If something is missing and you think it's relevant to mod_perl
 and interesting to the hear about submit as well.

 Thank you for your support! Looking forward to meeting you all in person
 at ApacheCon and TPC5.

 _
 Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
 http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
 mailto:[EMAIL PROTECTED]   http://apachetoday.com http://logilune.com/
 http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




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

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






Re: [Fwd: AuthenDBI idea]

2001-01-15 Thread Ask Bjoern Hansen

On Mon, 15 Jan 2001, Edmund Mergl wrote:

 any comments ?

[count number of times a user has logged in and such things]

Other people would like to count / note / ... other things.

It would be neater if you made an API the programmer could plug his
own stuff into. Like "call this class/sub/foobar" when the user logs
in, enters an invalid password, ...  

If you are nice you could then make the example code do the "count
number of times logged in" thing. :-)


 - ask

-- 
ask bjoern hansen - http://ask.netcetera.dk/
more than 70M impressions per day, http://valueclick.com




Re: Specific limiting examples (was RE: Apache::SizeLimit for unsharedRAM ???)

2001-01-15 Thread Perrin Harkins

On Mon, 15 Jan 2001, Ask Bjoern Hansen wrote:
 I tend to set the number to N number of requests. If each httpd child
 needs to be forked every 1 requests that's pretty insignificant
 and it can save you from some blowups.

The reason I like using SizeLimit instead of a number of requests is that
it won't kill off processes when there isn't a problem.  It also catches
situations where you occasionally do something that raises the size of a
process significantly by killing those off sooner.

- Perrin