Virtual WWW Server
Updated May 22, 2001
Created May 22, 2001

How to do Virtual www:
  1. Edit /etc/httpd/conf/httpd.conf
  2. Duplicate the following section (which is already in the httpd.conf file):
    #NameVirtualHost 12.34.56.78:80
    #NameVirtualHost 12.34.56.78
    
    #
    # VirtualHost example:
    # Almost any Apache directive may go into a VirtualHost container.
    #
    #<VirtualHost ip.address.of.host.some_domain.com>
    #    ServerAdmin webmaster@host.some_domain.com
    #    DocumentRoot /www/docs/host.some_domain.com
    #    ServerName host.some_domain.com
    #    ErrorLog logs/host.some_domain.com-error_log
    #    CustomLog logs/host.some_domain.com-access_log common
    #</VirtualHost>
    
    Modify the above section so that it looks something like:
    NameVirtualHost 192.168.0.103
    
    <VirtualHost 192.168.0.103>
        ServerAdmin webmaster@mybox.mydomain.com
        DocumentRoot /var/www/mybox.mydomain.com
        ServerName mybox.mydomain.com
        ErrorLog logs/mybox.mydomain.com-error_log
        CustomLog logs/mybox.mydomain.com-access_log common
    </VirtualHost>
    
    FIXME: Double check that the above values are correct
    
  3. If you will be using a virtual ip, then here's how to do it
  4. ifconfig eth0:0 192.168.0.103
    route add 192.168.0.103
    
  5. Make sure you have the new directory created as you have shown for DocumentRoot in the above configuration section.
  6. Restart apache
  7. /etc/rc.d/init.d/httpd restart
  8. Be sure to press the "reload" button in your browser if you have already tried to access the page before you finished setting it up.



Homepage: http://geocities.datacellar.net/rlcomp_1999












1