Re: [PATCH] flood: install target

2002-09-11 Thread Jacek Prucia
wiadomosc od Aaron Bannert, z dnia Wed, Sep 11, 2002 at 01:08:42PM -0700
> On Wed, Sep 11, 2002 at 12:29:56PM -0700, Justin Erenkrantz wrote:
> > httpd and APR both do not have their default prefix set to
> > /usr/local, but rather /usr/local/{apache2,apr}.  I think it's
> > better to follow that strategy than /usr/local for the clueless
> > newbie who doesn't use --prefix.  -- justin
> 
> I think that's because there is a very high chance that both httpd
> and APR may have multiple installed versions in parallel.

Here's a snippet from 1.3 INSTALL file:

 Note: To reduce the pollution of shared installation locations
   (like /usr/local/ or /etc) with Apache files to a minimum the
   string ``/apache'' is automatically appended to 'libexecdir',
   'sysconfdir', 'datadir', 'localstatedir' and 'includedir' if
   (and only if) the following points apply for each path
   individually:

   1. the path doesn't already contain the word ``apache''
   2. the path was not directly customized by the user

...so it looks like it was intended to have all files under separate directory.

> I doubt
> that flood will be used in the same conditions, and if it is they
> should use the same thing everyone else uses to install in a new
> location: --prefix.

Correct, but right now flood install means also APR/APR-util install. That way 
you just have all-purpose library installed system wide. What if that 
overwrites another set of APR/APR-util libs from other httpd-2.0/subversion 
instalation? Big suckage.

> It really is a pain for users when autoconf-based
> projects go and try to do their own thing.

I think flood needs a nice and descriptive build doc (current doc is nice, but 
not descriptive :)). We could write why default PREFIX is separate directory, 
and how to link flood dynamically against external APR/APR-util and have only 
file for instalation (which fits /usr/local location quite nicely). I'm still 
playing with httpd-docs xml/xsl files, but looks like I'll have a flood-docs 
skeleton ready soon.

regards,
-- 
Jacek Prucia
7bulls.com S.A.



Re: [PATCH] flood: install target

2002-09-11 Thread Aaron Bannert
On Wed, Sep 11, 2002 at 12:29:56PM -0700, Justin Erenkrantz wrote:
> httpd and APR both do not have their default prefix set to
> /usr/local, but rather /usr/local/{apache2,apr}.  I think it's
> better to follow that strategy than /usr/local for the clueless
> newbie who doesn't use --prefix.  -- justin

I think that's because there is a very high chance that both httpd
and APR may have multiple installed versions in parallel. I doubt
that flood will be used in the same conditions, and if it is they
should use the same thing everyone else uses to install in a new
location: --prefix. It really is a pain for users when autoconf-based
projects go and try to do their own thing.

-aaron


Re: [PATCH] flood: install target

2002-09-11 Thread Thom May
* Justin Erenkrantz ([EMAIL PROTECTED]) wrote :
> On Wed, Sep 11, 2002 at 10:24:45AM -0700, Aaron Bannert wrote:
> > I don't understand why this is an issue. I use --prefix to define where
> > things should be installed. Typically that defaults to /usr/local.
> > Any reason we shouldn't do the same? (I'm ok with our directory
> > being called flood or flood-1)
> 
> httpd and APR both do not have their default prefix set to
> /usr/local, but rather /usr/local/{apache2,apr}.  I think it's
> better to follow that strategy than /usr/local for the clueless
> newbie who doesn't use --prefix.  -- justin

Agreed. but with some autoconf magic you could default to
/usr/local/flood/$ver/; which would be kinda cool, but hard on the PATH.
-Thom

-- 
Thom May -> [EMAIL PROTECTED]

"I do fireworks... It's the joy of building a system with your own hands over
days or weeks, and then watching it explode in a beautiful fireball in a 
matter of seconds... But I suppose you couldn't relate"
"Actually I can. I'm a computer programmer"


Re: [PATCH] flood: install target

2002-09-11 Thread Justin Erenkrantz
On Wed, Sep 11, 2002 at 10:24:45AM -0700, Aaron Bannert wrote:
> I don't understand why this is an issue. I use --prefix to define where
> things should be installed. Typically that defaults to /usr/local.
> Any reason we shouldn't do the same? (I'm ok with our directory
> being called flood or flood-1)

httpd and APR both do not have their default prefix set to
/usr/local, but rather /usr/local/{apache2,apr}.  I think it's
better to follow that strategy than /usr/local for the clueless
newbie who doesn't use --prefix.  -- justin


Re: [PATCH] flood: install target

2002-09-11 Thread Aaron Bannert
On Wed, Sep 11, 2002 at 04:22:36AM -0700, Justin Erenkrantz wrote:
> > if you really don't like /usr/local (why? :), then we could use
...
> > /usr/local/flood  +1
> 
> /usr/local/flood is fine with me.  It fits with how httpd and APR
> are setup by default.  -- justin


I don't understand why this is an issue. I use --prefix to define where
things should be installed. Typically that defaults to /usr/local.
Any reason we shouldn't do the same? (I'm ok with our directory
being called flood or flood-1)

-aaron


Re: [PATCH] flood: install target

2002-09-11 Thread Justin Erenkrantz
On Wed, Sep 11, 2002 at 02:01:24PM +0200, Jacek Prucia wrote:
> Uhmm. And since I saw few +1's for splitting APR/APR-util and httpd
> releases, maybe we schould also get rid of those intree libs? I'll try
> to play around with external APR/APR-util and see if flood builds clean
> that way.

It should work just fine, if not, something broke.  =)

For releases, we want to include those day's snapshots of
APR/APR-util so that a person who downloads flood has everything
they need to build it - regardless if APR or APR-util change later
on in a way that breaks that release of flood.

