Revision [16738]

This is an old revision of LighttpdConfig made by TzqQpg on 2007-05-31 10:43:01.

 

WikkaDocumentation Wikka Documentation

Configuring Lighttpd for Wikka



Introduction

I recently got Wikka running under lighttpd, and since I was only able to find limited documentation to support that effort either here or elsewhere, I thought I should document my experience for posterity.

Before I get started, though, I need to acknowledge JavaWoman and LadySerena from WikkaOnIrc #wikka, both for their assistance in getting the URL rewriting working, and for encouraging me to record the results.

Server Configuration

For my particular installation, I wanted to serve Wiki content out of the document root for a dedicated subdomain. So rather than have my Wiki reside at, say, http://www.example.com/wiki, I wanted it at http://wiki.example.com/. I also wanted it to use user-friendly URLs, like http://wiki.example.com/HomePage, rather than the out-of-the-box query-string URLs, such as http://wiki.example.com/wikka.php?wakka=HomePage. Finally, to get the best performance out of the combination of lighttpd and PHP, I chose to interface them using FastCGI.

To that end, I unpacked the Wikka distribution into the directory I had selected for my subdomain's document root, and then set about editing my lighttpd.conf configuration file.

Lighttpd Configuration

With respect to the server.modules configuration parameter, you will need to include mod_fastcgi for FastCGI support and, if you want user-friendly URLs, mod_rewrite. You should also make sure the index.php is included among the values for the server.indexfiles configuration parameter.

The server.modules configuration parameter applies to your overall lighttpd installation. If you're running multiple PHP applications, then adding index.php to the global server.indexfiles value is fine. If not, it could alternatively be set in a hostname-specific value for server.indexfiles.

All of the remaining configuration values are hostname-specific, since they apply only to the hostname that is running Wikka. Here's what the hostname-specific settings should look like:
%%(code)
$HTTP["host"] =~ "wiki\.example\.com" {
server.document-root = "/full/path/to/wiki/root/"
fastcgi.server = ( ".php" =>
( "localhost" =>
( "socket" => "/tmp/wikkawiki.socket",
"max-procs" => 2,
"bin-path" => "/full/path/to/php-cgi",
"bin-environment" =>
( "PHP_FCGI_CHILDREN" => "2",
"PHP_FCGI_MAX_REQUESTS" => "5000"
)
)
)
)
url.rewrite-once = (
"^(/images/.*)$" => "$1",
"^(/css/.*)$" => "$1",
"^(/3rdparty/plugins/freemind/.*)$" => "$1",
"^(/3rdparty/plugins/wikiedit/.*)$" => "$1",
"^(.*)\?(.*)$" => "wikka.php?wakka=$1
There is one comment on this page. [Display comment]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki