----- Original Message -----
From: "Stas Bekman" <[EMAIL PROTECTED]>
To: "Chris Rodgers" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, August 01, 2001 05:16
Subject: Re: Bug??


> On Tue, 31 Jul 2001, Chris Rodgers wrote:
>
> > Thanks for that. However, I've already seen this. The problem is that
I'm
> > requesting pages at:
> >
> > http://my.server.com/perl/blah.pl
> >
> > and also
> >
> > https://my.server.com/perl/blah.pl
> >
> > Now these should be different scripts, and Apache is set up with a
> > completely different document and perl root for the http and https
> > servers. Unfortunately, these still get confused, even with the
> > NameWithVirtualHost code. Hence, I thought of hacking the .pm files to
> > include the server port as well as the name in the uniquely generated
> > namespace.
> >
> > Any other ideas??
>
> Hmm, I think you are the first one to hit this issue. Try this (untested):
>
> --- ./lib/Apache/Registry.pm.orig Wed Aug  1 11:06:49 2001
> +++ ./lib/Apache/Registry.pm Wed Aug  1 11:11:04 2001
> @@ -70,7 +70,8 @@
>
>   if ($Apache::Registry::NameWithVirtualHost &&
> $r->server->is_virtual) {
>       my $name = $r->get_server_name;
> -     $script_name = join "", $name, $script_name if $name;
> +     $script_name = join "", (exists $ENV{HTTPS}?'https':''),
> +                $name, $script_name if $name;
>   }
>
>   # Escape everything into valid perl identifiers
>
> based on the earlier discussion about detecting https :)

That will take care of standard http/https, but what if we have a custom
client connecting on weird ports _without_ putting the port in the URL?
Wouldn't it make sense to just take $ENV{SERVER_PORT} and join() _that_ to
make the unique filename?  That'll take care of all the weird server
combinations possible including SSL, as only one listening socket can
physically bind to a port.  It'll even transparently take care of weird
back-end server problems, as no matter how many servers seem to be on
http://frontend:80, the backends MUST be unique combinations of either
different hostnames or different ports...

Just my $0.02

  Issac

PGP Key 0xE0FA561B - Fingerprint:
7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B

Reply via email to