Bug 47591

Summary: show current HTTP_HOST in mod_status scoreboard
Product: Apache httpd-2 Reporter: Brendan Beveridge <psynode>
Component: mod_statusAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: minor CC: karlbunch, takashi.asfbugzilla
Priority: P2 Keywords: PatchAvailable
Version: 2.5-HEAD   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Attachments: Patch for 2.3-HEAD
Patch for 2.2.x

Description Brendan Beveridge 2009-07-27 15:46:14 UTC
Created attachment 24044 [details]
Patch for 2.3-HEAD

In relation to bug #40003 (https://issues.apache.org/bugzilla/show_bug.cgi?id=40003)

I have added 2 patch files to this request.
First being for 2.3-HEAD
Second being for 2.2.X (tested against 2.2.11)


This patch will allow you to configure mod_status with:
ScoreBoardDisplayHostname On|Off (default Off)

This will allow you to see the current HTTP_HOST request (r->hostname) in the server-status page

This is useful if you are doing mass virtual hosting (mod_vhost) to track down specific hosts.

I've taken the one liner supplied from bug #40003 and made it configurable.
Comment 1 Brendan Beveridge 2009-07-27 15:46:49 UTC
Created attachment 24045 [details]
Patch for 2.2.x
Comment 2 Karl Bunch 2009-08-11 16:45:36 UTC
I am running a hand crafted one-liner much like #40003

It would be good to see something like this make it to release.

Since it has a config option defaulting to the old behavior it seems to me like a pretty easy addition.
Comment 3 Emmanuel Hocdet 2011-07-28 12:48:27 UTC
why not use ap_get_server_name? And this function reflect the real virtualhost configuration.

this simple patch work well for me:


--- apache2.3-trunk.orig/server/scoreboard.c	2011-07-21 11:13:55.000000000 +0000
+++ apache2.3-trunk/server/scoreboard.c	2011-07-27 10:12:13.000000000 +0000
@@ -492,7 +492,7 @@
                         REMOTE_NOLOOKUP, NULL), sizeof(ws->client));
             copy_request(ws->request, sizeof(ws->request), r);
             if (r->server) {
-            	apr_cpystrn(ws->vhost, r->server->server_hostname,
+            	apr_cpystrn(ws->vhost, ap_get_server_name(r),
                             sizeof(ws->vhost));
             }
         }