[Solved] Rewrite Entries in lighttpd.conf using multiple (2) instances of dokuwiki
Added by epikur over 10 years ago
Hey everyone.
Lets assume I would like to have multiple (2) instances of dokuwiki running on one BananaPi (Lubuntu).
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty
lighttpd and dokuwiki are working fine as long as I am changing 'var.dokudir' and the asssociating rewrites for one of the dokuwikis in use manually in /etc/lighttpd/lighttpd.conf.
Now the question: Can I provide rewrite entries for both dokuwikis at the same time in lighttpd.conf and if yes, how would they have to look like?
So given the variables and folders:
var.dokudir = "/dokuwiki" (1st dokuwiki)
var.wakedir = "/wake" (2nd dokuwiki)
.
.
- rewrites for dokuwiki
$HTTP["url"] = ...
???
Hoping the description was confusing enough ;)
I appreciate any helpful advice.
Thanks in advance
original /etc/lighttpd/lighttpd.conf: ######################################################################################################- variables
var.basedir = "/var/www/"
var.logdir = "/var/log/lighttpd"
var.statedir = "/var/lib/lighttpd"
var.dokudir = "/dokuwiki"
"mod_rewrite"
- "mod_redirect",
- "mod_alias",
- "mod_access",
- "mod_auth",
- "mod_status",
- "mod_setenv",
- "mod_fastcgi",
- "mod_proxy",
- "mod_simple_vhost",
- "mod_evhost",
- "mod_userdir",
- "mod_cgi",
- "mod_compress",
- "mod_ssi",
- "mod_usertrack",
- "mod_expire",
- "mod_secdownload",
- "mod_rrdtool",
- "mod_accesslog"
)
server.document-root = "/var/www"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ( "application/javascript", "text/css", "text/html", "text/plain" )
- rewrites for dokuwiki
$HTTP["url"] =~ "^" + var.dokudir { index-file.names = ("doku.php") }
url.rewrite = (
"^" + 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"
)
- default listening port for IPv6 falls back to the IPv4 port
- Use ipv6 if available
#include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"
- Use ipv6 if available
$HTTP["remoteip"] !~ "192.168.2.189" { $HTTP["url"] =~ "^/stats/" {
url.access-deny = ( "" )
}
}
###################################################################################################
lighttpd.conf (2.74 KB) lighttpd.conf |
Replies (1)
RE: Rewrite Entries in lighttpd.conf using multiple (2) instances of dokuwiki - Added by epikur over 10 years ago
In case someone else happens to be interested in the problem given above or similar ones:
##########################################################
url.rewrite-once = (
"<regex1>" => "<relative-uri1>",
"<regex2>" => "<relative-uri2>"
)
##########################################################
was the key to the solution.
Multiple Instances of dokuwiki working fine now without the need of dokuwiki farms.