DokuWiki

It's better when it's simple

User Tools

Site Tools


install:lighttpd_config_example

This is an old revision of the document!


Lighttpd example config

Below is an example config containing both a replacement to the Apache .htaccess directives and rewrite rules. You can modify this based on you own preferences / needs.

If you use vhosts I'd recommend you put the following into it's own config, and include it only for that site, example:

$HTTP["host"] == "wiki.example.com" {
  include "dokuwiki.conf"
}
dokuwiki.conf
# DokuWiki configuration
# We assume here that the wiki is accessible via http://wiki.example.com/dokuwiki/
var.dokudir = "/dokuwiki"
 
# make sure those are always served through FastCGI and never as static files
static-file.exclude-extensions = ( ".php" )
 
# deny access completely to these
$HTTP["url"] =~ "/(\.|_)ht" { url.access-deny = ( "" ) }
$HTTP["url"] =~ "^" + var.dokudir + "/(bin|data|inc|conf)/"  { url.access-deny = ( "" ) }
 
# rewrites for dokuwiki
$HTTP["url"] =~ "^" + var.dokudir { index-file.names = ("doku.php") }
url.rewrite-once = (
  "^" + var.dokudir + "/lib/.*$"                     => "$0",
  "^" + var.dokudir + "/_media/(.*)?\?(.*)$"         => var.dokudir + "/lib/exe/fetch.php?media=$1&$2",
  "^" + var.dokudir + "/_media/(.*)$"                => var.dokudir + "/lib/exe/fetch.php?media=$1",
  "^" + var.dokudir + "/_detail/(.*)?\?(.*)$"        => var.dokudir + "/lib/exe/detail.php?media=$1&$2",
  "^" + var.dokudir + "/_detail/(.*)?$"              => var.dokudir + "/lib/exe/detail.php?media=$1",
  "^" + var.dokudir + "/_export/([^/]+)/(.*)\?(.*)$" => var.dokudir + "/doku.php?do=export_$1&id=$2&$3",
  "^" + var.dokudir + "/_export/([^/]+)/(.*)"        => var.dokudir + "/doku.php?do=export_$1&id=$2",
  "^" + var.dokudir + "/doku.php.*"                  => "$0",
  "^" + var.dokudir + "/feed.php.*"                  => "$0",
  "^" + var.dokudir + "/(.*)\?(.*)"                  => var.dokudir + "/doku.php?id=$1&$2",
  "^" + var.dokudir + "/(.*)"                        => var.dokudir + "/doku.php?id=$1"
)

Note: On Debian there is no dokuwiki.conf, but there is a symlink /etc/lighttpd/conf-enabled/50-dokuwiki.conf → ../conf-available/50-dokuwiki.conf which itself is a symlink: /etc/lighttpd/conf-available/50-dokuwiki.conf → /etc/dokuwiki/lighttpd.conf

install/lighttpd_config_example.1439150812.txt.gz · Last modified: 2015-08-09 22:06 by 149.31.220.102

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki