This page is for information about how to configure the main CS webservers.
Each virtual host is configured in a separate config file which is included into the main httpd.conf
.
Here is an example one:
<VirtualHost *:80> ServerName example.uwaterloo.ca DocumentRoot /software/wwwdata_cs.uwaterloo.ca/data/vhosts/example </VirtualHost> <VirtualHost *:80> ServerName www.example.uwaterloo.ca ServerAlias www.example example Redirect permanent / http://example.uwaterloo.ca/ </VirtualHost>
This would be placed in /software/wwwdata_cs.uwaterloo.ca/data/vhosts/example.conf
in the core.cs
environment.
Note that this file contains two virtual hosts. The first is the "real" one, and would also contain any host-specific directives that are needed. It has a single ServerName
directives and no ServerAlias
directives. The second handles alternate names that also refer to the same virtual host. These should all be redirected as shown to the canonical name. Note that the .uwaterloo.ca
can be omitted from anywhere on campus (or anywhere that has .uwaterloo.ca
specified as a search domain) so it is important to redirect these shorter versions of the name to the canonical name.
-- IsaacMorland - 06 May 2006