Xitami Xitami 1.3c

| iMatix home page | Xitami home page | << | < | > | >>


 

Virtual Hosting

Virtual hosting means running multiple virtual web sites on one system. This is commonly used by web site providers, but can be useful in all kinds of organisations. There are two ways to configure your IP system to permit virtual hosting:

  1. You can assign multiple IP addresses to a system, a technique that is called 'multihoming'. An IP address refers to a connection point (e.g. a network card) to a system, rather than the system itself, so it's quite normal to have multiple IP addresses. Many network cards can support multiple addresses (4 or 8), and most systems can take multiple network cards. There are probably routers and gateways that make it possible to have thousands of IP addresses on one system.
  2. You can assign the same IP address to lots of host names, using DNS or something similar. Thus, 'www.some.domain' and 'ftp.some.domain' can refer to the same address. This is often called a 'virtual host' because the host does not exist as a separate computer, just as a name.

Xitami can work with both these mechanisms. It handles multiple IP addresses automatically: if you ask it to run on port 80, it will accept connections on any IP address, on port 80. You do not need to configure this (in fact, you cannot change this behaviour). This means that you do not need to specify on which IP address Xitami should accept connections - if a system has ten IP addresses, Xitami will accept connections on all ten.

A multihomed virtual host is identified by its IP address. A DNS-based virtual host is identified by its name:

[Virtual-Hosts]
    xxx.xxx.xxx.xxx=filename.cfg   #  A multihomed host
    www.some.domain=filename.cfg   #  A DNS-based virtual host

DNS-based virtual hosting requires a

When you set-up a virtual host, you will generally want to use a specific directory for the web pages, CGI scripts, password file, and log files. (You can also share these in any way you need to.) You can also configure options such as the HTTP error messages, timeouts, security, and so on.

To define these, you specify a configuration file per virtual host. The virtual host configuration inherits all definitions in xitami.cfg and custom.cfg. You need only define those options that are specific to the virtual host.

These values apply to the entire server globally, and are not taken from the virtual host configuration file:

When you define a multihomed virtual host, you must specify a server:hostname value. This should be a host name that translates back into the correct IP address. The server:hostname option is used whenever Xitami has to return a 'redirected' URL; for image maps, incomplete URL, and directory listings. If you do not define server:hostname, or define it wrongly, these functions may not work.

When you define a DNS-based virtual host, Xitami takes the name as a default value for the server:hostname option. This usually works correctly, but you can override it if necessary by adding the server:hostname option explicitly. To avoid confusion, make sure your DNS server is correctly configured. You normally use 'ping' to test that this works.

The virtual host configuration files, must exist when the server starts-up. You can modify the virtual host configurations on-the-fly, as for the normal configuration files, but if you want to add or remove a virtual host you must stop and restart the server (under Windows, suspend and resume the server).


| << | < | > | >>
| Contents | Installation | Administration | Configuration | Using CGI | Image Maps | Virtual Hosting | A Beginner's Guide | FAQ | Technical Implementation | Getting Support | Release History | License Agreement

iMatix Designed by Pieter Hintjens © 1997 iMatix