Re: [RELEASE CANDIDATE] Apache::Test 1.03-dev

2003-06-24 Thread Rob Bloodgood
Wednesday, June 18, 2003, 2:13:46 AM, you wrote:

SB> I've uploaded 1.03's release candidate. If nobody finds any faults, I'll 
SB> upload it tomorrow on CPAN. (libapreq needs to rely on 1.03 fixes to release 
SB> its 1.2's version).

SB> Please try it out:
SB> http://www.apache.org/~stas/Apache-Test-1.03-dev.tar.gz

SB> Test it with mod_perl 1.0:

SB> perl Makefile.PL -httpd /path/to/1.x/httpd && make test

Fails for me miserably.  For some reason, the test server config
returns 403 on / and /index.html:

t/logs/error_log:
[Tue Jun 24 13:02:22 2003] [info] created shared memory segment #589827

t/logs/access_log:
127.0.0.1 - - [24/Jun/2003:13:02:23 -0700] "GET /index.html HTTP/1.0" 403 208
127.0.0.1 - - [24/Jun/2003:13:02:24 -0700] "GET / HTTP/1.0" 403 198
127.0.0.1 - - [24/Jun/2003:13:02:24 -0700] "GET / HTTP/1.0" 403 198
127.0.0.1 - - [24/Jun/2003:13:02:24 -0700] "GET / HTTP/1.0" 403 198
127.0.0.1 - - [24/Jun/2003:13:02:24 -0700] "GET / HTTP/1.0" 403 198
127.0.0.1 - - [24/Jun/2003:13:02:24 -0700] "HEAD / HTTP/1.0" 403 0
127.0.0.1 - - [24/Jun/2003:13:02:24 -0700] "HEAD / HTTP/1.0" 403 0
127.0.0.1 - - [24/Jun/2003:13:02:24 -0700] "HEAD / HTTP/1.0" 403 0
127.0.0.1 - - [24/Jun/2003:13:02:24 -0700] "GET / HTTP/1.0" 403 198
127.0.0.1 - - [24/Jun/2003:13:02:24 -0700] "GET / HTTP/1.0" 403 198

This occurs on *multiple* Linux systems.  I'm using Apache-1.3.27 and
mod_perl 1.27 on all of them.  The above log files are absolutely
identical on all of them except for the timestamps.

I'm listing their system names and perl -V outputs below, for
reference.

I poked around in the Apache::Test tree for a minute, and found a
variable in TestRequest called $DebugLWP.  Setting that to true made
the output only slightly more informative, but did confirm 403 status
on the test requests:

[EMAIL PROTECTED] Apache-Test-1.03]# make test

/usr/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -clean
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -clean
APACHE_USER= APXS= APACHE_PORT= APACHE_GROUP= APACHE= \
/usr/bin/perl -Iblib/arch -Iblib/lib \
t/TEST -verbose=0 
*** setting ulimit to allow core files
ulimit -c unlimited; t/TEST -verbose=0
*** root mode: changing the fs ownership to 'nobody' (99:99)
/usr/sbin/httpd -X -d /root/.cpan/build/Apache-Test-1.03/t -f 
/root/.cpan/build/Apache-Test-1.03/t/conf/httpd
.conf -DAPACHE1 
using Apache/1.3.24 

waiting for server to start: .
waiting for server to start: ok (waited 0 secs)
server localhost.localdomain:8529 started
#lwp request:
#GET http://localhost.localdomain:8529/index.html HTTP/1.0
#User-Agent: libwww-perl/5.69
#
#server response:
#HTTP/1.1 403 Forbidden
#Connection: close
#Date: Tue, 24 Jun 2003 20:02:23 GMT
#Server: Apache/1.3.24 (Unix) mod_perl/1.26
#Content-Length: 208
#Content-Type: text/html; charset=iso-8859-1
#Client-Date: Tue, 24 Jun 2003 20:02:23 GMT
#Client-Peer: 127.0.0.1:8529
#Title: 403 Forbidden
#X-Content-Length-Note: added by Apache::TestRequest
#
ping...ok
request# Failed test 1 in request.t at line 11
# Failed test 5 in request.t at line 16
# Failed test 8 in request.t at line 20
# Failed test 9 in request.t at line 22
FAILED tests 1, 5, 8-9
Failed 4/9 tests, 55.56% okay
Failed Test Stat Wstat Total Fail  Failed  List of Failed
---
request.t  94  44.44%  1 5 8-9
*** server localhost.localdomain:8529 shutdown
!!! error running tests (please examine t/logs/error_log)
make: *** [run_tests] Error 1

