You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by te...@telenor.com on 2002/10/28 17:06:21 UTC

[PATCH] mod_status.c in httpd-2.0.43 (fwd)

If it may bee of any interest...?

I have applied the following small change to mod_status.c in my copy of the
httpd-2.0.43.
The reason for this, is when setting up a lagrer hosting platform using
mod_vhost_alias I came across that mod_status does not print out the serving
"virtual host" ServerName under VHOST in  the status page.
which technically ofcourse is correct, since there is no Virtualhost.
But, when  there are several sites served
with mod_vhost_alias, it is interesting to be able to se which hosted site is
responsible for the traffic - on the fly.


Hence this small change:


tmp 717# diff -u httpd-2.0.43/modules/generators/mod_status.c ./mod_status.c
--- httpd-2.0.43/modules/generators/mod_status.c        Sun Jun 30 20:20:13 2002
+++ ./mod_status.c      Mon Oct 28 16:44:31 2002
@@ -749,7 +749,7 @@
                                    ap_escape_html(r->pool,
                                                   ws_record->client),
                                    ap_escape_html(r->pool,
-                                                  ws_record->vhost),
+                                                  ap_get_server_name(r)),
                                    ap_escape_html(r->pool,
                                                   ws_record->request));
                 } /* no_table_report */

If it's not apropriate, well then just disregard it.
And if it is, well someone may review it and apply it for the next release?


Kind regards,
Terje Molle
Senior Unix systemarkitekt
Telenor Business Solutions,
/Driftstjenester/Operations/Plattform/IPS



Re: [PATCH] mod_status.c in httpd-2.0.43 (fwd)

Posted by Jeff Trawick <tr...@attglobal.net>.
<te...@telenor.com> writes:

> tmp 717# diff -u httpd-2.0.43/modules/generators/mod_status.c ./mod_status.c
> --- httpd-2.0.43/modules/generators/mod_status.c        Sun Jun 30 20:20:13 2002
> +++ ./mod_status.c      Mon Oct 28 16:44:31 2002
> @@ -749,7 +749,7 @@
>                                     ap_escape_html(r->pool,
>                                                    ws_record->client),
>                                     ap_escape_html(r->pool,
> -                                                  ws_record->vhost),
> +                                                  ap_get_server_name(r)),

I don't think that this will work in general.  r in this case, as
passed to ap_get_server_name() is the request for the server status
page being generated by this code.  It is almost always unrelated to
this scoreboard entry, so looking up the server name for this request
is not the way to get the proper server name for the scoreboard entry
being formatted.

If ws_record->vhost isn't set appropriately for mass vhosting, then
something needs to be fixed on the path for the request.  That isn't
anything that can be done in mod_status because it doesn't have access
to the request_rec associated with this scoreboard entry.

[whew... you almost had me there for a minute...  I got tangled up in
the cost of the ap_get_server_name() (expensive for "UseCanonicalName
DNS" which is probably turned on for mass vhosting) and other such
details and almost missed the forest :)]

-- 
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...