You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "William A. Rowe Jr." <wr...@apache.org> on 2011/01/10 05:05:25 UTC

Fwd: svn commit: r1057050 - /httpd/httpd/trunk/modules/generators/mod_status.c

Author: sf
Date: Sun Jan  9 23:07:52 2011
New Revision: 1057050

URL: http://svn.apache.org/viewvc?rev=1057050&view=rev
Log:
Display the local IP address in server-status. This can be useful for HTTPDs
behind load balancers.

Modified:
    httpd/httpd/trunk/modules/generators/mod_status.c

Modified: httpd/httpd/trunk/modules/generators/mod_status.c
URL:
http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_status.c?rev=1057050&r1=1057049&r2=1057050&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_status.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_status.c Sun Jan  9 23:07:52 2011
@@ -376,7 +376,8 @@ static int status_handler(request_rec *r
                  "<html><head>\n<title>Apache Status</title>\n</head><body>\n",
                  r);
         ap_rputs("<h1>Apache Server Status for ", r);
-        ap_rvputs(r, ap_get_server_name(r), "</h1>\n\n", NULL);
+        ap_rvputs(r, ap_get_server_name(r), " (", r->connection->local_ip,
+                  ")</h1>\n\n", NULL);

As it can be multi-homed, what about spelling out " (via n.n.n.n)" with the
explicit hint that this isn't the exclusive address of the server?  In fact
this request is routed to different listeners, so "big.site.com (127.0.0.1)"
wouldn't make any sense, but "big.site.com (via 127.0.0.1)" offers the fairly
simple explanation that they connected via loopback.