[medusa] Virtual Hosting?

Sam Rushing rushing@n...
Tue, 27 Jul 1999 14:34:58 -0700 (PDT)


brian.brown@s... writes:
> Does medusa support binding to a specific IP address? Also, does it
> support serving up different document roots based on DNS domain
> information contained in the http 1.1 header?

Medusa supports both types of virtual hosting: check out the file
'virtual_handler.py'.

Here's how you might use it:

[in your copy of 'start_medusa.py']

fs = filesys.os_filesystem ('/var/www/scary')
dh = default_handler.default_handler (fs)
vh = virtual_handler.virtual_handler_with_host (dh, 'freddy.nightmare.com')
hs = http_server.http_server ('<your.ip.address>', 80, rs, lg)
hs.install_handler (vh)

-Sam