Note on the Foswiki Tree
This is my own Apache 2.4 configuration of Foswiki, which differs markedly from the one in the Foswiki documentation.
Here, the Foswiki installation is integrated in an Apache "virtual host".
We first define a default set on the filesystem, using
Directory
instructions.
These
Directory
instructions are included into
httpd.conf
at the "default host" level, outside of the
VirtualHost
directive.
Inside the
VirtualHost
directive, access permissions and other configurations are declared with
Location
directives.
Location directives apply to the URI tree, not to the filesystem tree, and are applied after the
Directory
instructions. (
Why no
Directory
instructions inside a
VirtualHost
? Because, atlthough they do work, they feel wrong, they may be deprecated in the future and
ExecCGI
doesn't work inside a
Directory
inside a
VirttualHost
for some reason.
Assumptions
- The Foswiki root (corresponding to the directory that is created when you unpack the distribution) is installed in
/home/wikis/foswiki_mine
and is accessible via http://foobar.example.com/wikis/mine
.
- Authentication is done via httpd basic authentication. Foswiki users are registered in
conf/users/foswiki.users
- This is a non-public setup: the whole of the Foswiki URI tree is protected (but that can be easily changed).
- Foswiki is accessible via SSL.
Foswiki Filesystem Tree
The attached file
foswiki.mine.directorysetup.conf
is included from
httpd.conf
:
foswiki.mine.directorysetup.conf
httpd.conf
should lock down the whole filesystem before that "include" via:
<Directory />
# Options FollowSymlinks
AllowOverride None
Require all denied
</Directory>
An orientation what is applied where on the filesystem tree:
Foswiki URI Tree
The attached file
foswiki.mine.locationsetup.conf
is included from inside a
VirtualHost
directive:
foswiki.mine.locationsetup.conf
For example:
<VirtualHost _default_:443>
ServerName foobar.example.com
SSLEngine on
SSLCipherSuite HIGH:!IDEA:!ADH:!MD5:!aNULL
CustomLog logs/ssl.log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
# By default get files from here (nothing to do with FOswiki)
DocumentRoot "/var/www/html/foobar.example.com"
Include "conf/services/foswiki.mine.locationsetup.conf"
</VirtualHost>
The yellow boxes are the elements of the URI: