A site's apache configuration is automatically generated in
`/etc/apache2/sites-available/ikisite-*`.

It can be useful to tweak apache settings for a single site. To allow this,
use `/etc/ikiwiki-hosting/config/$username/apache.conf.tmpl`

This is an apache2 config fragment, that, if present, is inserted into the
site's generated apache config file by `ikisite enable`. Remeber to run
`ikisite enable` if modifying it.

It is inserted inside the `<VirtualHost>` tag in the apache config file,
at the end. So it can override anything that comes before, add additional
settings, etc. It is actually a HTML::Template template, and can contain
the same variables as `apache-site.tmpl`. (HOSTNAME, HOME, etc.)

Example:

	<Directory <TMPL_VAR HOME>/public_html>
		Options +Foo
		AuthName "<TMPL_VAR HOSTNAME>"
		AuthType Basic
		AuthUserFile <TMPL_VAR HOME>/apache/htpasswd
		Require valid-user
	</Directory>

Note the use of "+" to add to the default Options, rather than overriding it.

Note that the advantage of using this, over just allowing a htaccess file,
is that the site's owner could modify a htaccess file, but can't modify
this file. This avoids needing to worry about security issues with htaccess
files. (Also, apache's documentation warns about performance implications
of enabling htaccess files.) Of course, if a htaccess file is really wanted
for a given site, this file can be used to enable it.

---

To enable SSL, just install the ssl cerificate to
`/etc/ikiwiki-hosting/config/$username/ssl.crt`
and the key to 
`/etc/ikiwiki-hosting/config/$username/ssl.key`.
(Be sure to only let root read this file!)
When both files exist, and it is able to verify that
the key file is valid and not password protected, `ikisite enable`
will generate an apache config that enables using ssl.

A `/etc/ikiwiki-hosting/config/$username/ssl.chain` can also be provided,
if the CA need to provide additional certificate chain material.

Note that it's up to you to configure apache to use SNI if using SSL
for multiple virtual hosts on a single IP. See
<http://wiki.apache.org/httpd/NameBasedSSLVHostsWithSNI>
