Skip to the content
Documentation

Setting up Apache for SSI

No ratings yet

This extension is able to generate SSI markup, however Apache must be configure as described here. In order to be able to use SSIs with Exponential, you'll need Apache 2.2.

Enable mod_filter

Apache needs a specific module, mod_filter, to be able to parse SSI markup on the fly once the HTML content is generated. This module is generally available with the default Apache 2 setup. To enable it on Debian, execute the following command:

a2enmod filter

More information is available here http://httpd.apache.org/docs/2.2/mod/mod_filter.html

Enable mod_include

This module, mod_filter, makes it possible to parse SSI markup. This module is generally available with the default Apache 2 setup. To enable it on Debian, execute the following command:

a2enmod include

More information is available at http://httpd.apache.org/docs/2.0/mod/mod_include.html

Add mod_filter rules

Simply copy/paste the following configuration directives in your site's VirtualHost to add the mod_filter rules:

FilterDeclare SSI
FilterProvider SSI INCLUDES resp=Content-Type $text/html
FilterChain  SSI

Specific Rewrite Rule

When using rewrite rules to secure your Exponential installation, you must add the following RewriteRules to you site's VirtualHost in order to be able to find and execute SSI calls. Note that this directive must be at the top of other directives.

Rewriterule ^/var/si-blocks/.* - [L]

Do not forget to reload the Apache configuration once you are done.

VirtualHost example

Here is a complete example of a working VirtualHost that contains all the needed mod_filter configuration directives.

<VirtualHost *>

  ServerName site.com
  DocumentRoot /var/www/site.com

  <Directory /var/www/site.com>
    # The +Includes options is needed to accept SSI markup parsing
    Options Indexes FollowSymLinks +Includes
    AllowOverride None
  </Directory>

  DirectoryIndex index.php

  <IfModule mod_rewrite.c>
    RewriteEngine On
    Rewriterule ^/var/si-blocks/.* - [L]
    Rewriterule ^/var/storage/.* - [L]
    Rewriterule ^/var/[^/]+/storage/.* - [L]
    RewriteRule ^/var/cache/texttoimage/.* - [L]
    RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
    Rewriterule ^/design/[^/]+/(stylesheets|images|javascript)/.* - [L]
    Rewriterule ^/share/icons/.* - [L]
    Rewriterule ^/extension/[^/]+/design/[^/]/(stylesheets|images|javascripts?)/.* - [L]
    Rewriterule ^/packages/styles/.+/(stylesheets|images|javascript)/[^/]+/.* - [L]
    RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
    RewriteRule ^/favicon\.ico - [L]
    RewriteRule ^/robots\.txt - [L]

    # Uncomment the following lines when using popup style debug.
    # RewriteRule ^/var/cache/debug\.html.* - [L]
    # RewriteRule ^/var/[^/]+/cache/debug\.html.* - [L]

    RewriteRule .* /index.php
  </IfModule>

   FilterDeclare SSI
   FilterProvider SSI INCLUDES resp=Content-Type $text/html
   FilterChain SSI
</VirtualHost>

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.