So... What more can I check?  What more can I report?  I'm definitely
no newbie but I don't know my way around this code... I can send
anything you need, or try anything.

Thanks in advance!

L8r,
Rob

=
System listings and perl -V outputs.

1) Linux RedHat 6.2

Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
  Platform:
osname=linux, osvers=2.2.5-22smp, archname=i386-linux
uname='linux porky.devel.redhat.com 2.2.5-22smp #1 smp wed jun 2 09:11:51 edt 1999 
i686 unknown '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
  Compiler:
cc='cc', optimize='-O2', gccversion=egcs-2.91.66 19990314/Linux (egcs-1.1.2 
release)
cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=undef, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
alignbytes=4, usemymalloc=n, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -ldl -lm -lc -lposix -lcrypt
libc=, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Charact

RE: [OT] Query

2003-01-07 Thread Rob Bloodgood
>   I would like to know any such standalone servers that could
> process the perl requests offline (taking requests from a file or
> queue end).
>
>   I definitely would like to get fancier as my requirement is
> immediate.  Upon finding a server that could process the requests
> away from mod_perl, I most probably would modify mod_perl to
> communicate with the standalone servers via sockets (and maybe
> maintain persistence).

Well, I had a need like this, and I wrote a standalone server that my
mod_perl processes communicate with, using POE (http://poe.perl.org).  My
POE server has, among other features, a TCP line-based interface.  I can
test it with a simple telnet, or using netcat(1).  It meets my needs, but be
advised that this server itself had (has!) a pretty substantial development
time investment involved as well... and that is aside from simply learning
how to make things work in POE!

However, by no means should you consider POE your only opportunity... there
are any number of ways to write a server daemon that can communicate with
another process via TCP or pipe or whatever.

That being said, this thread is now completely aside from mod_perl, and I
agree it should terminate.  But if you decide to pursue POE, then I'll see
you on the POE list!

L8r,
Rob




RE: [OT] Redirect POST to POST off-site?

2003-01-02 Thread Rob Bloodgood
(sorry about the blank reply a minute ago)

> I am looking into the more advanced paypal instant notification
> stuff for the next version of my sw, but version one is using a
> simpler approach to get it out the door. Even that paypal sw
> wouldn't solve my problem, which is to make sure that the POST to
> paypal actually matches the transaction that the user has built up.

I found IPN to be *very* simple to use, logging the notifications to a DB
and then acting as required.  I would even be happy to send you my
notification script, which uses Apache::Registry but is really just a simple
POST BACK to paypal and when the response is 'OK', take the appropriate
action (payment received, account terminated, etc) (but please reply
privately if you want it).

The only nits I experienced were A) forgetting to send back the "OK\r\n" to
paypal that they expect to see from a successful notify.  They called me and
wondered if my script was broken... B) having to set up a unique index on my
logging table on the "verify_sign" field, because in spite of the correct
response chain, paypal has a tendency to notify repeatedly and redundantly.

HTH!

L8r,
Rob




RE: AuthCookieDBI help please.... (more info)

2002-10-16 Thread Rob Bloodgood

