Re: mod_perl-1.99_01-dev

2000-04-21 Thread Matt Sergeant

On Thu, 20 Apr 2000, Doug MacEachern wrote:

> eric and stas already let the cat out of the bag, but i was planning to
> give a summary of what's in progress for mod_perl-2.0 anyhow :)
> i've included a summary of the pieces i'm currently working on, there's a
> great deal left to do, but it's looking good and moving along fast.
> i'll be putting these design notes into cvs soon, along with a
> bigger-picture plan, which should make it easy to see where folks can help
> out if you're interested...

[snip]

Awsome!

One thing you failed to mention was backward compatibility - what is your
intention with regard to that?

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




Re: in configs

2000-04-21 Thread w trillich

sorry i haven't been clearer about this:

with a few inserted debug statements (say, printing
the string to my tty directly) i can tell that the perl
code gets executed.

but no apache settings are affected. ZERO effect on apache.
doesn't act as if its done a damn thing. apache ignores it
even though it executes. the only settings it goes by
are the ones in the httpd.conf/srm.conf/access.conf files
which existed before/after (independent of) this script
being called.


package Apache::ReadConfig; # in case that isn't set

my $set = <<"END_SETTINGS";

ServerAdmin webmaster\@$host
DocumentRoot $docroot
ServerName $host
DirectoryIndex index # index.html index.cgi
CustomLog $logroot/access.log common
CustomLog $logroot/referer.log referer
CustomLog $logroot/agent.log agent
ScriptLog $logroot/scriptDebug.log

@{[join "", map <
END_SETTINGS

Apache->httpd_conf($set);

__END__

that's basically the script (with the variables filled in, 
inside a loop, of course). 

# apachectl configtest
Syntax OK
# apachectl graceful
# 

so i go to my browser and try going to one of my virtual
hosts:
http://virtual1.myhost.com/
and instead of the files at the proper docroot, i get
http://www.myhost.com/
files--i.e. apache has gotten no virtual host directive.
none.

so forget that i looked for useful data under /server-info
and /perl-status... the fact that it matches the apache
setup (i.e. IT'S WRONG) seemed to be a reasonably accurate
report of a screwy situation.

THE PERL CODE IS RUNNING, BUT *NOT* AFFECTING ANY APACHE SETTINGS.

do i need to write the string to a file and then INCLUDE
it in the httpd.conf file after the script runs?

feels like i have issued a directive in access.conf that disables
perl sections (or 'do "file.pl"') scripts for taking any effect.
or, there's a directive within the perl code that's missing.

help!



[ANNOUNCE] mod_perl-1.23 (fwd)

2000-04-21 Thread Ask Bjoern Hansen

-- Forwarded message --
Date: Fri, 21 Apr 2000 00:05:59 -0700 (PDT)
From: Doug MacEachern <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [ANNOUNCE] mod_perl-1.23

The URL

http://perl.apache.org/dist/mod_perl-1.23.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/DOUGM/mod_perl-1.23.tar.gz
  size: 352332 bytes
   md5: 8065af3fd29f162c3686f725b8d3ed07

Changes since 1.22:

create test files during Makefile.PL so 'make test' can be run as root

add Apache::FILENO method for 5.6.0+ tied filehandle support
thanks to Richard Titmuss for the spot

--disable-rule=EXPAT is passed to Apache's configure to avoid
XML::Parser conflicts

User/Group for 'make test' can be overridden with the environment
variables APACHE_USER/APACHE_GROUP

fix PerlSetVar inheritance bug
[Sander van Zoest <[EMAIL PROTECTED]>]

set r->notes("error-notes") to $@ if $@ after a Perl*Handlers is run
[Doug / Tom Mornini <[EMAIL PROTECTED]>]

added INSTALL.raven
[Adam Qualset <[EMAIL PROTECTED]>]

$c->remote_ip($ip) now also sets conn->remote_addr to make
IP-based access control work correctly
[Eric Cholet <[EMAIL PROTECTED]>]

Apache::URI::port wasn't setting the port correctly, thanks
to Zeqing Xia for the spot [Eric Cholet <[EMAIL PROTECTED]>]

$Apache::Registry::NameWithVirtualHost fix take 2
(move is_virtual logic from mod_perl.c to Registry.pm)
[John Hughes <[EMAIL PROTECTED]>]

added Apache::OPEN method for 5.6.0+ tied filehandle support

Apache::Table is now loaded by default (if enabled), rather than
autoloading when first needed

$r->document_root can now be modified

upgrade license to apache software license version 1.1

$r->the_request can now be modified

modules/request test fix
[Rick Myers <[EMAIL PROTECTED]>]

updated dso+aix Perl patch
[Jens-Uwe Mager <[EMAIL PROTECTED]>]

warn that dso+Perl malloc needs a Perl built with -Ubincompat5005

add Apache::BINMODE stub for 5.6.0 tied filehandle support (fixes cgi.t
#4)
[Randy Kobes <[EMAIL PROTECTED]>]

5.6.0+win32 typedef,prototype clash fixes
[Randy Kobes <[EMAIL PROTECTED]>]

add $r->server->loglevel() and relevant constants. Suggested
by Geoffrey Young [Eric Cholet <[EMAIL PROTECTED]>]

$Apache::Server::AddPerlVersion uses $^V for Perl/v5.6.0+

update mod_ssl config for 'make test'
[Stas Bekman <[EMAIL PROTECTED]>]

reset the stack pointer after calling perl_require_module() in
perl_call_handler().  this fix will most likely cure the reports of
"Can't upgrade that kind of scalar at ..."
[Ben Cottrell <[EMAIL PROTECTED]>]

workaround use of Perl api functions that are no longer public with
Perl 5.6.0 + win32, thanks to Randy Kobes for spotting

change $Apache::VERSION check to use a string instead of SvNV, which
was troublesome with Perl 5.6.0, thanks to Dave Seidel for pinpointing

Apache::src fixup to quiet warnings under Perl 5.004. Thanks to Ken
Williams for the spot. [ Ask Bjoern Hansen ]

Apache::src::apxs fixups to quiet warnings if apxs doesnt exist or
httpd is not dso enabled, thanks to Oleg Bartunov and Ville Skytt for 
spotting

fix #ifdef SGI_BOOST typo
[Ville Skytt <[EMAIL PROTECTED]>]

---

enjoy,
-Doug


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




[RFC] XML/Apache Templating with mod_perl

2000-04-21 Thread Matt Sergeant

I've just thought of a really cool idea, that would be rather easy to
implement...

First of all, when someone requests an XML document, it looks for the
 processing instruction, according to the w3c
specs. We parse the "type" attribute and get:

text/xsl
or
notxslt
or
Apache::MyPageProcessor

i.e. the full pi would be:


Then we have either a mapping table for "type" => module, or just try and
load the module specified by "type". If we find no matching module we
return DECLINED (for the Perl-XML list, this means we simply let the next
apache module in the chain handle the file). If we find a module, we call
Module->handler($r) (or Module::handler($r) depending on the prototype).

The idea is a plug-and-play XML stylesheet processing system, where you
can just drop in a new templating module and start creating XML files for
that module, without having to worry about server configuration or
changing anything (unless you need to change the type=>module mapping -
which we'd stick in the httpd.conf - so a reload is required for changes
to that).

Thoughts? Should I go ahead? (it's not much work - I've already got the
processing instruction parsing done).

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




Re: mod_perl-1.99_01-dev

2000-04-21 Thread Doug MacEachern

> One thing you failed to mention was backward compatibility - what is your
> intention with regard to that?

apache-2.0+ and Perl 5.6.0+ are required for mod_perl-2.0

if you want backward compatibility with older Apache/Perls,
just use mod_perl-1.xx, which i expect to stick around for quite a while.





Re: mod_perl-1.99_01-dev

2000-04-21 Thread Matt Sergeant

On Fri, 21 Apr 2000, Doug MacEachern wrote:

> > One thing you failed to mention was backward compatibility - what is your
> > intention with regard to that?
> 
> apache-2.0+ and Perl 5.6.0+ are required for mod_perl-2.0
> 
> if you want backward compatibility with older Apache/Perls,
> just use mod_perl-1.xx, which i expect to stick around for quite a while.

I should have been more clear!

I meant backward compatibility to the mod_perl API. Will I be able to take
a module that makes extensive use of Apache::* mod_perl core modules, and
expect it to work?

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




ANNOUNCE: Apache::Benchmark 0.1

2000-04-21 Thread Stas Bekman

Finally...

This is a first alpha release of the tool. You can download it from 
http://stason.org/works/modules/Apache-Benchmark-0.1.tar.gz .

*** What is it ***

The goals of this project:

Measuring the performance capabilities of the given server (note that it
can be any webserver, not just mod_perl enabled, but it helps :)

  a. Standard behchmarking suite. Supplied as a part of the sw. This
will allow to compare different server versions, since the data under
test (benchmark) will be identical. In addition different HW can be
benchmarked to find the best.

  b. User customized (i.e. using the real code used on production
server). User will be able to run his own code to get the real capacity
and performance figures.

The capabilities to be tested are response plus request processing times
and process sizes under different loads and server configuration.

2. Creating a framework for the automatic optimal server configuration. 
Requires production server usage patterns, using pairs of uri/query and
relative per cent of this pairs as it happens daily or during specific
hours. The more time the code will run the better tuning you will get. The
final output is a configuration parameters like MaxClients, MaxServers etc
to be pasted into production server configuration file.

The first goal is almost completed. The second is not.

*** Getting Started ***

Read the README file for further instructions. But if you want it easy and
have the standard setup where apache sits at /usr/local/apache, just
unpack and run ./bin/bench.pl . Depending on the strenth of your machine
it might take a few minutes or a few hours to complete.

At this point the documentation is scarce, but will be completed once the
design is finalized, after you try it and tell me what do you think about
it. What's good, what's bad, what and how things should be improved. 

*** What you get ***

This is the output I've got on a very strong machine (relative to mine :) 

HW: Dual PII 400Mhz 256M RAM SCSI-HD
SW: Apache 1.3.12 / mod_perl 1.22 / perl 5.005_03 / Linux (RH6.1)

Remember that the actual results are slightly better because currently
both the client and the server are running on the same machine.

### Benchmarks Report performed on Fri Apr 21 13:50:26 2000
==
Test 1 [
/tmp/bench/tests/registry_vs_handler_heavy/registry_vs_handler_heavy.
t ]
--
  SubTest  Conne- Concu-  Query AvTime Requests   Suc-
   ctions rrency Length (msec) PerSecond  cess
--
 handler_heavy   1000 10  014070.41   Pass
 handler_heavy   1000 10  014170.13   Pass
 handler_heavy   1000 20  028469.39   Pass
 handler_heavy   1000 20  028768.69   Pass
 registry_heavy  1000 20  028867.03   Pass
 registry_heavy  1000 10  014766.88   Pass
 registry_heavy  1000 20  029166.76   Pass
 registry_heavy  1000 10  014866.59   Pass
 handler_heavy100 20  024864.35   Pass
 handler_heavy100 10  015660.75   Pass
 registry_heavy   100 10  015060.02   Pass
 registry_heavy   100 20  030058.14   Pass
--
Tests descriptions:
  handler_heavy  -- Heavy Perl Handler
  registry_heavy -- Heavy Registry Script
The output sorted by rps, avtime.
--

==
Test 2 [ /tmp/bench/tests/mod_cgi_vs_mod_perl/mod_cgi_vs_mod_perl.t ]
--
  SubTestConne- Concu-  Query AvTime Requests   Suc-
 ctions rrency Length (msec) PerSecond  cess
--
 mod_perl   200  5  0 20   225.73   Pass
 mod_perl   100  5  0 24   189.39   Pass
 mod_cgi200  5  0   1365 3.65   Pass
 mod_cgi100  5  0   1394 3.52   Pass
--
Tests descriptions:
  mod_cgi  -- A script running under mod_cgi 
  mod_perl -- A script running under mod_perl 
The output sorted by rps, avtime.
--

==
Test 3 [ /tmp/bench/tests/registry_vs_handler/registry_vs_handler.t ]
--
  SubTestConne- Concu-  Query AvTime Requests   Suc-
 ctions rrency Length (msec) P

Re: DBILogger Error Status Codes

2000-04-21 Thread Randal L. Schwartz

> "John" == John Ingram <[EMAIL PROTECTED]> writes:

John> The problem is that I believe Apache is doing it's own internal request
John> for the static error page and displaying the contents of that page to
John> the user, in response to the request that they made for some other URL. 
John> For example, I issue a request for /cgi-bin/foo.pl -- which fails for
John> some reason.  When I get the Error 500 in my browser I'm seeing the URL
John> of /cgi-bin/foo.pl, but the actual message that I see, if other than the
John> Apache default, it the contents of /error/500.html... but I wasn't
John> actually redirected to the page.  This was some sort of Apache internal
John> request that it made to process the error.  Am I making any sense?

John> Anyway, the original URL that was requested is what, in my view, should
John> be logged in the table for error codes.  Has anybody dealt with this
John> problem before?  I was going to go into DBILogger and see if I can get
John> it to log whatever the original request URI was, but figured I wouldn't
John> reinvent the wheel if somebody has already done this.

Yes.  The Stonehenge::DBILog that I put into WebTechniques last month
doesn't do that, because it gets the URI not from $r->uri but from the
second word of splitting $r->the_request on whitespace.  You might
consider that change.  (I figured this out by looking at the C
code for the real log code. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: DBILogger Error Status Codes

2000-04-21 Thread Matt Sergeant

On 21 Apr 2000, (Randal L. Schwartz) wrote:

> Yes.  The Stonehenge::DBILog that I put into WebTechniques last month
[snip]

Speaking of Stonehenge::* modules - any chance you can put up a repository
of them on your web page - I just installed Stonehenge::Pictures (which is
very cool - but I'd like to extend it to automatically do the
thumbnails) and I'd be interested in seeing Stonehenge::Reload, but I
don't fancy searching the archives of this list (which you posted it to,
IIRC), and a central repository of all your mod_perl stuff would be nice.

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




Re: DBILogger Error Status Codes

2000-04-21 Thread Randal L. Schwartz

> "Matt" == Matt Sergeant <[EMAIL PROTECTED]> writes:

Matt> Speaking of Stonehenge::* modules - any chance you can put up a
Matt> repository of them on your web page - I just installed
Matt> Stonehenge::Pictures (which is very cool - but I'd like to
Matt> extend it to automatically do the thumbnails)

I thought of that during the initial development, but realized the
thumbnail directory would have to be separate from the main directory,
otherwise the timestamps would be modified and the directory needed to
be web-user writable.  Oooh wait... I'd just have it try to write in
./thumb/foo.jpg, and if it failed it'd decline entirely, so if ./thumb
was not web-writable, then Stonehenge::Pictures would decline!  oooh

  echo add thumb sub directory to Stonehenge::Pictures >>WT-ideas

Matt>  and I'd be
Matt> interested in seeing Stonehenge::Reload, but I don't fancy
Matt> searching the archives of this list (which you posted it to,
Matt> IIRC), and a central repository of all your mod_perl stuff would
Matt> be nice.

If they were documented independently of the context in which they
appeared, as in WT columns, I'd be happy to.  As is, they'd be these
wonderously marvelful snippets of undocumented, slightly opaque code
with no operating guide. :)

Perhaps at least a pointer in my online WT repository to the columns
that include mod_perl goodies?  Would that help?

I've often wanted to include a TOC beyond the simple titles, like
"these columns have mod_perl", "these columns have CGI.pm", "these
columns make HTTP requests", "these columns serve HTTP", etc.  But
alas, the tuit server keeps coming up empty at my RealWorld Service
Provider. :)

But, seeing as my stuff seems to be getting used, even in absence of
my included docs, maybe I should just get the docs done and get'em out
there.  I could even put them in the CPAN then. :)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: DBILogger Error Status Codes

