Conf/Examples/VirtualHosts

From AOLserver Wiki
Jump to navigation Jump to search

Virtual Hosts Configuration

part of AOLserver Config Examples

This config provides HTTP 1.1 style virtual hosts.

nssock is loaded globally and configured to map domain names to virtual servers.

Each virtual server then loads and configures any modules it needs. In this case just nslog for access logs.

 # Global Parameters
 ns_section ns/parameters
 ns_param home /usr/lib/aolserver4
 ns_param servername "Main AOLserver Process"
 ns_param serverlog /var/log/aolserver4/virtual-hosts.log
 ns_param pidfile /var/run/aolserver4/virtual-hosts.pid
 ns_section ns/servers
 ns_param   server1 "Website 1"
 ns_param   server2 "Website 2" 
 # Load nssock
 ns_section ns/modules
 ns_param   nssock             nssock.so
 # Configure nssock
 ns_section ns/module/nssock
 ns_param   port            80
 ns_param   address         127.0.0.1
 ns_param   defaultserver   server1
 # Map hostnames to virtual servers
 ns_section ns/module/nssock/servers
   ns_param server1 example1.com
   ns_param server2 example2.com
 # virtual server 1 
 ns_section ns/server/server1
 ns_param   directoryfile   index.html
 ns_param   pageroot        /var/www/example1.com
 # modules for server1
 ns_section ns/server/server1/modules
   ns_param   nslog         nslog.so
 # Configure server1 accesslog
 ns_section ns/server/server1/module/nslog
 ns_param   file            /var/log/aolserver4/example1.com.access.log
 # virtual server2 
 ns_section ns/server/server2
 ns_param   directoryfile   index.html
 ns_param   pageroot        /var/www/example2.com
 ns_section ns/server/server2/modules
 ns_param   nslog         nslog.so
 ns_section ns/server/server2/module/nslog
 ns_param   file         /var/log/aolserver4/example2.com.access.log