> -Original Message-
> From: George Valpak [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 16, 2002 3:26 PM
> To: Vegard Vesterheim
> Cc: [EMAIL PROTECTED]
> Subject: Re: AuthCookieDBI help please (more info)
>
>
> I am still having trouble with Apache::AuthCookieDBI.
>
> I tried moving the PerlSetVar line out of the virtual server to
> the main server but nothing in the behavior changed.
>
> Is it possible that the "Apache->server->dir_config()" code is
> somehow wrong?

Move ALL mention of the AuthCookieDBI directives OUT of any Directory,
Location, or VirtualServer blocks.  Define the secret key PerlSetVar BEFORE
loading PerlModule directive.

The relevant section of my server config looks like this:
# These must be set
PerlSetVar AdminDBI_DSN "dbi:Oracle:STATS"
PerlSetVar AdminDBI_SecretKeyFile /etc/httpd/conf/sercret.key
PerlSetVar AdminDBI_SecretKey "XXX"

# moved BELOW AdminDBI_SecretKeyFile so the directive is available at
# BEGIN{} time
PerlModule Apache::AuthCookieDBI
PerlSetVar AdminPath /admin
PerlSetVar AdminLoginScript /scripts/adminlogin.pl
#PerlSetVar AdminLoginScript /error/adminlogin.html

## more directives here

Hope this helps!

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;




notes/pnotes broke between 1.25=>1.27

2002-06-26 Thread Rob Bloodgood

So I got the advisory about the Apache servers having a security hole, so I
decided to upgrade some servers.  I've been on v1.25 for awhile, so decided
to upgrade to 1.27 while I was at it... big mistake.

NONE of my notes/pnotes were getting thru, on the new version.

It took me 8 or 10 compilations, with 3 different apache versions and 4
different mod_perl versions, to establish that definitiely, on my machine
(RedHat Linux 6.2, custom apache, custom perl 5.005_03), the upgrade breaks
notes AND pnotes.

PLEASE tell me I missed something??? RTFM would be ok but I haven't found it
yet.

L8r,
Rob




RE: Problem with DBM concurrent access

2002-04-04 Thread Rob Bloodgood

> So my question narrows down to :
> How to flush on disk the cache of a tied DBM (DB_File) structure
> in a way that any concurrent process accessing it in *read only* mode
> would automatically get the new values as soon as they
> are published (synchronisation)

Isn't that just as simple as

tied(%dbm_array)->sync();

?

HTH!

L8r,
Rob



RE: Host name lookups are Off but...

2002-04-03 Thread Rob Bloodgood

> We have a mod_perl server that's under constant heavy load.  In
> our Apache
> config we have switched HostnameLookups off using
>
> HostnameLookups off
>
> and for the most part, it seems to work.  However, any check of
> the logs or
> /server-status shows that the server is *still* doing
> reverse-lookup of some
> addresses.  Often, a number of apache processes show up as "D" in
> /server-status, and it's pretty clear that it's slowing things down.
>
> Does anyone have any idea what might be causing this?  Could it
> be something
> in the mod_perl config?  Nowhere in any of our code do we do hostname
> resolution and for the most part couldn't care less what host/ip
> people come
> from.
>
> Sorry if this is the wrong list but I have a sneaking suspicion there's
> something about our mod_perl config that's affecting it.
>
> RTFM's are welcome...  I already tried but maybe I missed something.

This one bit me a couple of years ago.  *IN MY CASE* it was incorrect usage
of the Allow/Deny, I specified
Allow from all
Deny from none

The problem was, the webserver doesn't recognize "none" as a special value
like it does for "all"... so "none" became a hostname,

*** which enabled HostNameLookups for the whole webserver. ***

Look in every single place where you have access control by ip/hostname.
Make sure there are no hostnames, only ip.  Once Apache turns on
HostnameLookups, it's global.

HTH!

L8r,
Rob


#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





RE: Cookies and IE in mod_perl

2002-03-27 Thread Rob Bloodgood

> I've determined that it isn't the redirect causing the cookies not
> to be set.  If I take out the redirect, and just try to set a cookie
> w/o a redirect, it still doesn't set the cookies in IE.  Does M$
> have any docs on how IE6 handles cookies that I can look this up on?

YES, they do.
You have to setup the Privacy Policy,
which means you have to have a P3P header coming out of your webserver with
each request.

You'll want to lookup the details and docs, and PLEASE customize for your
own website, but...

*I* fixed this by adding this to my httpd.conf (and I got it from this
mailing list anyway :-):

# P3P Policy (required for IE6 to accept our cookies)
Header add P3P "CP=\"NOI DSP COR CURa PSDa OUR NOR NAV STA\""

This requires mod_headers to be loaded or compiled into Apache.

Good luck!

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





RE: 'Pinning' the root apache process in memory with mlockall

2002-03-22 Thread Rob Bloodgood

> Stas Bekman wrote:

> > Moreover the memory doesn't get unshared when the parent pages are
> > paged out, it's the reporting tools that report the wrong
> > information and of course mislead the the size limiting modules
> > which start killing the processes.
> 
> Apache::SizeLimit just reads /proc on Linux.  Is that going to report a 
> shared page as an unshared page if it has been swapped out?
> 
> Of course you can void these issues if you tune your machine not to 
> swap.  The trick is, you really have to tune it for the worst case, i.e. 
> look at the memory usage while beating it to a pulp with httperf or 
> http_load and tune for that.  That will result in MaxClients and memory 
> limit settings that underutilize the machine when things aren't so busy. 
>   At one point I was thinking of trying to dynamically adjust memory 
> limits to allow processes to get much bigger when things are slow on the 
> machine (giving better performance for the people who are on at that 
> time), but I never thought of a good way to do it.

Ooh... neat idea, but then that leads to a logical set of questions:
Is MaxClients that can be changed at runtime?
If not, would it be possible to see about patches to set this?
:-)

L8r
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;
 



RE: [WOT] emacs and WEBDAV

2002-03-14 Thread Rob Bloodgood

> At 11:30 AM -0800 3/14/02, Rob Bloodgood wrote:
> >The problem is, concurrency.  Dreamweaver has versioning built
> >in... but emacs has no way to recognize it.  So when I make a fix
> >to a file, if the designers aren't explicitly instructed to >
> >refresh-from-the-website-via-ftp, my changes get hosed.
>
> Versioning, no.  Locking, yes, optionally.  (Well, I guess it can do
> versioning via SourceSafe, but not via anything else.)  I'm seriously
> hoping they'll address that in the next release.

 I meant locking.  Not versioning.  e-Foot in e-Mouth.

> Emacs over WebDAV should work fine if you run something that supports
> WebDAV as a filesystem (e.g. OSX), but that's not going to help you
> much.

If we're talking about LOCKING, is this statement still true?

> There are two options I can think of.
>
> 1. If your designers aren't making use of checkin/checkout in
> DreamWeaver, then simply make it clear to them that before they can
> save a file to the server, they have to do a sync first.  Make the
> final repository sit on CVS, and do a checkin every night.  So if
> something does go wrong you can at least pick up the previous day's
> work.

That (the train-them-to-sync-first part) has been what I've been forced to
do so far.  I haven't gone so far as to set up a CVS for the website tho.
Thx for the, I'll look into it.

> 2. DreamWeaver's locking mechanism is handled by placing lock files
> on the server.  Those files have the info about who has what.  It
> ought to be possible to write an emacs extension that would use those
> files.

Certainly.  But my original message mentioned the REAL source of my
frustration: I'm pretty limited at elisp, otherwise I might have already had
this worked out. :-)

L8r,
Rob




[WOT] emacs and WEBDAV

2002-03-14 Thread Rob Bloodgood

I'm running a Mason based website, and I use Emacs when I write code.
My web designers use Dreamweaver.  I've designed the site so that my web
guys have to reserve me one table cell (or more than one depending on where
in the site, but you get the point) where I put a single dispatch  component
to the dynamic content appropriately.

The problem is, concurrency.  Dreamweaver has versioning built in... but
emacs has no way to recognize it.  So when I make a fix to a file, if the
designers aren't explicitly instructed to refresh-from-the-website-via-ftp,
my changes get hosed.

DW also speaks WEBDAV natively, but emacs does not.  Emacs speaks CVS
natively, but DW does not.  DW also speaks SourceSafe , but I never
took that seriously... :-)

I've been trying, in various attempts over the past two years, to come up
with a compromise between the two.  The closest I've come was somebody
mentioned a CVS emulation layer over a DAV repository... but that never came
to fruition.  And even more frustrating, I haven't managed to pick up enough
eLisp to do it myself w/ vc.el .

Does anybody have any ideas for my next direction to turn?

TIA!

L8r,
Rob




RE: mod_perl and perl RPMs and Oracle 9iAS

2002-03-06 Thread Rob Bloodgood

> I've always used DBI along with DBD::Oracle for Database access, and I
> intend to use them along  Oracle 9iAS's other capabilities.
>
> So if I'm following you correctly, the steps involved are:
> -get the 5.6.1 RPM (which doesn't seem to be in Red Hat's site anyway)
> -get the Apache 1.3.19 sources (to be used in the next step), then
> 'discarded' without installing Apache per se.
> -get the mod_perl 1.24_01-2.src.rpm and compile it as a DSO
> -reinstall all previously installed packages, so other programs
> using them
> keep working
> -install the modules the mod_perl apps require
> -change the apachectl and httpd.conf files to reflect the proper
> perl 'home'
> -change httpd.conf to load the mod_perl.so file from it's new location
>
> Is this list OK?