2000-04-21 Thread Matt Sergeant

On 21 Apr 2000, (Randal L. Schwartz) wrote:

> Matt>  and I'd be
> Matt> interested in seeing Stonehenge::Reload, but I don't fancy
> Matt> searching the archives of this list (which you posted it to,
> Matt> IIRC), and a central repository of all your mod_perl stuff would
> Matt> be nice.
> 
> If they were documented independently of the context in which they
> appeared, as in WT columns, I'd be happy to.  As is, they'd be these
> wonderously marvelful snippets of undocumented, slightly opaque code
> with no operating guide. :)

Hey that sounds like most of the stuff on CPAN anyway .

> 
> Perhaps at least a pointer in my online WT repository to the columns
> that include mod_perl goodies?  Would that help?

It sure would... now where is Stonehenge::Reload? ;-)

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




Re: DBILogger Error Status Codes

2000-04-21 Thread Randal L. Schwartz

> "Matt" == Matt Sergeant <[EMAIL PROTECTED]> writes:

Matt> On 21 Apr 2000, (Randal L. Schwartz) wrote:
Matt> and I'd be
Matt> interested in seeing Stonehenge::Reload, but I don't fancy
Matt> searching the archives of this list (which you posted it to,
Matt> IIRC), and a central repository of all your mod_perl stuff would
Matt> be nice.
>> 
>> If they were documented independently of the context in which they
>> appeared, as in WT columns, I'd be happy to.  As is, they'd be these
>> wonderously marvelful snippets of undocumented, slightly opaque code
>> with no operating guide. :)

