httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ask Bjoern Hansen <>
Subject vhost configuration
Date Sat, 14 Apr 2001 05:46:07 GMT

ARgh, excuse me for the low cluerate. I've spend hours without
getting anything to work now so I am asking for a little hint.

I want my Apache to find the VirtualHost based on the X-ServerName
header (sent from my proxy) instead of the Host header. Sounds
simple enough, no?

So I've configured apache like:

NameVirtualHost *

<virtualhost _default_>
    PerlSetVar site site1
    DocumentRoot /home/web/htdocs/site1/

<virtualhost _default_>
    PerlSetVar site site2
    DocumentRoot /home/web/htdocs/site2/

I have a mod_perl PostReadRequest handler that among other things does

  my $host = $r->header_in('X-ServerName');
  $r->hostname($host) if $host;

so when I do a request for it goes nicely
through the proxy and get the right X- header set to and
such, but the backend httpd (with the above configuration) doesn't
pick up the virtualhost. 

So one of two:

  The virtualhost is picked before PostReadRequest is being invoked.

  My <virtualhost ...> configuration isn't right.

The basic goal is to work around mod_proxy setting the Host header to
Host: localhost:8360. (Maybe it could be accomplished in a simpler
way :-/ ).

 - ask

ask bjoern hansen,   !try; do();

View raw message