Hmm... if you like RPM's, then you should
download the updated perl-5.6.1 in the UPDATES/ERRATA section for RH7.2

reinstall all required packages, USING CPAN for the stuff you needed
before.

the rest depends: are you comfortable with RH rpm version of Apache? If you
use that, plus the new, updated mod_perl-1.26 RPM (which is DSO, and is also
on the Errata page), your configuration and recompilation is no longer
necessary.  Otherwise, you have the right idea.

> > > Yes, there are at least two modules: mod_plsql and mod_oprocmgr
> > > for which which there is no source, so rebuilding seems to be
> > > out of the question
> >
> >Those modules are *only* for the Oracle administrative webservice, as I
> >mentioned above.  If you want to use Oracle from Perl/mod_perl, do it
like
> >everybody else: DBI and DBD::Oracle (for the record, I build them for 9i
> >several months ago with 0 headaches).  This *does* include the ability to
> >execute PL/SQL.
>
> The mod_plsql is called heavily from the Oracle 9iAS Portal
> applets, so it needs to be kept in place.

So are you using Oracle Portal applets, or mod_perl?  We seem to have
miscommunicated somewhere.

Yes, it needs to be kept in place... because you aren't touching that copy
of apache and perl, right? :-) I mean, if you want to use the supplied
Oracle stuff that badly, then put it on a different port number.  That way
you can reference the Oracle stuff without being trapped in a little box
where you're afraid to recompile/reconfigure/make more useful for YOUR
situation.

L8r,
Rob




RE: mod_perl and perl RPMs and Oracle 9iAS

2002-03-06 Thread Rob Bloodgood

> Perrin Harkins wrote:
> >Rafael Caceres wrote:
> >>I'm facing a dilemma here. We are testing an Oracle 9iAS installation
> >>(Apache 1.3.19, mod_ssl 2.8.1, mod_perl 1.25 as DSO, Perl 5.005_03) on
> >>Red Hat Linux 7.2, which itself came with Perl 5.6.0, and from your
> >>comments, that's bad..
> >
> >First of all, if it's working for you then don't worry about it.
>
> I have not started testing scripts that currently work on other boxes. I
> will install the required modules for the 5.005_03 perl used by Oracle
> 9iAS, and see what happens.
> This road forces me to have the two perl versions coexisting, or,
> to search
> for all the perl modules installed for the 5.6 version by the rpm's on
> initial installation, install them for the 5.005_03 version and
> then remove
> the 5.6 one permanently.

OK, for starters:
Oracle includes their own version of perl/apache/mod_perl for the Web
interface they are bundling with the new 9i servers.  It's their own
version, built by their own people, for their own usage, on their own
product, in its own path, under the Oracle product installation tree.

Let 'em have it.  It's only a few megs of disk space, and if your 9i
installation works, GREAT.  Don't think of it as two versions co-existing.
Think of it as Oracle's insurance to themselves that their system will have
the exact parts it needs.  Besides, except for a few configuration files,
shouldn't everything under $ORACLE_HOME be considered hands-off anyway?

Now, on to the real world: 10 minutes ago I just saw a post by a RedHat
employee stating that there are new RPM's for Perl 5.6.1 and the latest
mod_perl.  Which means you can download and install them, and THEN begin
installing other modules, like Apache::DBI, Apache::Session, etc etc
according to your needs, into the "real" perl installation tree, where all
of YOUR system's perl modules live.

> Yes, there are at least two modules: mod_plsql and mod_oprocmgr for which
> there is no source, so rebuilding seems to be out of the question

Those modules are *only* for the Oracle administrative webservice, as I
mentioned above.  If you want to use Oracle from Perl/mod_perl, do it like
everybody else: DBI and DBD::Oracle (for the record, I build them for 9i
several months ago with 0 headaches).  This *does* include the ability to
execute PL/SQL.

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





RE: Multiple Location directives question

2002-03-05 Thread Rob Bloodgood

