CGI variables question - hostname used in URL

As i mentioned in my sendmail question, i have someone that will need to run mailman to handle multiple lists in different domains. (Thanks, scott, for the pointer to sendmails ruleset 1 - i'll be able to point the system guys in the right direction.) It looks like mailman handles that just fine, *except* for one addition i had made.
The overarching listinfo and admin pages, which provide the roster of lists on the system, need to show only the (advertised) lists for that virtual system - not the ones that are effectively on a different system. My problem is that i seem to have only a server-specific mechanism for getting the hostname part of the URL by which the script was visited, and i'm wondering whether there's a more general way.
Running apache (1.2.0), i see that HTTP_HOST has the info i need, and can compare that with the list's host_name (checking whether one includes the other or vice versa), excluding those lists that do not. However, it does not look like HTTP_HOST is by any means universal.
The provisional thing i've implemented is to just ignore the list's host_name setting if no HTTP_HOST env var is found, and show all advertised lists in that case. What i'm wondering is whether there are other variable names i should check for other servers, or some more general mechanism.
(It's nice to have a bunch of knowledgeable people on the list to tap into for info, btw.)
Ken

"KM" == Ken Manheimer <klm@python.org> writes:
KM> Running apache (1.2.0), i see that HTTP_HOST has the info i
KM> need, and can compare that with the list's host_name (checking
KM> whether one includes the other or vice versa), excluding those
KM> lists that do not. However, it does not look like HTTP_HOST
KM> is by any means universal.
SERVER_NAME is the standard I think.

On Tue, 12 May 1998, Barry A. Warsaw wrote:
"KM" == Ken Manheimer <klm@python.org> writes:
KM> Running apache (1.2.0), i see that HTTP_HOST has the info i KM> need, and can compare that with the list's host_name (checking KM> whether one includes the other or vice versa), excluding those KM> lists that do not. However, it does not look like HTTP_HOST KM> is by any means universal.
SERVER_NAME is the standard I think.
That's the official name of the server - not the name by which the page was visited. Ie, on visiting http://parrot.cnri.reston.va.us/mailman/listinfo
HTTP_HOST: parrot.cnri.reston.va.us SERVER_NAME: www.python.org
I want to display the lists that belong to the effective host being visited (the virtual host?), so i need the info contained in HTTP_HOST.
ken
participants (3)
-
Barry A. Warsaw
-
Ken Manheimer
-
Ken Manheimer