[medusa] Re: Virtual Hosting?

brian@b... brian@b...
Tue, 27 Jul 1999 23:24:11 -0700


<14238.9475.715207.1306-@s...> wrote: 
original article:http://www.egroups.com/group/medusa/?start=66
> 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
> 
Thanks, Sam! Now to figure out how to do it in the Zopeified version ;)