Difference between revisions of "Conf/Examples/VirtualHosts"
Jump to navigation
Jump to search
(Created page with '= Virtual Hosts Configuration = part of AOLserver Config Examples # Configuration Variables set instance main set description "Main Aolserver Instance…') |
|||
Line 2: | Line 2: | ||
[[Conf/Examples | part of AOLserver Config Examples]] | [[Conf/Examples | 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_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_param home | + | |
− | ns_param servername | ||
− | |||
− | |||
− | ns_param serverlog | ||
− | ns_param pidfile | ||
− | |||
ns_section ns/servers | ns_section ns/servers | ||
− | ns_param | + | ns_param server1 "Website 1" |
+ | ns_param server2 "Website 2" | ||
− | + | # Load nssock | |
− | + | ns_section ns/modules | |
− | + | ns_param nssock nssock.so | |
− | |||
− | ns_section ns/ | ||
− | ns_param | ||
− | ns_section ns | + | # Configure nssock |
− | ns_param port | + | ns_section ns/module/nssock |
− | + | ns_param port 80 | |
ns_param address 127.0.0.1 | ns_param address 127.0.0.1 | ||
− | + | ns_param defaultserver server1 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | ns_param | ||
− | |||
− | |||
+ | # 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_section ns/server/ | ||
ns_param directoryfile index.html | ns_param directoryfile index.html | ||
− | ns_param pageroot /var/www/ | + | 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 | ||
− | ns_section ns/ | + | # virtual server2 |
− | ns_param www | + | ns_section ns/server/server2 |
+ | ns_param directoryfile index.html | ||
+ | ns_param pageroot /var/www/example2.com | ||
− | ns_section ns/server/ | + | ns_section ns/server/server2/modules |
− | + | ns_param nslog nslog.so | |
− | ns_param | ||
− | |||
− | |||
− | |||
− | ns_section ns/server/ | + | ns_section ns/server/server2/module/nslog |
− | + | ns_param file /var/log/aolserver4/example2.com.access.log | |
− | |||
− | |||
− | |||
− | |||
− | ns_param file | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 13:01, 28 December 2011
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