Bug 47591 - show current HTTP_HOST in mod_status scoreboard
Summary: show current HTTP_HOST in mod_status scoreboard
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_status (show other bugs)
Version: 2.5-HEAD
Hardware: All Linux
: P2 minor with 11 votes (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
Keywords: PatchAvailable
Depends on:
Reported: 2009-07-27 15:46 UTC by Brendan Beveridge
Modified: 2012-12-14 21:19 UTC (History)
2 users (show)

Patch for 2.3-HEAD (2.94 KB, patch)
2009-07-27 15:46 UTC, Brendan Beveridge
Details | Diff
Patch for 2.2.x (3.00 KB, patch)
2009-07-27 15:46 UTC, Brendan Beveridge
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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),