Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 299676 - www-servers/apache: Allow mod_status to show HTTP Host header instead of vhost name
Summary: www-servers/apache: Allow mod_status to show HTTP Host header instead of vhos...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: High enhancement
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-04 22:27 UTC by David Abdemoulaie
Modified: 2010-01-07 07:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Abdemoulaie 2010-01-04 22:27:41 UTC
I use mod_vhost_alias to manage my vhosts. I also sometimes enable mod_status with ExtendedStatus On to monitor/track performance. However, the apache scoreboard always uses the ServerName when showing the extended information.

I've figured out that it's fairly trivial to patch servers/scoreboard.c to show the HTTP Host request header instead of the vhost if it's present:

--- server/scoreboard.c.orig	2010-01-04 14:23:33.000000000 -0800
+++ server/scoreboard.c	2010-01-04 14:25:39.000000000 -0800
@@ -462,7 +462,9 @@
             apr_cpystrn(ws->client, ap_get_remote_host(c, r->per_dir_config,
                         REMOTE_NOLOOKUP, NULL), sizeof(ws->client));
             copy_request(ws->request, sizeof(ws->request), r);
-            apr_cpystrn(ws->vhost, r->server->server_hostname,
+	    vhost = apr_table_get(r->headers_in, "Host");
+	    vhost = vhost ? vhost : r->server->server_hostname;
+            apr_cpystrn(ws->vhost, vhost,
                         sizeof(ws->vhost));
         }
     }


This is done against the 2.2.14 source.



Reproducible: Always

Steps to Reproduce:
N/A

Actual Results:  
N/A

Expected Results:  
N/A
Comment 1 Benedikt Böhm (RETIRED) gentoo-dev 2010-01-07 07:36:26 UTC
please make feature requests in the upstream bugzilla