Re: is postreadrequest too late to determine name vhost?
TE == Thomas Eibner [EMAIL PROTECTED] writes: TE It seems that everything concerning vhosts is set up in http_protocal.c TE and that the vhost is set right after Apache has read the request from TE the client and then calling ap_update_vhost_from_headers to actually TE determine the vhost. All this happens before your module gets to run. Thanks for the info. I realized just now (about a minute ago) that localhost.mailermailer.com and localhost.m1e.net are different names that point to 127.0.0.1, so the proxy front-end can do it using the domain names, and the back-end can distinguish the names just fine. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
Re: is postreadrequest too late to determine name vhost?
On Wed, Aug 29, 2001 at 02:44:48PM -0400, Vivek Khera wrote: TE == Thomas Eibner [EMAIL PROTECTED] writes: TE It seems that everything concerning vhosts is set up in http_protocal.c TE and that the vhost is set right after Apache has read the request from TE the client and then calling ap_update_vhost_from_headers to actually TE determine the vhost. All this happens before your module gets to run. Thanks for the info. I realized just now (about a minute ago) that localhost.mailermailer.com and localhost.m1e.net are different names that point to 127.0.0.1, so the proxy front-end can do it using the domain names, and the back-end can distinguish the names just fine. I have a reverse-mpaf almost working with this now, so that it works without using the localhost.hostname.com.. -- Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/ mod_pointer http://stderr.net/mod_pointer
is postreadrequest too late to determine name vhost?
I've got the classic lightweight front end proxying to the mod_perl heavyweight backend. I use proxy_add_forward on the front end and the PerlPostReadRequest handler to set $r-hostname and $r-remote_ip. This all works excellently. My question, however, is this too late for the name-based virtual hosts to trigger? In my mod_perl app, I need to trigger different things based on the virtual site. What I want to do is this: VirtualHost localhost ServerName www.mailermailer.com PerlSetVar SiteID 7 PerlSetVar SiteName www.mailermailer.com /VirtualHost VirtualHost localhost ServerName m1e.net PerlSetVar SiteID 1 PerlSetVar SiteName m1e.net /VirtualHost in the backend. However, it seems that it always picks up the first virtual host defined this way, regardless of what the post read request handler sets $r-hostname to. Is there some other trick I should try? I'm working from home today and don't have my Eagle book handy... If I can't get it to work with name virtual hosts, I'll have to go to port-based virtual hosts, which I'd prefer to avoid since I expect to have several hundred of these eventually. Thanks. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-240-453-8497 AIM: vivekkhera Y!: vivek_khera http://www.khera.org/~vivek/
Re: is postreadrequest too late to determine name vhost?
On Wed, Aug 29, 2001 at 01:31:54PM -0400, Vivek Khera wrote: I've got the classic lightweight front end proxying to the mod_perl heavyweight backend. I use proxy_add_forward on the front end and the PerlPostReadRequest handler to set $r-hostname and $r-remote_ip. This all works excellently. My question, however, is this too late for the name-based virtual hosts to trigger? In my mod_perl app, I need to trigger different things based on the virtual site. What I want to do is this: VirtualHost localhost ServerName www.mailermailer.com PerlSetVar SiteID 7 PerlSetVar SiteName www.mailermailer.com /VirtualHost VirtualHost localhost ServerName m1e.net PerlSetVar SiteID 1 PerlSetVar SiteName m1e.net /VirtualHost in the backend. However, it seems that it always picks up the first virtual host defined this way, regardless of what the post read request handler sets $r-hostname to. Is there some other trick I should try? I'm working from home today and don't have my Eagle book handy... If I can't get it to work with name virtual hosts, I'll have to go to port-based virtual hosts, which I'd prefer to avoid since I expect to have several hundred of these eventually. It seems that everything concerning vhosts is set up in http_protocal.c and that the vhost is set right after Apache has read the request from the client and then calling ap_update_vhost_from_headers to actually determine the vhost. All this happens before your module gets to run. It might be possible to create a C module that sets the Host: header like you want it to be and then call ap_update_vhost_from_headers. -- Thomas Eibner http://thomas.eibner.dk/ DnsZone http://dnszone.org/ mod_pointer http://stderr.net/mod_pointer