As APR and APR-util have their own releases, the problem gets
slightly easier, but it's not a big deal as we should support both
methods.

> if you really don't like /usr/local (why? :), then we could use

/usr/local doesn't allow versioning of the install binaries.
Therefore, admins have to go to extreme lengths to support
parallel installs (as do developers to get their setups to
support parallel installs!).

To me, a better approach is to explicitly version the directories
and leave them there permanently, so that, flood 1.0 would be in
/pkg/flood-1.0, flood 1.1 in /pkg/flood-1.1, and flood 2.0 would be
in /pkg/flood-2.0.  This allows easy movement back and forth between
versions that isn't allowed in the /usr/local strategy.

(Realize that /pkg can be anything you like it to be.  Some places
use /opt or whatever.  I use /pkg for much the same reason fink uses
/sw - no one else uses that directory name.)

I've heard some people use symlink farms from explicitly versioned
directories into /usr/local to help with path issues, but I use a
tool called 'module' (tcl-based) to manage my path.

I've administered enough multi-user, multi-platform, multi-site
systems to learn that /usr/local is pure evil.

> /usr/local/flood  +1

/usr/local/flood is fine with me.  It fits with how httpd and APR
are setup by default.  -- justin


Re: [PATCH] flood: install target

2002-09-11 Thread Jacek Prucia
On Tue, 10 Sep 2002 09:39:58 -0700
Justin Erenkrantz <[EMAIL PROTECTED]> wrote:

[...]
> > This patch has one problem. Install dir is cluttered with lotsa
> > apr/apu stuff (*-config scripts, includes, libraries) -- even when
> > flood is built with --disable-shared. I've had enough of autoconf
> > magic for today, so I'll tackle this tommorow (unless somebody else
> > beats me first).
> 
> That's to be expected.
> 
> The only caveat is to build flood statically - rather than
> dynamically (not sure if you can do that).

Yep. With --enable-shared and --disable-shared you can build flood the
way you want it. Just tried both switches minute ago. Works like a
charm.

> Yet, even if that
> happens, you still need to let APR and APR-util install - and they
> will install all of the ap{ru}-config files.
>
> The proper way to get around that is to install APR and APR-util
> on their own and pass --with-apr and --with-apr-util to configure.
> If they use an intree APR/APR-util, this cruft is what they get.

Uhmm. And since I saw few +1's for splitting APR/APR-util and httpd
releases, maybe we schould also get rid of those intree libs? I'll try
to play around with external APR/APR-util and see if flood builds clean
that way.

[...]
> > diff -urN flood.orig/configure.in flood/configure.in
> > --- flood.orig/configure.in 2002-07-22 07:48:02.0 +0200
> > +++ flood/configure.in  2002-09-10 18:35:18.0 +0200
> > @@ -5,7 +5,7 @@
> >  AC_CONFIG_AUX_DIR(build)
> >  
> >  dnl Override the default prefix with /pkg/flood-0.1
> > -AC_PREFIX_DEFAULT(/pkg/flood-0.1)
> > +AC_PREFIX_DEFAULT(/usr/local)
> 
> To be precise, I think we could change it to /usr/local/flood.  But,
> we shouldn't install things to /usr/local by default.  As you can
> tell, I refuse to use /usr/local or encourage its use in others.  =)

Well... I just though, that since we have to install just one file -- we
don't have to worry about 'file system pollution'. Given that we can't
get rid of that APR/APR-util cruft -- /usr/local/flood seems fine. But,
if you really don't like /usr/local (why? :), then we could use
/pkg/flood. I'm just against having flood version number in directory
name. As soon as we settle up with directory name, I'll commit this
patch. To be exact, here are my prefferences:

/usr/local/flood  +1
/pkg/flood+0
/pkg/flood-1.0-1

regards,
-- 
Jacek Prucia
7bulls.com S.A.
http://www.7bulls.com/




Re: POST with no data

2002-09-11 Thread Gary Benson
On Tue, Sep 10, 2002 at 05:55:27PM +0100, Gary Benson wrote:

> I've been trying to write some tests and have been trying to send POST
> requests with no body.  It seems that Apache::TestRequest::POST only
> adds a Content-Length when the length of the content is nonzero, so
> attempts to 'POST "/foo/bar", ""' result in a 411 Length Required from
> httpd.
> 
> I'm not nearly good enough with Perl to work out where POST is defined;
> can anyone point me in the direction of what I need to change to cause a
> content-length to be added to all POST requests?

So I eventually managed to make a workaround for this (attached).  I'm
still not sure if httpd-test is the correct place for the fix or whether
I should be fixing LWP so I won't commit it.

Cheers,
Gary

[ [EMAIL PROTECTED] ][ GnuPG 85A8F78B ][ http://inauspicious.org/ ]
Content-length headers don't seem to get added to POST requests with
empty bodies, causing httpd to return a 411 Length Required.

Index: perl-framework/Apache-Test/lib/Apache/TestRequest.pm
===
RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm,v
retrieving revision 1.71
diff -u -r1.71 TestRequest.pm
--- perl-framework/Apache-Test/lib/Apache/TestRequest.pm4 Apr 2002 
00:54:26 -   1.71
+++ perl-framework/Apache-Test/lib/Apache/TestRequest.pm11 Sep 2002 
09:47:55 -
@@ -386,6 +386,9 @@
 
 unless ($shortcut) {
 #GET, HEAD, POST
+if ($r->method eq "POST" && !defined($r->header("Content-Length"))) {
+$r->header('Content-Length' => length($r->content));
+}
 $r = $UA ? $UA->request($r) : $r;
 my $proto = $r->protocol;
 if (defined($proto)) {