Matt> Hey that sounds like most of the stuff on CPAN anyway .

>> 
>> Perhaps at least a pointer in my online WT repository to the columns
>> that include mod_perl goodies?  Would that help?

Matt> It sure would... now where is Stonehenge::Reload? ;-)

Only in the archive of the list.   Hey, I could post links to the
mod_perl mailing list archive there too. :)

Just in case you missed it... (but notice, no instructions!):

package Stonehenge::Reload;

use vars qw($VERSION);
$VERSION = (qw$Revision: 1.1 $ )[-1];

use Apache::Log;

my %mtime;

sub reload_me {
  goto &reload_me if &_reload_caller; # test myself first
  goto &_reload_caller; # now test for caller
}

sub _reload_caller {
  my $file = (caller)[1];

  ## Apache->server->log->notice("$$ is testing $file with $mtime{$file}");

  return 0 if exists $mtime{$file} and $mtime{$file} == -M $file;
  ## Apache->server->log->notice("$$ is recompiling $file");
  delete @INC{grep $INC{$_} eq $file, keys %INC};
  my $old = \&{(caller(1))[3]};
  do $file;
  my $new = \&{(caller(1))[3]};
  ## Apache->server->log->notice("$$ got $old => $new for $file");
  return 0 if $old == $new; # safety
  $mtime{$file} = -M $file;
  return 1;
}

sub import {
  my $file = (caller)[1];
  ## Apache->server->log->notice("$$ is importing ",__PACKAGE__," into $file");
  $mtime{$file} = -M $file;
}

BEGIN {
  __PACKAGE__->import;  # for self reload watching
};

1;



-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Re: DBILogger Error Status Codes

2000-04-21 Thread Matt Sergeant


On 21 Apr 2000, (Randal L. Schwartz) wrote:

> Just in case you missed it... (but notice, no instructions!):
> 
> package Stonehenge::Reload;

Thanks!

When perl is your day job, instructions just get in the way (I guess you
gathered that from XML::XPath's instructions - did my email help you
figure it out - or did you drop it?)

-- 


Fastnet Software Ltd. High Performance Web Specialists
Providing mod_perl, XML, Sybase and Oracle solutions
Email for training and consultancy availability.
http://sergeant.org http://xml.sergeant.org




Re: Implementing security in CGI

2000-04-21 Thread Gunther Birznieks

At 01:44 PM 4/20/00 -0500, Matt Carothers wrote:


>On Thu, 20 Apr 2000, DeWitt Clinton wrote:
>
> > 5) The secure token is associated on the server side (preferably on
> > another tier, such as a database) with the user identification token.
> > Additionally, to support secure session timeouts, the current time
> > must be recorded.
>
>An easy way to implement timeouts is to store a timestamp and a lifetime
>in the secure token itself.  For instance, the handler I wrote for our
>web-based administration system at work concatenates the user's username,
>ip address, the current time, and a lifetime then encrypts them with
>Blowfish and sends out the ciphertext in a cookie.  Each time a user
>connects, the PerlAuthenHandler decrypts the token and verifies that
>timestamp + lifetime > current time.
>
> > Briefly, the advantage to using cookies is that:
> >
> > a) The user identification token can persist between browser sessions,
> > provided they don't explicitly log out.
>
>Another big win is that the secure token can persist across multiple
>servers.  I implemented my cookie-based PerlAuthenHandler because our
>administration system is spread out over four servers.  Using Basic
>authentication, users had to re-enter their password for each one.  With
>cookies, they can authenticate once on the main server and access the rest
>with the token.

What would prevent the token from being across multiple servers otherwise? 
The timestamp not being synchronized amongst them? It seems like that could 
be resolved within a reasonable time window to make the token appear OK? Or 
are you referring to the persistence of the session info itself?

The nice thing about your encryption is that it makes the cookie into a 
kind of pseudo client certificate -- providing information. But at the same 
time, I would be concerned that that sort of Encryption overhead (on top of 
SSL) seems like it would add load to the server.

How does it work for you in real world use? I suppose it poses an 
interesting tradeoff... with that method you don't have to maintain real 
session persistence since you have it in your decrypted data? So then you 
can avoid an extra IO going to a database or flatfile to retrieve the 
session info.

Am I getting this correct?

Later,
Gunther




Re: DBILogger Error Status Codes

2000-04-21 Thread Randal L. Schwartz

> "Matt" == Matt Sergeant <[EMAIL PROTECTED]> writes:

Matt> On 21 Apr 2000, (Randal L. Schwartz) wrote:

>> Just in case you missed it... (but notice, no instructions!):
>> 
>> package Stonehenge::Reload;

Matt> Thanks!

Matt> When perl is your day job, instructions just get in the way (I guess you
Matt> gathered that from XML::XPath's instructions - did my email help you
Matt> figure it out - or did you drop it?)

I dropped it for the "due last week" column, and the next 72 hours.
However, your message inspired me to learn more about it and your
noxslt processor, so I'll be picking that back up on my next research
cycle.

Instead, this upcoming WT column uses XML::Parser (instead of
XML::XPath) and DBD::RAM to create an in-memory SQL-queryable
representation.  The data I used was the XML list of the "Perl
Mongers" contact database.  Should be pretty fun (and already turned
in).

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



make test fails -- problem in t/conf/httpd.conf !! (newbie problem)

2000-04-21 Thread Rob Tanner

Hi,

make test fails, generating the following error:

Syntax error on line 3 of 
/workspace/rtanner/apache/mod_perl-1.22/t/conf/httpd.conf:
Invalid command '=pod', perhaps mis-spelled or defined by a module not 
included in the server configuration.

I presume that message is being generated by the Apache httpd server the 
test is trying to invoke.  When I look at the file, it is indeed a pod 
file.  When I run it through pod2text, then it complains because now it 
looks more like a help file, begiing with "NAME".  Am I missing something 
obvious or possibly have a bad copy of mod_perl?

mod_perl is v 1.22
apache is v 1.3.12
perl is v 5.6.0
OS is Caldera LINUX 2.3/kernel 2.2.10

Thanks.

-- Rob


   _ _ _ _   __ _ _ _ _
  /\_\_\_\_\/\_\ /\_\_\_\_\_\
 /\/_/_/_/_/   /\/_/ \/_/_/_/_/_/  QUIDQUID LATINE DICTUM SIT,
/\/_/__\/_/ __/\/_//\/_/  PROFUNDUM VIDITUR
   /\/_/_/_/_/ /\_\  /\/_//\/_/
  /\/_/ \/_/  /\/_/_/\/_//\/_/ (Whatever is said in Latin
  \/_/  \/_/  \/_/_/_/_/ \/_/  appears profound)

  Rob Tanner
  McMinnville, Oregon
  [EMAIL PROTECTED]



Re: mod_perl-1.99_01-dev

2000-04-21 Thread Doug MacEachern

> I should have been more clear!

nah, i realized right after i turned off my laptop, it was like 3am, i was
dum.
 
> I meant backward compatibility to the mod_perl API. Will I be able to take
> a module that makes extensive use of Apache::* mod_perl core modules, and
> expect it to work?

yes, the mod_perl Perl API will look exactly the same, with lots of new
cool stuff of course :)




Re: Memory usage on reload and graceful -- still broken?

2000-04-21 Thread Joshua Chamas

Doug MacEachern wrote:
> 
> > I have a static Solaris compilation, and have the same problems
> > where the parent seems to grow by 1M each HUP.
> 
> that's strange, do you have PerlFreshRestart On or some  sections?
> otherwise, kill -HUP with a static modperl is a noop.

You got me!  I have  sections ... but I didn't know
it was such a crime.  Pretty bizarre behavior if you ask me.

-- Joshua
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



Won't override ENV variable

2000-04-21 Thread klasker


   I'm writing a handler wherein the REMOTE_USER string needs to be changed
(after authentication) to another string so the CGI can continue on its
merry way.  In order to do this, I used $r->subprocess_env to set the
variable.  Unfortunately, this doesn't work.  Something is rewriting the
REMOTE_USER after I change it.   It looks something like this:
 
   $r->subprocess_env('REMOTE_USER', $new_login);  # CGI shows REMOTE USER
is $r->connection->user
   $r->subprocess_env('MYID', $new_login);  # creates new env. variable so
CGI shows proper string.
 
   So, I started thinking the handler was overwriting the REMOTE_USER
variable and created a new handler responsible for rewriting the environment
in the PerlFixupHandler stage.  Naturally, this didn't work either.
  
   Any ideas on how I can make REMOTE_USER take on $new_login?  Should I
un-base64 the basic authentication string and rebuild it with the new
REMOTE_USER?
   
   Kory



Re: Won't override ENV variable

2000-04-21 Thread Ask Bjoern Hansen

On Fri, 21 Apr 2000 [EMAIL PROTECTED] wrote:

$r->connection->user($new_login) is what you are looking for I believe.

REMOTE_USER is set from c->user by mod_cgi just before the cgi script is
run.


 - ask

-- 
ask bjoern hansen - 
more than 70M impressions per day, 




Re: Won't override ENV variable

2000-04-21 Thread Rodney Broom

- Original Message -
From: <[EMAIL PROTECTED]>
>
>  a handler...  REMOTE_USER needs to be changed
>  I used $r->subprocess_env
> doesn't work.

