durusmail: quixote-users: Medusa bug or user misunderstanding?
Medusa bug or user misunderstanding?
2004-01-21
2004-01-21
2004-01-21
Re: Medusa bug or user misunderstanding?
2004-01-21
2004-01-21
2004-01-21
Medusa bug or user misunderstanding?
2004-01-21
2004-01-22
Re: Medusa bug or user misunderstanding? [patch files]
2004-01-22
Jason E. Sibre (3 parts)
Re: Medusa bug or user misunderstanding? [patchfiles]
2004-02-04
2004-02-05
Medusa bug or user misunderstanding?
2004-01-22
2004-01-21
Medusa bug or user misunderstanding?
Jason Sibre
2004-01-21
Hey folks,
        I think this is probably more related to Medusa than Quixote, but I'm
not
sure...

With both Apache and IIS, (what I'm familiar with) usually the environment
variables HTTP_HOST and SERVER_NAME usually seem to agree (exceptions noted
below *), and they both reflect what the browser requested (e.g., what the
user typed in the address bar).

With Medusa, HTTP_HOST reflects the requested URL, but SERVER_NAME seems to
be whatever Medusa deduces it to be, (the machine's hostname, I guess) or
whatever is specified as the server name in the Medusa setup/construction
(I'm not so sure about that, as I haven't dug much, yet).

This came up, because Quixote relies on SERVER_NAME when get_server() is
called...

So, Medusa not playing fair makes it more difficult to perform properly in a
'web-server-agnostic' way.  I.e., it makes it trickier to write a portable
quixote web app (portable between Medusa and Apache, for example), because
get_server() doesn't work as it should (or to be more precise, how *I* think
it should... I may be misunderstanding the intent here, however)

Of course, I can always use get_environ("HTTP_HOST"), and in fact that's
what I'm doing right now, but...  It feels hackish.

Any opinions out there?  Am I doing things wrongly here?


If you're wondering why this even came up, it's because I'm doing something
sorta like virtual hosting, and I'd like to do in a server like Medusa:
light, easy to deploy, single process, etc... I'm tossing around the idea of
looking into Twisted for this, but it looks like overkill for what I have in
mind.

That Built in HTTP server that was kicking around a week or so ago is really
what I want, I think!

Jason Sibre




* exceptions
With both IIS and Apache, if I specifiy the standard port in the URL, this
is what happens:
ex.
http://localhost:80/  -> HTTP_HOST = localhost:80
                         SERVER_NAME = localhost

https://localhost:443/ -> HTTP_HOST = localhost:443
                          SERVER_NAME = localhost

... and the server seems to redirect to the SERVER_NAME url, or mozilla
fixes it for me... Prolly mozilla, come to think of it.




reply