DokuWiki

It's better when it's simple

User Tools

Site Tools


Sidebar

Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community


Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy

install:lighttpd_config_example

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.txt · Last modified: 2015-09-23 22:14 by 84.249.197.102