> Answering my own question, I stupidly forgot that I had a TransHandler up
> above mucking my URLs before the Location directives got a chance
> to try to match.  So my /foo location block was never seeing a /foo URL.
>
> Still, I'm glad to see that the old system of "post to a public list and
> then immediately find your dumb error" still works like a charm :)

Well, my response has just left the building, and the only thing I can think
of right now (about my hasty response) is something I once saw on FidoNet:

"Open mouth, insert foot, echo internationally."



L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





RE: Multiple Location directives question

2002-03-05 Thread Rob Bloodgood

> >>What I want is for My::Foo to handle all URLs that start with "/foo",
> >>without any authentication of any kind.  Then I want the
> remaining URLs to
> >>be handled by My::Bar using its authentication handlers.
>
> Seems like it should work to me.
>
> > this may be one of those cases where "/" is handled as a special case.
>
> Or maybe it's because there is no actual document there?  Maybe
> installing a transhandler would help.
>
> PerlTransHandler  Apache::OK

A TransHandler?

> But this is just a stab in the dark really.

OK am I the only one who see this as a nesting issue? HIS config, arranged
logically, starts with

> >>
> >>  SetHandler perl-script
> >>  PerlHandler My::Bar
> >>
> >>  AuthName Bar
> >>  AuthType Basic
> >>  PerlAuthenHandler My::Auth::Bar
> >>  PerlAuthzHandler  My::Authz::Bar
> >>  require valid-user
> >>

OK, we have set ALL URL's (because Auth nests) to be under My::Auth*::Bar.
But below, we want to NOT be under THAT realm for /foo, so:

> >>
> >>  SetHandler perl-script
> >>  PerlHandler My::Foo
AuthName OK
  AuthType Basic
  PerlAuthenHandler Apache::Constants::OK
  PerlAuthzHandler  Apache::Constants::OK
> >>

We've now overriden the higher-level of auth.

I have NOT tested this... lemme know!

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





RE: [ANNOUNCE] libapreq 1.0 released [OT?]

2002-02-25 Thread Rob Bloodgood

>
> more information is at:
>
>   http://httpd.apache.org/apreq/

Am I the only one that noticed that the web page thinks 1.0 was released 4
months before 0.33? :-)

News
February 21, 2001 - libapreq-1.0 was released.

June 19, 2001 - libapreq-0.33 was released.

December 23, 2000 - libapreq-0.31_03 was released for testing.

December 17, 2000 - libapreq-0.31_02 was released for testing

L8r,
Rob




RE: Apache::Session

2002-02-25 Thread Rob Bloodgood

> I am using Apache::Session with Postgresql. Unfortunately I had
> never worked with a huge amount of data before I started to program
> something like a (little) web application. I happily packed
> everything in the "session"(s-table) that might be of any use. It
> hit me hard that it takes a veeey long time to get all the stuff
> out of the "session"(s-table) each time the client sends another
> request.

Sorry if this is obvious, but
do you have an index on your sessions table, on the sessionid column?
Because, without an index, PG will have to do a full table read for each
request.  Which means the more sessions you get, the slower each lookup is
going to be.  Whereas, if you index SESSIONID (or SESSION_ID or whatever it
is), it can go right to the row in question and return it immediately.

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





RE: mod_perl, mod_gzip, incredible suckage

2002-02-14 Thread Rob Bloodgood

> > Ditto here. Working quite well on fairly high volume servers.
>
> Hrmm how interesting.  My Apache is built with PHP (with DOM, MySQL, and
> Postgres) and mod_perl.  With mod_gzip enabled it simply segfaults on
> every single request.

have you looked at the work at http://www.apachetoolbox.com/ ?
This guy has an automated system for choosing what modules/packages to
install, then download/extract/patch/compile/install automatically.

He seems to be able to get ssl, php, gzip, and mod_perl all working at the
same time.

That might not be what you need, but if perhaps you were to review how he
handled gzip/php/etc, you might see what obscure flag or switch might be
affecting things poorly.

Good luck!

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





RE: [QUESTION]PerlHandler and PerlLogHandler Phase

2002-02-01 Thread Rob Bloodgood

> 2.If the answer to the above question is YES? The
> Handler will add headers,footers for everything. What
> do I need to do to apply the handler logic just to the
> requested page and return the remaining files that are
> needed to complete the requested page as they are?

