Re: need a custom verify_resp function

2005-05-11 Thread Jacek Prucia

Hello all,
I have a change which implements a generic function comparing returned code
against specified as an attribute of the url. The diff is enclosed. Is there
a document how to check-in into the flood source tree?
Yup. It is actually for httpd-dev folks, but most rules apply anyway:
http://httpd.apache.org/dev/patches.html
Before you prepare unified diff (see document above), I'd suggest 
removing global waitfor (flood_round_robin.c). It doesn't seem to be 
used anywhere else. Also please consider using 'acceptcode' in favor of 
'waitfor'. Technically speaking, flood doesn't wait for anything. It 
just chceks return code, and moves forward. Besides that looks OK. If 
nobody has any objections, I'll commit it as soon as I get my 
development machine ready.

regards,
--
Jacek Prucia



Re: Flood?

2004-06-27 Thread Jacek Prucia

First of all: you have picked up a wrong list. Next time please post to
[EMAIL PROTECTED] (you might want to subscribe before posting as it is
moderated IIRC).

On 26 Jun 2004 11:49:14 -
"Lex Yakker" <[EMAIL PROTECTED]> wrote:

> I notice that the last release of the "flood" utility was in 2002. I had to
> make some trivial changes to get it to compile with my installation of
> apache 2.0.49 (include apr_poll.h, add an argument to the call to apr_poll).

Last release is old indeed. You might want to use CVS, as code there is a lot
better (fixes, extensions) and see if the problem persists.

> Now, it compiles but segfaults immediately, even with the example
> scripts.

Current CVS code runs fine for me. See if you can get core file, and backtrace
out of it. You can post it to [EMAIL PROTECTED], which could help us track the
problem.

> Is someone still maintaining this utility?

Well... Everybody (including me) seem to be swamped with other activities.
However, If you find a problem, then please post details (backtraces, patches)
to [EMAIL PROTECTED] Hopefully, somebody will have enough time to help you out.

[...]
> I'd be happy to audit the code, if necessary.

Yeah, that would be great. Please feel free to post patches to [EMAIL PROTECTED]
You might want to take look at http://httpd.apache.org/dev/patches.html. It is
for httpd project, but most issues apply anyway.

regards,
--
Jacek Prucia



ALv2 boilerplate notice typo (was: Re: cvs commit: httpd-test/flood *.c)

2004-02-09 Thread Jacek Prucia
On Sun, 8 Feb 2004 23:05:01 -0800
"Roy T. Fielding" <[EMAIL PROTECTED]> wrote:

