Chapter 10. Apache HTTP Server 155In the above example, change â module-nameã to the name of the module andâpath/to/module.soã to the path to the DSO.10.8. Virtual HostsThe Apache HTTP Server’s built in virtual hosting allows the server to serve different informationbased on which IP address, hostname, or port is being requested. A complete guide to using virtualhosts is available online at http://httpd.apache.org/docs-2.0/vhosts/.10.8.1. Setting Up Virtual HostsTo create a name-based virtual host, it is best to use the virtual host container provided in httpd.confas an example.The virtual host example read as follows:#NameVirtualHost *## ä VirtualHost * å# ServerAdmin webmaster@dummy-host.example.com# DocumentRoot /www/docs/dummy-host.example.com# ServerName dummy-host.example.com# ErrorLog logs/dummy-host.example.com-error_log# CustomLog logs/dummy-host.example.com-access_log common# ä /VirtualHost åTo activate name-based virtual hosting, uncomment the NameVirtualHost line by removing thehash mark (#) and replace the asterisk (*) with the IP address assigned to the machine.Next, configure a virtual host, by uncommenting and customizing the æ VirtualHostç container.On the æ VirtualHost ç line, change the asterisk (*) to the server’s IP address. Change theServerName to a valid DNS name assigned to the machine, and configure the other directives asnecessary.The æ VirtualHostç container is highly customizable and accepts almost every directive availablewithin the main server configuration.TipIf configuring a virtual host to listen on a non-default port, that port must be added to the Listendirective in the global settings section of /etc/httpd/conf/http.conf file.To activate a newly created virtual host the Apache HTTP Server must be reloaded or restarted. Referto Section 10.4 Starting and Stopping httpd for instructions on doing this.Comprehensive information about creating and configuring both name-based and IP address-basedvirtual hosts is provided online at http://httpd.apache.org/docs-2.0/vhosts/.10.8.2. The Secure Web Server Virtual HostBy default, the Apache HTTP Server is configured as both a non-secure and a secure server. Boththe non-secure and secure servers use the same IP address and host name, but listen on differentports: 80 and 443 respectively. This enables both non-secure and secure communications to take placesimultaneously.