In the Eagle book (as well as a Perl Journal article) there is an example of
a Apache::Header/Apache::Footer.  CPAN doesn't show them right now.  But you
could implement them as filters using Apache::Filter to mark up each
document on its way out, based on URI.

> 3. When I move these JS files outside the /en/course
> URI they seem to work? But now when I put them with
> in? It just displays the Javascript code like simple
> text on the browser.


... or you could template them in directly, since you're playing w/ the
content already.

> 4. In the Logging Phase, I need to store the last
> requested page as a bookmark. So if the user logs out,
> and logs back in it takes him to the same page. Since
> the html files are made up of some many requests to
> other files, it stores the last file it requested. It
> may be path to an image file,style sheet file etc...
> Is there any way I can circumvent this problem?

You could use a cookie, issued with each document, noting what url they are
on right now??  Logging it (storing it) and then reading it back are bound
to be way too much work.

HTH!

L8r,
Rob




[OT] RE: New mod_perl Logo

2002-01-30 Thread Rob Bloodgood

Uhh... the platypus, the wombat, the tazmanian devil, and the emu.
  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, January 30, 2002 1:54 PM
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: Re: New mod_perl Logo


  In a message dated 30-Jan-02 6:08:29 AM GMT Standard Time,
[EMAIL PROTECTED] writes:



All these American-style names are verging on the racist.

This is world-wide code, not f---ing American-wide code.




  Don't let the crappy AOL account fool you. Nessie is about 3 hours from
here. The Yetti I believe is indiginous to Asia isn't it?

  And as for australian beasties ... I just couldn't think of any off the
top of my head ... .

  -Chris
  [EMAIL PROTECTED]




test, pls ignore

2001-12-31 Thread Rob Bloodgood

un/re subscribed to a different addy, THIS IS JUST A TEST!



RE: Comparison of different caching schemes

2001-12-14 Thread Rob Bloodgood

> Another powerful tool for tracking down performance problems is perl's
> profiler combined with Devel::DProf and Apache::DProf.  Devel::DProf
> is bundled with perl. Apache::DProf is hidden in the Apache-DB package
> on CPAN.

Ya know the place in my original comment where I was optimizing a different
subsystem?  I just discovered Devel::DProf last week (after 5 *years* of
perl... ), and was using that.  *AND* had improved a sore
spot's performance by 10% without even working hard, because of profiling.
Point taken.

> At the same time I added some code to track the time it takes to
> process a request using Time::HiRes.  This value is set as a note via
> $r->note('REQTIME').  A customlog directive takes care of dumping that
> value in the logs...

Hmm... I was already logging a status message via warn(), I did the SAME
TRICK but stored it in a local variable because I didn't need to go as far
as a customlog...

Sounds like great minds think alike! :-)

L8r,
Rob
#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





RE: Comparison of different caching schemes

2001-12-14 Thread Rob Bloodgood

> > Again, thank you, Rob.  This is great,
>
> > * Cache::FileCache (uses Storable)
> > * Cache::SharedMemoryCache (uses Storable)
> - Can specify the maximum cache size (Cache::SizeAwareFileCache) and/or
> maximum time an object is allowed in the cache
> - Follows the Cache::Cache interface system

I run / wrote ExitExchange (www.exitexchange.com).

I was using Cache::SharedMemoryCache on my system.  I figured, "Hey, it's
RAM, right?  It's gonna be WAY faster than anything disk-based." (I was
originally using IPC::Shareable and the caching model from the Eagle, but
IPC::Shareable broke after like, 0.50 or something so it makes NEW shm
segments with EVERY write.)

Then I saw your benchmarks... boy was I wrong!

My statistics system (count.exitexchange.com) is a dual PIII/1GHz, w/ 2GB of
RAM.  I'm serving approximately 2 million server-parsed, mod_perl generated
hits/day.  Until the other day, the system load average was usually between
12 and 21 (!), and response times were in the 3-10 second range. 
I've been sweating and worrying about optimizations in an entirely different
part of the system than the webserver, figuring I missed something in THAT
part...

Based on your benchmarks, I simply s/SharedMemoryCache/FileCache/ and tried
it again.

For the past two days, I've been at .25 second response times (and that's
including the overhead of loading and executing the app that makes the req)
and server load is < 1, consistently.

In short, your work has saved my ass.

