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 Filesystem tree.png

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:

Foswiki URI tree.png
I Attachment Action Size Date Who Comment
Foswiki_Filesystem_tree.graphmlgraphml Foswiki_Filesystem_tree.graphml manage 152 K 05 Aug 2014 - 19:30 DavidTonhofer  
Foswiki_Filesystem_tree.pngpng Foswiki_Filesystem_tree.png manage 599 K 05 Aug 2014 - 19:30 DavidTonhofer  
Foswiki_URI_tree.graphmlgraphml Foswiki_URI_tree.graphml manage 33 K 05 Aug 2014 - 20:19 DavidTonhofer  
Foswiki_URI_tree.pngpng Foswiki_URI_tree.png manage 227 K 05 Aug 2014 - 20:19 DavidTonhofer  
foswiki.mine.directorysetup.confconf foswiki.mine.directorysetup.conf manage 5 K 05 Aug 2014 - 19:44 DavidTonhofer  
foswiki.mine.locationsetup.confconf foswiki.mine.locationsetup.conf manage 9 K 05 Aug 2014 - 20:08 DavidTonhofer  
Topic revision: r1 - 05 Aug 2014, DavidTonhofer
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy