home *** CD-ROM | disk | FTP | other *** search
/ Caldera Network Desktop 1.0 / caldera-network-desktop-1.0.bin / doc / HOWTO / mini / Virtual-Web < prev    next >
Text File  |  1995-11-29  |  12KB  |  284 lines

  1. VirtualWeb-Mini-HOWTO
  2.  
  3. Dan Pancamo, pancamo@infocom.net http://www.infocom.net/~pancamo/
  4.  
  5. v1.0, 24 November 1995  Copyright 1995
  6.  
  7. This HOWTO discuss the essentials of setting up a Virtual Web Site under Linux.
  8.  
  9. Table of Contents
  10.  
  11. 1.0 What is a Virtual Web Site?
  12. 2.0 What software patched do I need?
  13.     2.1 Linux versions 1.2.X requires the IPalias patch alias-patch-1.2.1-v1
  14.     2.2 Both NCSA 1.5 and Apache support Virtual hosting.
  15. 3.0 How Do I set it up?
  16.     3.1 Creating the new account
  17.     3.2 Setting up the NCSA 1.5 and Apache config files
  18.     3.3 Configuring the interface
  19.     3.4 Registering with Internic
  20.     3.5 Configuring Named
  21.         3.5.1 Example /etc/named.boot (replace x with your IP)
  22.         3.5.2 Example /etc/named.data/db.domain1.com
  23.         3.5.3 Example /etc/named.data/db.xxx.xxx.xxx
  24.         3.5.4 restart named;  i.e. named.restart
  25.     3.6 Virtual Mail
  26.         3.6.1 Sendmail configuration
  27.         3.6.1.1. Create /etc/domainalias
  28.         3.6.1.2 Create the maped DB file
  29.         3.6.1.3.1. Add a Cw record for each host
  30.         3.6.1.3.2. Add the domainalias mapping
  31.         3.6.1.3.3. Add/Change Ruleset 98
  32.     3.7 Virtual FTP
  33.  
  34. 4.0  Links to more Virtual Web Information
  35.  
  36. 1.0 What is a Virtual Web Site?
  37.  
  38.     A World Wide Web (WWW) Server is normally a single machine dedicated to
  39.     processing HTTP requests for a single WWW site.  Simply put, one WWW site
  40.     per machine.  Since the computing resources for processing httpd requests is
  41.     low for most WWW sites, the majority of the computing resources are left
  42.     unused.  A virtual WWW site simple allows more than one WWW site to share a
  43.     single processor.  Instead of having www.domain1.com and www.domain2.com
  44.     requiring two physical computing devices, www.domain1.com and
  45.     www.domain2.com can be located on a single computing device and share common
  46.     resources.
  47.  
  48.     Normally small computing facilities, and small businesses do not have the
  49.     resources to maintain a dedicated web server and a dedicated Internet
  50.     connection.  These cost can easily start off at $10K for setup, and
  51.     $500-2500 monthly to maintain.  Small computing facilities, and small
  52.     businesses are now able to "rent" WWW space from a Virtual WWW providers.
  53.     The customer can then maintain the WWW "pages" using a local telnet and/or
  54.     FTP connection.
  55.  
  56.     WWW providers such as InfoCom Networks http://www.infocom.net/
  57.     provide WWW space as low as $75 per month. A few Virtual Sites
  58.     might clear up the mystery.  So the cost of setting up a WWW site is
  59.     significantly lower than that of setting up a dedicated server and
  60.     connection.  The Virtual Site has a major advantage over other WWW
  61.     addressing schemes such as "www.yourprovider.com/~businessname".  The
  62.     Virtual WWW server inherently contains the ability to move to a new location
  63.     or setup a dedicated WWW server without changing addresses.  Changing WWW
  64.     URL's can result in a major loss of traffic to your site, and lots of
  65.     business literature updates.
  66.  
  67.     With most web sites, www.domain1.com and www.domain2.com both resolve to
  68.     separate IP's.  In order to accept multiple request from a single host, the
  69.     virtual host must be able to answer request for both sites. The method used
  70.     to solve this problem is called IP aliasing.  IP aliasing allows a single
  71.     host to accept request for multiple IP's.  The virtual Web server must have
  72.     the ability to alias IP's
  73.  
  74.     IP aliasing is just one part of the virtual solution. The Domain Name System
  75.     (DNS) also must be configured to resolve both www.domain1.com and
  76.     www.domain2.com.  If domain1.com and domain2.com are new domains, then both
  77.     must be registered with Internic. Currently, Internic is charging $50 a year
  78.     to maintain your domain.
  79.  
  80.     Most virtual WWW sites should also provide virtual mail, or the ability to
  81.     forward all mail to the virtual domain to another user or users.
  82.  
  83.     Virtual FTP or the ability to FTP using the standard host name
  84.     "ftp.domain1.com" should also be configured by the WWW provider.
  85.  
  86. 2.0 What software patched do I need?
  87.  
  88.     2.1 Linux versions 1.2.X requires the IPalias patch alias-patch-1.2.1-v1
  89.         and alias-net-tools.tar. I'm not sure if 1.3.X supports this patch yet.
  90.         For more information on the IPalias patch see
  91.         ftp://ftp.mindspring.com/users/rsanders/ipalias/
  92.  
  93.         Using multiple dummy interfaces has been suggested in place of
  94.         the IPalias solution.  While the dummy solution may work,
  95.         it does not appear to be as clean as the IPalias solution.
  96.         For more information on using Apache and the dummy solution
  97.         see Aram Mirzadeh's virtual hosting information at
  98.         http://www.qosina.com/apache/virtual.html
  99.  
  100.         All that is required to add a new alias using the IPalias method is:
  101.         > /sbin/ifconfig eth0 alias www.domainX.com
  102.  
  103.         Also, the IPalias solution is supported on several other platforms.
  104.  
  105.     2.2 NCSA 1.5, Apache, and Spinner support Virtual hosting.
  106.         http://hoohoo.ncsa.uiuc.edu/docs/Overview.html
  107.         http://www.apache.org/
  108.         http://spinner.infovav.se/
  109.  
  110. 3.0 How Do I set it up?
  111.  
  112.     3.1 Create the new account
  113.         Create a regular Linux account for the virtual customer with home
  114.         directory and mail.
  115.  
  116.     3.2 Setup the NCSA 1.5 or Apache config files
  117.  
  118.         Virtual Host implementations are still changing.  A few patches
  119.         exist to support Virtual Host Check the server's release notes for
  120.         more details.  NCSA 1.5 or Apache now include the Virtual patches,
  121.         and I have been told that Spinner supports virtual hosts.
  122.  
  123.         One virtual patch supports the following srm.conf syntax, however
  124.         the second NCSA 1.5 method of defining a Virtual host allows
  125.         for greater flexibility
  126.  
  127.            SubDocumentRoot www.domain1.com /usr/local/etc/httpd/docs/domain1
  128.            SubDocumentRoot www.domain2.com /usr/local/etc/httpd/docs/domain2
  129.  
  130.  
  131.         NCSA and Apache support the following httpd.conf syntax:
  132.  
  133.  
  134.            ServerAdmin webmaster@domain1.com
  135.            DocumentRoot /usr/local/etc/httpda/docs/domain1
  136.            ServerName www.domain1.com
  137.            ErrorLog logs/errors.domain1.com
  138.            TransferLog logs/access_log.domain1.com
  139.  
  140.  
  141.     3.3 Configuring the interface
  142.  
  143.         Once the IPalias patches have been installed add the
  144.         following to your /etc/rc.d/rc.local on your local web server.
  145.  
  146.            /sbin/ifconfig eth0 alias www.domain1.com
  147.            /sbin/ifconfig eth0 alias www.domain2.com
  148.            /sbin/ifconfig eth0 alias www.domainN.com
  149.  
  150.     3.4 Registering with Internic
  151.  
  152.         If you are setting up a new domain or change a current
  153.         domain, you must register the domain with Internic.
  154.         The template can be found at
  155.         ftp://rs.internic.net/templates/domain-template.txt
  156.  
  157.  
  158.     3.5 Configuring Named
  159.  
  160.         Named will need to be configured so that your virtual domain will
  161.         be visible to the outside world.  I don't claim to be an expert
  162.         on DNS.  Suggestions always welcome.
  163.  
  164.         3.5.1 Example /etc/named.boot (replace x with your IP)
  165.  
  166.               directory /etc/named.data
  167.               primary           realdomain.com                  db.realdomain.com
  168.               primary           xxx.xxx.xxx.IN-ADDR.ARPA        db.xxx.xxx.xxx
  169.               primary           0.0.127.IN-ADDR.ARPA            db.local
  170.  
  171.               primary           domain1.com                     db.domain1.com
  172.               primary           domain2.com                     db.domain2.com
  173.               cache             .                               named.root
  174.  
  175.        3.5.2 Example /etc/named.data/db.domain1.com
  176.  
  177.              $ORIGIN com.
  178.              domain1    IN      SOA     domain1.com. hostmaster.domain1.com. (
  179.                         10134 43200 3600 604800 86400 )
  180.                         IN      NS      ns1.realdomain.com.
  181.                         IN      MX      10 mail.realdomain.com.
  182.                         IN      MX      0 domain1.com.
  183.            domain1.com. IN      A       xxx.xxx.xxx.xxx    ;www.domain1.com IP
  184.  
  185.              $ORIGIN domain1.com.
  186.              ftp        IN      CNAME   domain1.com.
  187.              www        IN      CNAME   domain1.com.
  188.              mail       IN      CNAME   domain1.com.
  189.  
  190.        3.5.3 Example /etc/named.data/db.xxx.xxx.xxx
  191.  
  192.              You should already have a db.xxx.xxx.xxx for your current site
  193.              update it to contain the new virtual domains for reverse lookups
  194.  
  195.                 xx              IN      PTR     www.domain1.com.
  196.                 xx              IN      PTR     www.domain2.com.
  197.  
  198.        3.5.4 restart named;  i.e. named.restart
  199.  
  200.     3.6 Virtual Mail
  201.  
  202.         Your virtual customers will more than likely want the ability to have
  203.         mail that is sent to their domain forwarded to another domain.  A few
  204.         sendmail.cf changes will do the trick. After several months of
  205.         trying different sendmail changes, this is the 1st method that I
  206.         found that works and requires only one sendmail.cf change for each
  207.         new virtual site.
  208.  
  209.         3.6.1 Sendmail configuration
  210.  
  211.           Retrieve the current version of sendmail that contains makemap btree support
  212.  
  213.           3.6.1.1. Create a file called /etc/domainalias with the following mappings:
  214.  
  215.                 *@domain1.com           localnet@realdomain.com
  216.                 *@domain2.com           townplaz@realdomain.com
  217.                 *@domainN.com           soracomp@realdomain.net
  218.  
  219.                 webmaster@domain1.com   somuser@anotherhost.com
  220.                 jamison@domain2.com     anotheruser@somehost.com
  221.  
  222.           3.6.1.2 Create the maped DB file
  223.  
  224.                 > makemap btree /etc/domainalias.db  < /etc/domainalias
  225.  
  226.           3.6.1.3. /etc/sendmail.cf changes:
  227.  
  228.             3.6.1.3.1. Add a Cw record for each new virtual host
  229.  
  230.                 Cwdomain1.com
  231.                 Cwdomain2.com
  232.  
  233.             3.6.1.3.2. Add the domainalias mapping only once
  234.  
  235.                  Kdomainalias btree /etc/domainalias.db
  236.  
  237.             3.6.1.3.3. Add/Change Ruleset 98
  238.  
  239.                 ###################################################################
  240.                 ###  Ruleset 98 -- local part of ruleset zero (can be null)     ###
  241.                 ###################################################################
  242.  
  243.                 S98
  244.  
  245.                 R$+ < $+ . >          $1 < $2 >                         remove trailing dots
  246.                 R$+ < $+ >            $: < > $(domainalias $1$2 $)      match user@address
  247.                 R< > $+ @ $*          $: < $1 > $(domainalias * @ $2 $) match *@address
  248.                 R< $+ > * $*          $: < > $1 $2                      replace * with userid
  249.                 R < $+ > $+           $: < > $2                         bugfix
  250.                 R< > $*               $: $>3 $1                         and rewrite using S3
  251.  
  252.  
  253.           3.5.1.4  Sendmail Testing
  254.                 Test the sendmail configuration to verify the new
  255.                 sendmail.cf changes
  256.                 > sendmail -v -bv info@domain1.com
  257.                 The final destination should be displayed.
  258.  
  259.  
  260.     3.7 Virtual FTP
  261.  
  262.         Currently, I have not been able to get Virtual FTP to work.
  263.         A few patches exist, and I'm sure a working patch exist.
  264.         We just create a working directory  /home/ftp/business/domain1,
  265.         but a true Virtual FTP would be nice.
  266.  
  267.         If anyone would like to contribute a solution, I would be more
  268.         than happy to add it here.
  269.  
  270.         Arnt Gulbrandsen has rewritten ftpd and has included support for
  271.         independent FTP services The Troll Tech FTP Daemon
  272.  
  273.     4.0  Links to more Virtual Web information
  274.  
  275.         http://hoohoo.ncsa.uiuc.edu/docs/Overview.html
  276.         http://www.apache.org/
  277.         http://www.qosina.com/apache/virtual.html
  278.         http://spinner.infovav.se/
  279.         ftp://ftp.mindspring.com/users/rsanders/ipalias/
  280.         http://www.thesphere.com/~dlp/TwoServers/
  281.         http://hoohoo.ncsa.uiuc.edu/docs/setup/httpd/VirtualHost.html
  282.         ftp://ftp.dhp.com:/pub/linux/virtual-hosting
  283.  
  284.