THANKYOUTHANKYOUTHANKYOUTHANKYOU
and Merry Christmas!

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





RE: anyone know a trick with displaying 401 error messages for top level protected sites?

2001-12-11 Thread Rob Bloodgood


> for example if the protected url was http://www.site.com/ the user
> would be redirected to http://www.site.com/error/401 for the error
> message.. and because its protected wouldnt display the custom error
> page instead displaying the following error "Additionally, a 401
> Authorization Required error was encountered while trying to use an
> ErrorDocument to handle the request.". Which i can understand.


How about 
Put your 401 html page into a directory like /error.
Set the PerlAuthenHandler for /error to Apache::Constants::OK:


AuthType Basic
PerlAuthenHandler Apache::Constants::OK

# This 'require' is actually required. :-)
require valid-user


Do the same for the dir where any/all of its images are located 
-- or -- 
Put the images specific to the 401 handler in /error.

That should do it.
(but I haven't tested it, so YMMV :-).


L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;
 



RE: Auth Handlers

2001-12-11 Thread Rob Bloodgood

> : )  No problem,  I guess I am unsure if this is the proper way
> to setup an
> Access, Authen, Authz handler.  When I use this configuration my
> 'handler()'
> method does not get called and I get an error in the logs:

This is *not* the correct way to invoke it.

> > > 
> > > AuthName "Login"

# This is incorrect
#  AuthType Base::Session::Handler

# *This* is what you need if you want the
# browser to prompt for a username/pass
AuthType Basic
> > > require valid-user
> > >
> > > PerlAuthenHandler Base::Session::Handler
> > > 


I just checked my answers from the Eagle (Writing Apache Modules with Perl
and C), and that's the correct way.  If I'm not mistaken, the chapter on
Authentication is one of the sample chapters that's online at
http://www.modperl.com.  Have a look over there, it'll straighten you right
out. :-)

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;





RE: ErrorDocument 401 problem..

2001-12-10 Thread Rob Bloodgood

> How i expected the ErrorDocument directive to behave was as
> follows: WHEN there was an error 401 (ie the user had logged in 3
> times and failed) there would be an error page shown (in this case
> it would be /error/401).  But instead what seems to be happening as
> soon as a user goes to an authorisation required area they are just
> displayed the errordocument page right away without even being asked
> to login, forgive me if im wrong but this surely means the
> ErrorDocument handler is behaving in a non-standard way with
> mod-perl as opposed to using static pages as error urls. I have
> included the module, its only small and ive cut out some of the
> useless code to keep it short.

is your module calling
$r->note_basic_auth_failure
before it does a
return AUTH_REQUIRED;
?

$r->note_basic_auth_failure inserts the header WWW-Authenticate into the
header stream, which when combined with an error 401 signals a browser to
give a password prompt.  The BROWSER SOFTWARE (*NOT* your webserver) will
prompt the user for a password, often 3 times but that's not required.
After that third time, the browser simply displays the 401 page that it's
been seeing *the whole time*, instead of prompting you for a password again.
Without that WWW-Authenticate header, the browser has no choice recourse
except to show the 401.

HTH!

L8r,
Rob




RE: [OT] Re: How to create a browser popup window

2001-11-20 Thread Rob Bloodgood

> You must include code to deal with the fact that you may have already
> opened a popup window. Something like this:

That is simply not true.  window.open() with a named window ('popupwin', in
your example) ALWAYS reuses that window, on every browser I've ever been
able to test.  The second call to window.open, with a new URL, simply
refreshes the contents of the popup w/ the new URL.  Note, this is *only*
true for named windows.  Windows without a window name string as the second
parameter to window.open() will open a new window every time.

It can, however, be a good idea to explicitly call focus() on your child
window, because in the situation I've just mentioned, if the child window's
url is refreshed, it is NOT automatically brought to the foreground.

The original post was wondering how to put mod_perl output in a popup
window.  The answer is simply top call window.open() with the URL of the
mod_perl handler as its location.

If one is trying to be "responsible" about the window(s) being open, adding
a link like

CLICK HERE CLOSE THIS WINDOW

in the child window is usually reasonably simple for the user to understand.
Of course, the normal caveats about users understanding something still
apply...

A corrected version of your sample script follows.  It's much simpler now...
:-)

> 
>