To enable virtual hosting, set the following line in the config file:
virtual_hosts = 1
The virtual hosting in GoFish works the same as the virtual hosting in thttpd. In the chroot jail, the top level directory contains sub-directories (or links to sub-directories) for all the domains supported. This is an extremely simple but powerful way of handling virtual hosts.
Let's say you own the domains bert.net and ernie.net. Bert is really into stamps, so he has a stamps sub-directory under his home directory.
The top level directory would look something like this (-> denotes a link):
Notice you need both the www.bert.net and bert.net since users might use either one. If a host is not matched, the user will get a 404 Not Found error.
The real power of this scheme comes when Bert's stamp site starts to get really popular (it doesn't hurt that he is pushing it on Sesame Street). He wants to give it it's own top level domain, stamps.bert.net. All he has to do, is put a link in the top level and he is done!
If you want to access the domains locally, you can add the machine names to the top level directory with appropriate links. Ditto for IP addresses.
Back to GoFish
Contact Sean MacLennan Last modified: Thu Oct 24 23:32:21 EDT 2002 |