Annotation of embedaddon/lighttpd/doc/outdated/simple-vhost.txt, revision 1.1.1.1

1.1       misho       1: ======================
                      2: Simple Virtual-Hosting
                      3: ======================
                      4: 
                      5: ------------------------
                      6: Module: mod_simple_vhost
                      7: ------------------------
                      8: 
                      9: :Author: Jan Kneschke
                     10: :Date: $Date: 2004/08/29 09:43:49 $
                     11: :Revision: $Revision: 1.1 $
                     12: 
                     13: :abstract:
                     14:   virtual hosting
                     15: 
                     16: .. meta::
                     17:   :keywords: lighttpd, virtual hosting
                     18: 
                     19: .. contents:: Table of Contents
                     20: 
                     21: Description
                     22: ===========
                     23: 
                     24: Simple assumption:
                     25: 
                     26: Every virtual host is in a directory below a base directory in a path that
                     27: is the same as the name of the vhost. Below this vhost path might be an
                     28: extra directory which is the document root of the vhost.
                     29: 
                     30: The document root for each vhost is built from three values:
                     31: 
                     32: - server-root
                     33: - hostname
                     34: - document-root
                     35: 
                     36: The complete document root is constructed either by ::
                     37: 
                     38:   server-root + hostname + document-root
                     39: 
                     40: or if this path does not exist by ::
                     41: 
                     42:   server-root + default-host + document-root
                     43: 
                     44: A small example should make this idea clear: ::
                     45: 
                     46:   /var/www/
                     47:   /var/www/logs/
                     48:   /var/www/servers/
                     49:   /var/www/servers/www.example.org/
                     50:   /var/www/servers/www.example.org/lib/
                     51:   /var/www/servers/www.example.org/pages/
                     52:   /var/www/servers/mail.example.org/
                     53:   /var/www/servers/mail.example.org/lib/
                     54:   /var/www/servers/mail.example.org/pages/
                     55: 
                     56:   simple-vhost.server-root = "/var/www/servers/"
                     57:   simple-vhost.default-host = "www.example.org"
                     58:   simple-vhost.document-root = "pages"
                     59: 
                     60: You can use symbolic links to map several hostnames to the same directory.
                     61: 
                     62: Conditionals vs. simple-vhost
                     63: -----------------------------
                     64: 
                     65: You have to keep in mind that conditionals and simple-vhost interfere
                     66: with one another. ::
                     67: 
                     68:   simple-vhost.server-root = "/var/www/servers/"
                     69:   simple-vhost.default-host = "www.example.org"
                     70:   simple-vhost.document-root = "pages"
                     71: 
                     72:   $HTTP["host"] == "news.example.org" {
                     73:     server.document-root = "/var/www/servers/news2.example.org/pages/"
                     74:   }
                     75: 
                     76: When ``news.example.org`` is requested, the ``server.document-root``
                     77: will be set to ``/var/www/servers/news2.example.org/pages/``, but
                     78: simple-vhost will overwrite it shortly afterwards.
                     79: 
                     80: If ``/var/www/servers/news.example.org/pages/`` exists, that will be
                     81: used. If not, ``/var/www/servers/www.example.org/pages/`` will be taken
                     82: because it is the default.
                     83: 
                     84: To use conditionals together with simple-vhost, you should do this: ::
                     85: 
                     86:   $HTTP["host"] !~ "^(news\.example\.org)$" {
                     87:     simple-vhost.server-root = "/var/www/servers/"
                     88:     simple-vhost.default-host = "www.example.org"
                     89:     simple-vhost.document-root = "pages"
                     90:   }
                     91: 
                     92:   $HTTP["host"] == "news.example.org" {
                     93:     server.document-root = "/var/www/servers/news2.example.org/pages/"
                     94:   }
                     95: 
                     96: It will enable simple vhosting for all hosts other than ``news.example.org``.
                     97: 
                     98: Options
                     99: =======
                    100: 
                    101: simple-vhost.server-root
                    102:   root of the virtual host
                    103: 
                    104: simple-vhost.default-host
                    105:   use this hostname if the requested hostname does not have its own directory
                    106: 
                    107: simple-vhost.document-root
                    108:   path below the vhost directory
                    109: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>