Funny, I'm just playing with something like this myself. I wrote an
authentication handler that does magic stuff with the DB and other neeto
decision making. We use cgi and mod_perl scripts, so this is what I learned:

  #-- Works for cgi
  $ENV{SOME_KEY} = $some_value
  #-- Works for mod_perl
  $r->subprocess_env(SOME_KEY => $some_value;

You can see my problem in my mail: "ENV var names rewritten to REDIRECT_*"

Rodney





Re: Memory usage on reload and graceful -- still broken?

2000-04-21 Thread Paul Lindner

On Fri, Apr 21, 2000 at 11:28:18AM -0700, Joshua Chamas wrote:
> Doug MacEachern wrote:
> > 
> > > I have a static Solaris compilation, and have the same problems
> > > where the parent seems to grow by 1M each HUP.
> > 
> > that's strange, do you have PerlFreshRestart On or some  sections?
> > otherwise, kill -HUP with a static modperl is a noop.
> 
> You got me!  I have  sections ... but I didn't know
> it was such a crime.  Pretty bizarre behavior if you ask me.

We don't have  sections and it does still occur.  I will try
with a static version and see if that fixes the problem.

-- 
Paul Lindner
[EMAIL PROTECTED]
Red Hat Inc.



ENV var names rewritten to REDIRECT_*

2000-04-21 Thread Rodney Broom

I've written a handler to do some auth work. It's implimented in a .htaccess
with PerlAuthHandler. In the package, I set a couple of ENV keys for use by
any pages/scripts in the request. Well, I have 3 different page types that
can load under this auth system, CGI, mod_perl, and an internal thing called
.wga. I have a script of each that just dumps out the ENV. Here's what
happens in the pages in responce to attempting to set ENV from the auth
handler:

#-- In auth handler
$ENV{MY_KEY} = $my_val;
#-- From .cgi page
MY_KEY = $my_val

#-- In auth handler
$r->subprocessed_env(MY_KEY => $my_val)
#-- From .mpl page
MY_KEY = $my_val

#-- In auth handler
$r->subprocessed_env(MY_KEY => $my_val)
#-- From .wga page
REDIRECT_MY_KEY = $my_val


The only difference that I can find is that .wga is also called through
another handler. Thoughts?

Rodney




Re: Won't override ENV variable

2000-04-21 Thread Vivek Khera

> "RB" == Rodney Broom <[EMAIL PROTECTED]> writes:

RB>   #-- Works for mod_perl
RB>   $r->subprocess_env(SOME_KEY => $some_value;

RB> You can see my problem in my mail: "ENV var names rewritten to REDIRECT_*"

That's expected bahavior for a sub-request; the environment from the
original request have REDIRECT_ prefix to distinguish them from the
current request.






RE: Won't override ENV variable

2000-04-21 Thread klasker



Is there any way to prevent mod_cgi from setting REMOTE_USER?

Kory

-Original Message-
From: Ask Bjoern Hansen [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 21, 2000 1:36 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: Won't override ENV variable


On Fri, 21 Apr 2000 [EMAIL PROTECTED] wrote:

$r->connection->user($new_login) is what you are looking for I believe.

REMOTE_USER is set from c->user by mod_cgi just before the cgi script is
run.


 - ask

-- 
ask bjoern hansen - 
more than 70M impressions per day, 



RE: Won't override ENV variable

2000-04-21 Thread Ask Bjoern Hansen

On Fri, 21 Apr 2000 [EMAIL PROTECTED] wrote:

> Is there any way to prevent mod_cgi from setting REMOTE_USER?

Yeah, unset connection->user, but that is probably not what you are
looking for.

Just set $r->connection->user and mod_cgi will pick up the right value
from there.


 - ask

> -Original Message-
> From: Ask Bjoern Hansen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 21, 2000 1:36 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: Won't override ENV variable
> 
> 
> On Fri, 21 Apr 2000 [EMAIL PROTECTED] wrote:
> 
> $r->connection->user($new_login) is what you are looking for I believe.
> 
> REMOTE_USER is set from c->user by mod_cgi just before the cgi script is
> run.

-- 
ask bjoern hansen - 
more than 70M impressions per day, 




RE: Won't override ENV variable

2000-04-21 Thread klasker


  This is great!  My handler now works as expected.  I have the O'Reilly
mod_perl book and it shows $c->user as a read-only function.  It doesn't
make any mention of passing a variable to it.  Thanks, Bjoern.

  Kory


-Original Message-
From: Ask Bjoern Hansen [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 21, 2000 2:10 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Won't override ENV variable


On Fri, 21 Apr 2000 [EMAIL PROTECTED] wrote:

> Is there any way to prevent mod_cgi from setting REMOTE_USER?

Yeah, unset connection->user, but that is probably not what you are
looking for.

Just set $r->connection->user and mod_cgi will pick up the right value
from there.


 - ask

> -Original Message-
> From: Ask Bjoern Hansen [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 21, 2000 1:36 PM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: Won't override ENV variable
> 
> 
> On Fri, 21 Apr 2000 [EMAIL PROTECTED] wrote:
> 
> $r->connection->user($new_login) is what you are looking for I believe.
> 
> REMOTE_USER is set from c->user by mod_cgi just before the cgi script is
> run.

-- 
ask bjoern hansen - 
more than 70M impressions per day, 



RE: Won't override ENV variable

2000-04-21 Thread Vivek Khera

> "k" == klasker  <[EMAIL PROTECTED]> writes:

k> Is there any way to prevent mod_cgi from setting REMOTE_USER?


Don't put your CGI inside password protected space.  That should do
it.  I believe this is part of the CGI and/or Basic Auth specs.



RE: Won't override ENV variable

2000-04-21 Thread Vivek Khera

> "k" == klasker  <[EMAIL PROTECTED]> writes:

k>   This is great!  My handler now works as expected.  I have the O'Reilly
k> mod_perl book and it shows $c->user as a read-only function.  It doesn't
k> make any mention of passing a variable to it.  Thanks, Bjoern.

Always check the man pages for newer functionality than might be found
in books.  Books tend to take a long time to get from idea to print,
but man pages are easier to keep current with the software.

Try this: "perldoc Apache" then look thru the methods.  It is
documented as writable in my copy.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.Khera Communications, Inc.
Internet: [EMAIL PROTECTED]   Rockville, MD   +1-301-545-6996
PGP & MIME spoken herehttp://www.kciLink.com/home/khera/



DSN/ASP problems on Appache/RH 61

2000-04-21 Thread Michael Skees

Hi Everyone,

How do you set up a system DSN (Data Source Name) on a linux box so that ASP
(active server pages) will "talk" to it?

I have followed all of the Apache::ASP instructions as closely as possible.
I can get most http pages with .asp to work, but several which involve DB
generation and manipulation I cannot get to work. I'm fairly exasperated at
this point. Please click on
http://www.web2power.com/cgi-bin/W2P_FeedBack.asp, enter some data and click
submit to see what I'm talking about.

Any help would be greatly appreciated.

Mike




RE: Won't override ENV variable

2000-04-21 Thread Doug MacEachern

On Fri, 21 Apr 2000 [EMAIL PROTECTED] wrote:

> 
>   This is great!  My handler now works as expected.  I have the O'Reilly
> mod_perl book and it shows $c->user as a read-only function.  It doesn't
> make any mention of passing a variable to it.  Thanks, Bjoern.

hmm, yes the ch9 api listing does not give an example, but in ch6 you'll
see:

$r->connection->user($ticket{'user'});




RE: Won't override ENV variable

2000-04-21 Thread Geoffrey Young


> -Original Message-
> From: Vivek Khera [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 21, 2000 3:21 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Won't override ENV variable
> 
> 
> > "k" == klasker  <[EMAIL PROTECTED]> writes:
> 
> k> Is there any way to prevent mod_cgi from setting REMOTE_USER?

I suppose it's worth mentioning that PerlSetupEnv Off will disable the
passing of %ENV and provide a performance boost if you don't need the stuff
in %ENV?

> 
> 
> Don't put your CGI inside password protected space.  That should do
> it.  I believe this is part of the CGI and/or Basic Auth specs.
> 



Re: Memory usage on reload and graceful -- still broken?

2000-04-21 Thread Doug MacEachern

> You got me!  I have  sections ... but I didn't know
> it was such a crime.  Pretty bizarre behavior if you ask me.

it's not a crime, but if you're running Perl code during restart there's a
strong chance you'll be growing the server size.  i agree 1M is bizarre
though.




Re: DSN/ASP problems on Appache/RH 61

2000-04-21 Thread Joshua Chamas

Michael Skees wrote:
> 
> Hi Everyone,
> 
> How do you set up a system DSN (Data Source Name) on a linux box so that ASP
> (active server pages) will "talk" to it?
> 
> I have followed all of the Apache::ASP instructions as closely as possible.
> I can get most http pages with .asp to work, but several which involve DB
> generation and manipulation I cannot get to work. I'm fairly exasperated at
> this point. Please click on
> http://www.web2power.com/cgi-bin/W2P_FeedBack.asp, enter some data and click
> submit to see what I'm talking about.
> 
> Any help would be greatly appreciated.
> 
> Mike

Note that Apache::ASP is perl native, and database accesss
is done through the DBI / DBD interface.  What you are using
is native MS ASP objects & VBScript.  We have only perl scripting
here :)  perldoc DBI for more info.  As long as the db is not 
MSSQL, or Access, then you will have a good chance of interfacing
with it...

Check out all the DBD drivers there are at:
  http://www.perl.com/CPAN-local/modules/by-module/DBD/

-- Joshua
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



[OT] Proxy Nice Failure

2000-04-21 Thread Joshua Chamas

Hey,

I like the mod_proxy module in reverse httpd accel mode, but 
am interested in having some nicer failure capabilities.  I have 
hacked in this kind of stuff before but was wondering if anyone 
had any official patch for this kind of stuff.  

The nicety under consideration is having the mod_proxy module do 
X retries every Y seconds instead of failing immediately.  This 
would allow a backend Apache httpd do a stop/start without any
downtime apparent to the client besides the connection breaks
from the stop.  Depending on how much preloading is done at the
parent httpd, a start could take 5-10 seconds, and during this
time it would be cool if the proxy could just queue up requests.

Anyone does this with some nice ProxyTimeout ProxyRetry config
options?  Thanks.

-- Joshua
_
Joshua Chamas   Chamas Enterprises Inc.
NodeWorks >> free web link monitoring   Huntington Beach, CA  USA 
http://www.nodeworks.com1-714-625-4051



Re: [OT] Proxy Nice Failure

2000-04-21 Thread Leslie Mikesell

According to Joshua Chamas:

> I like the mod_proxy module in reverse httpd accel mode, but 
> am interested in having some nicer failure capabilities.  I have 
> hacked in this kind of stuff before but was wondering if anyone 
> had any official patch for this kind of stuff.  
> 
> The nicety under consideration is having the mod_proxy module do 
> X retries every Y seconds instead of failing immediately.  This 
> would allow a backend Apache httpd do a stop/start without any
> downtime apparent to the client besides the connection breaks
> from the stop.  Depending on how much preloading is done at the
> parent httpd, a start could take 5-10 seconds, and during this
> time it would be cool if the proxy could just queue up requests.
> 
> Anyone does this with some nice ProxyTimeout ProxyRetry config
> options?  Thanks.

No, but I'd like to add to the wishlist that it should do
load balancing and failover across multiple backends too.
Mod_jserv appears to have a pretty good scheme of letting
you describe the balanced sets and an interface to view
and control the backend status.  The only problem is that
it is restricted to the jserv protocol for the backends.

  Les Mikesell
[EMAIL PROTECTED]



do "file" -- does NOTHING

2000-04-21 Thread w trillich

if you can find the problem, LET ME KNOW. i'm on the verge
of a breakdown.

at the end of my http.conf i've got:

PerlRequire "startup.pl"

the entire listing for startup.pl is:

package Apache::ReadConfig;

Apache->httpd_conf("Clavis");
Apache->httpd_conf("");
Apache->httpd_conf(" 1/2%3'*");
Apache->httpd_conf("isn't this wonderful?");

so i try
# apachectl configtest
[Fri Apr 21 16:19:25 2000] [error] Can't locate object method
"httpd_conf" via package "Apache" at startup.pl line 7.

Syntax error on line 280 of /etc/apache/httpd.conf:
Can't locate object method "httpd_conf" via package "Apache" at
startup.pl line 7.

i change the bottom of my http.conf to:


do "startup.pl";


and then i do

# apachectl graceful
/usr/sbin/apachectl graceful: httpd gracefully restarted

there are no complaints, no log messages, no problems reported.

the perl code runs. apache reloads its settings, as if
the perl code were empty.

the execution of the code does NOTHING; it's IGNORED completely.

anybody got any ideas?



Re: [OT] Proxy Nice Failure

2000-04-21 Thread Stas Bekman

On Fri, 21 Apr 2000, Leslie Mikesell wrote:

> According to Joshua Chamas:
> 
> > I like the mod_proxy module in reverse httpd accel mode, but 
> > am interested in having some nicer failure capabilities.  I have 
> > hacked in this kind of stuff before but was wondering if anyone 
> > had any official patch for this kind of stuff.  
> > 
> > The nicety under consideration is having the mod_proxy module do 
> > X retries every Y seconds instead of failing immediately.  This 
> > would allow a backend Apache httpd do a stop/start without any
> > downtime apparent to the client besides the connection breaks
> > from the stop.  Depending on how much preloading is done at the
> > parent httpd, a start could take 5-10 seconds, and during this
> > time it would be cool if the proxy could just queue up requests.
> > 
> > Anyone does this with some nice ProxyTimeout ProxyRetry config
> > options?  Thanks.
> 
> No, but I'd like to add to the wishlist that it should do
> load balancing and failover across multiple backends too.
> Mod_jserv appears to have a pretty good scheme of letting
> you describe the balanced sets and an interface to view
> and control the backend status.  The only problem is that
> it is restricted to the jserv protocol for the backends.

Hmm, cool ideas folks. The problem is that you probably should ask for
this at the mod_proxy list if such a beast exists. Unless the authors of
the module are lurking around mod_perl list. Correct me if I'm wrong, I
like the idea and I like it to be implemented too :)


__
Stas Bekman | JAm_pH--Just Another mod_perl Hacker
http://stason.org/  | mod_perl Guide  http://perl.apache.org/guide 
mailto:[EMAIL PROTECTED]  | http://perl.orghttp://stason.org/TULARC/
http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org
--




Deep recursion on subroutine "Apache::Constants::AUTOLOAD"

2000-04-21 Thread Martin Lichtin

Anyone understand why

perl -we 'use Apache::Constants; Apache::Constants::OK();'

causes this problem?



Re: modperl interfering with php

2000-04-21 Thread darius archer


D'oh!  ...so PerlHandler is the only hook that requires an apache SetHandler directive 
(in which case you run into the no-stacked-handlers problem), and all the others only 
need the appropriate Perl*Handler directive?

maybe I didn't RTFM as well as I thought...  thanks!

darius

On 4/20/00 at 14:26, [EMAIL PROTECTED] (Doug MacEachern) wrote:

> > ...so if I want to protect a directory with a custom Authen/Authz or
> > Access handler, php won't parse!  is this familiar territory for anyone?
> 
> just remove 'SetHandler perl-script', you don't need that to run
> Authen/Authz handlers.





Re: [OT] Proxy Nice Failure

2000-04-21 Thread Michael hall

On Sat, Apr 22, 2000 at 12:28:41AM +0300, Stas Bekman wrote:

> > > I like the mod_proxy module in reverse httpd accel mode, but 
> > > am interested in having some nicer failure capabilities.  I have 
> > > hacked in this kind of stuff before but was wondering if anyone 
> > > had any official patch for this kind of stuff.  



> Hmm, cool ideas folks. The problem is that you probably should ask for
> this at the mod_proxy list if such a beast exists. Unless the authors of
> the module are lurking around mod_perl list. Correct me if I'm wrong, I
> like the idea and I like it to be implemented too :)

I'm on the new-httpd list (as a lurker, not a developer :-). Any ideas,
patches, help porting, etc. would be more than welcome on the list.
Mod-Proxy is actually kind of in limbo, there are some in favor of
dropping it and others who want it. I guess the code is difficult and
not easy to maintain and thats why some would just as soon see it go
unless someone steps up to maintain (redesign) it. There are some
working on it and apparently it will survive in some form or another.
Now would be a perfect time for anybody to get involved in it.

--
Friends don't let friends use Windows.

Mike Hall,
Unix Admin   - Rock Island Communications   <[EMAIL PROTECTED]>
System Admin - riverside.org<[EMAIL PROTECTED]>



Re: [OT] Proxy Nice Failure

2000-04-21 Thread Jim Winstead

On Apr 21, Michael hall wrote:
> I'm on the new-httpd list (as a lurker, not a developer :-). Any ideas,
> patches, help porting, etc. would be more than welcome on the list.
> Mod-Proxy is actually kind of in limbo, there are some in favor of
> dropping it and others who want it. I guess the code is difficult and
> not easy to maintain and thats why some would just as soon see it go
> unless someone steps up to maintain (redesign) it. There are some
> working on it and apparently it will survive in some form or another.
> Now would be a perfect time for anybody to get involved in it.

mod_backhand may also be the solution people are after.

http://www.backhand.org/

(Sorry for the off-topic-ness.)

I'm also coming around to the idea that caching proxies have some
very interesting applications in a web-publishing framework outside
of caching whole pages. All sorts of areas to exploit mod_perl in
that sort of framework.

Jim



mod_perl 2.x/perl 5.6.x ?

2000-04-21 Thread Michael hall

I'm more of a perl end user and plead ignorance in actually understanding
what goes on behind the scenes. In the process of considering upgrading to
perl 5.6 and according to a recent message I see its going to be required
for mod_perl 2.x anyways so I guess its a good time to start migrating in that
direction. I was curious as to if there are requirements as to how perl
should be built for this. I scanned through the archives as I seemed to
remember some threads about this awhile ago, especially regarding threads
and multiplicity, from what I can see it looks like -DMULTIPLICITY is
going to be required ?, don't know about -DTHREADS, doesn't look like it
though. Can anybody in the know, shed some light on this, just trying to
save some work down the road as I'd like to upgrade to the perl 5.6 stuff
now and use it with my existing mod_perl (I already use the CVS version
and I know thats required for perl 5.6) but I really don't want to have
recompile perl (and modules, etc) again later if I can build it the way
it will need to be now and continue using mod_perl 1.x and then just upgrade
to mod_perl 2.x down the road.

Thanks,

--
A person is not old until regrets take the place of dreams.

Mike Hall,
Unix Admin   - Rock Island Communications   <[EMAIL PROTECTED]>
System Admin - riverside.org<[EMAIL PROTECTED]>