> >   +/* Copyright 2001-2004 Apache Software Foundation
> 
> The name of the corporation is "The Apache Software Foundation".
> It needs to be written with the "The".

Doh! I just did quick copy'n'paste from one of httpd-2.0 files (changing
only copyright dates to match flood development). It is already fixed in
httpd-test/flood repo. CCying [EMAIL PROTECTED] to make Andre Malo aware of the
problem. Thanks for catching out this one.

regards,
Jacek Prucia





Re: Port 80 vs 8080 when not SU.

2002-07-10 Thread Jacek Prucia

On Wed, 10 Jul 2002 08:29:06 -0700 (PDT)
Joshua Slive <[EMAIL PROTECTED]> wrote:

> On Wed, 10 Jul 2002, Lars Eilebrecht wrote:
> 
> > According to Ravindra Jaju:
> >
> > > How about an extra echo:
> > >
> > > if [ "x`$aux/getuid.sh`" != "x0" -a "x$port" = "x" ]; then
> > >   conf_port="8080"
> > >   echo "Non-root process. Server will run on port $conf_port"
> > > fi
> >
> > +1
> >
> 
> I don't see how that helps.

As Dirk pointed out, that trick was *default* with Apache 1.3.x. I
personally (and I bet a lot of people out there) simply got used to this
behaviour, and it's a little bit confusing, that new build system acts
differently. That "newbie vs. guru" problem IMO schould not be
considered a valid reason to review this change. I'm with Dirk here
(that is: his oryginal patch, without that echo above).

Since we are talking about build system, let me bring something else up.
Old APACI configure at the end of 'make install' was echoing an ASCII
table with some information (install ok, conf file here, apachectl
there, etc.). This also vanished from 2.0.x build system, but remains in
binary releases. Even if I don't need that personally -- this is another
thing that it is a little bit confusing. After all, adding a no-deps
target that echoes some ASCII stuff can't be thaht hard with
autoconf/automake?

my $cents = 2;

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



Re: slow apache 2.0

2002-04-10 Thread Jacek Prucia

On Tue, 09 Apr 2002 18:43:26 -0700
Brian Pane <[EMAIL PROTECTED]> wrote:

[...]
> >read(10, "GET /test.txt HTTP/1.0\r\nUser-Age"..., 8000) = 92
> >gettimeofday({1018386426, 197988}, NULL) = 0
> >gettimeofday({1018386426, 198146}, NULL) = 0
> >stat("/iVision/users/i-vision/main/htdocs/test.txt", {st_mode=S_IFREG|0644,
> >st_size=13924, ...}) = 0
> >open("/iVision/users/i-vision/main/htdocs/test.txt", O_RDONLY) = 11
> >open("/etc/localtime", O_RDONLY)= 12
> >read(12, "TZif\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\n\0\0\0\n\0"..., 44) =
> >44
> >read(12, "\230DI\200\233\f%p\233\325\332\360\234\331\256\220\235"..., 925) =
> >925
> >fstat(12, {st_mode=S_IFREG|0644, st_size=1067, ...}) = 0
> >old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
> >= 0x40043000
> >read(12, "\0\0\0\0\0\0\0\0\16\20\0\4\0\0\34 \1\10\0\0\16\20\0\4\0"..., 4096)
> >= 98
> >close(12)   = 0
> >munmap(0x40043000, 4096)= 0
> >brk(0x81b7000)  = 0x81b700
> >
> 
> What's it doing opening /etc/localtime?  Especially in
> between reading the request and sending the response?
> Can anyone tell what module this is from?

AFAIK /etc/localtime points to glibc timezone file ($TZ). When clock is set to GMT, 
but system (through localtime()) needs to know exact local time -- glibc library opens 
that file to get the idea what offset needs to be applied to GMT time to have exact 
local time as a result. This happens with every software on such configured system (i 
just tried strace with /bin/date and /usr/bin/cal just to be sure) -- IMHO nothing to 
worry about in terms of performance.

--
regards,
Jacek Prucia




Re: module init called twice in 1.3

2002-02-13 Thread Jacek Prucia

On Wed, 13 Feb 2002 09:47:35 -0500
Rodent of Unusual Size <[EMAIL PROTECTED]> wrote:

> Brian Akins wrote:
> > 
> > I've noticed that the module init sometimes gets called twice.  Is this
> > something I'm doing wrong or is this "normal"?
> 
> This is normal (at least for Apache 1.3).  It gets called
> once during config parsing, and again after daemonising
> and right before children start getting forked.  The first
> pass is a sort of 'test run'.
> 
> This would probably be better on the module-writers list,
> [EMAIL PROTECTED]

Yep, but this question is asked there quite often... I think Ken post: 
'[apache-modules] First or second pass through init' (which covers this subject in 
detail) schould be added to 'Apache API notes' or at least FAQ.

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





Re: mod_negotiation/dir subrequest problem [was: Tagging .31 soon]

2002-01-31 Thread Jacek Prucia

On Thu, 31 Jan 2002 12:42:56 -0500
"Joshua Slive" <[EMAIL PROTECTED]> wrote:

[...]
> In fact, this configuration looks terribly invalid.  It should be
> RedirectMatch /build/tomcat/(.*)
> http://jakarta.apache.org/build.jakarta-tomcat/$1
> Or even better
> Redirect /build/tomcat/ http://jakarta.apache.org/build.jakarta-tomcat/
> 
> We should be returning an error if the target argument to
> Redirect/RedirectMatch isn't an absolute URL.

That's the case with 1.3 and (after a quick check) also with 2.0. Inside 
add_redirect_internal() there's a check on second argument with ap_is_url() and if 
that test fails, server bails out with: Redirect to non-URL

However I think that sometimes it might make sense to have target an absolute URI, but 
that would trigger so called self-referenced redirect. Something that mod_dir already 
does. I know that behaviour of such redirect would depend on value of UseCanonicalName 
directive. On the other hand if that directive has bogus value, then mod_dir will not 
work anyway. Assuming people are setting ServerName and UseCanonicalName correctly, 
they can use something like:

Redirect /foo /path/to/bar

...to mean something like: redirect /foo to this_server/path/to/bar which might be 
usefull in some scenarios.

I've already prepared a patch for mod_alias to meet my own needs. It makes mod_alias 
accept absolute path as second argument to redirect and then at filename translation 
phase it just builds valid URL with ap_construct_url (the same thing mod_dir already 
does). If people are interested I can clean it up and send to list.

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





Re: Parent death should force children suttee

2002-01-30 Thread Jacek Prucia

On Wed, 30 Jan 2002 14:13:52 -0500
Rodent of Unusual Size <[EMAIL PROTECTED]> wrote:

[...]
> I think I disagree; what you're describing is, essentially,
> relying on good luck, hoping for the best, and ignoring the
> problem and hoping it will go away.  IIRC, what Greg
> observed was the children getting hung at some time t after
> the parent died.  (Maybe when they tried to expire gracefully?)
> IMHO, if the parent process dies, something is seriously wrong,
> the server condition is indeterminate, and we need to re-base
> and restart.

I'm with Ken here. Children depend on parent to do the job control. Child sends 
SIGCHLD to parent and can only exit if parent picks that signal up (waitpid() or so). 
If that can't be done (for a number of reasons) -- child is said to be zombie. 
However, parent beeing dead isn't causing it's children to go zombie, as os can detect 
that (SIGCHLD to non-existing process) and cleanup correctly. Anyway this doesn't seem 
like normal situation and might cause a lot of trouble later on...

On the other hand Bill Stoddard is also right. If nothing bad happens, child can go on 
servicing requests, because it dies only when parent tell it to do so (or when SEGV 
happens, but that's other story). However under heavy load you'll have a dead server 
anyway (at least with prefork MPM), because you will not have new children respawning 
to meet the load. And if somehow children start to die for some wonky reason, that 
little group will shrink very fast, which gives us only a bit delayed agony.

So IMHO the best solution is to have some way in which children can check if parent is 
ok. Maybe another field (frequently filled up by daddy) in scoreboard?  Anyway when 
child is sure to be orphaned, it can yeld about that in error_log. If such a message 
will be written with every request -- it will probably get noticed fast. The rest is 
up to admin: either he/she decides to fix up things or go on with that strange 
situation until people stop shopping :))

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





Re: apidoc/ -> API-dict.html (apache-devsite) (fwd)

2002-01-29 Thread Jacek Prucia


> Subject: apidoc/ -> API-dict.html (apache-devsite)

Since Brian forwarded my question to dev@httpd list on which I'm lurking, let me 
resolve my own question:

> Do you have any idea where the contents of directory /apidoc/ (apache-devsite) are?

They are in httpd-docs-1.3/apidoc/. So looks like apache-devsite needs a trival link 
fix and maybe information about stuff in httpd-docs-1.3/apidoc/.

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




Re: StartServers > MaxSpareServers (or MaxSpareThreads)

2001-12-19 Thread Jacek Prucia

Aaron Bannert <[EMAIL PROTECTED]> wrote:

here's another one: MaxSpareServers < MinSpareServers (Apache 1.3.22, no warning)

> Should we issue a warning if this happens and push StartServers back
> down to the MaxSpareServers (or a function of MaxSpareThreads) limit?

At least warning. I was thinking about even refusing to start, but that is a little 
too drastic for such little thing.

> Would an admin ever really want to do that?

Not every admin on this planet knows what he is doing. It would be nice to have Apache 
wuss about anything ugly in config file.

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





Re: mod_proxy logs

2001-11-15 Thread Jacek Prucia

Graham Leggett <[EMAIL PROTECTED]> wrote:

> Jacek Prucia wrote:
> >  I've recently bumped into some wacky kind of problem with Apache
> > 1.3.x that might require writting a patch. If I have mod_proxy
> > enabled then all requests (proxy & non proxy) are logged to
> > coresponding CustomLog/TransferLog file (with selected format). On
> > a busy server this can make access logs consume quite a lot of disk
> > space. Looks like there's no way to split proxy logs from access
> > logs or even discard them at all. This could be solved by doing either:
> 
> Are you trying to run a forward proxy and a webserver at the same time?

Yes.

> If so, why not use different customlogs within virtual hosts to split
> out the webserver logs from the proxy logs? (instead of trying to split
> the proxy logs from the webserver logs).

In other words: the solution is to split servers, not logs.

> The proxy logs just go in the default logfile, while the webserver logs
> can go into separate logfiles

I did a little test the other way: default log file gets webserver requests and proxy 
has dedicated VirtualHost with separate log file. It works as expected.

> no patching required.

Yes, but even when your explanation seems logical (separating servers doing different 
things) and creating name-based Virtual Host is quick'n'easy -- this still doesn't fit 
very well my situation (there's a lot of explanation why and I feel that it is really 
unnecesary to clutter this list with my problems). I'll probably go ahead and make 
this patch, but since it only fits my particular needs, it looks like there's no need 
to import it into main trunk.

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





mod_proxy logs

2001-11-14 Thread Jacek Prucia


Hi all,

 I've recently bumped into some wacky kind of problem with Apache 1.3.x that might 
require writting a patch. If I have mod_proxy enabled then all requests (proxy & non 
proxy) are logged to coresponding CustomLog/TransferLog file (with selected format). 
On a busy server this can make access logs consume quite a lot of disk space. Looks 
like there's no way to split proxy logs from access logs or even discard them at all. 
This could be solved by doing either:

1. Adding Request_URL attribute to mod_setenvif.c like this:

SetEnvIf Request_URL "^http\:\/\/" proxy_request
CustomLog "/path/to/access.log" common env=!proxy_request
CustomLog "/path/to/proxy.log" common env=proxy_request

2. Adding ProxyLog directive to mod_log_config.c like this:

ProxyLog file|pipe format-srting|format-name [env stuff]

...then log to that file if r->proxyreq is true.

3. This is documented somewhere else and I'm just wasting developer time instead of 
just RTFM (hopefully not)

This problems bugs me directly, so I'm willing to write patch. However since I came up 
with a number of ways to solve that problem I would like to see developer 
approval/vetos before I try to shoot myself in the foot for free ;))

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




Re: [PATCH] Remove mod_dir showstopper

2001-11-13 Thread Jacek Prucia

Justin Erenkrantz <[EMAIL PROTECTED]> wrote:

> Anyone know the User-Agent field that this broken MS implementation 
> sends (or is the UA listed in the patch correct)?  -- justin

UA field listed in patch seems to be correct. I'm playing around with Apache/mod_dav 
and Windows 2000 server as DAV client software. Apache combined access logs are 
cluttered with such bigass UA field:

"Microsoft Data Access Internet Publishing Provider DAV 1.1"

Since DAV protocol is integral system component (at least in Windows 2000 server) -- 
there's a fat chance that every Microsoft software (relaying on underlying system 
component) will be sending this UA field.

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