]> sipb.mit.edu Git - ikiwiki.git/blob - doc/tips/psgi.mdwn
ikiwiki (3.20130711) unstable; urgency=low
[ikiwiki.git] / doc / tips / psgi.mdwn
1 Here's the app.psgi file if you want to run ikiwiki with [PSGI](http://plackperl.org) instead of apache or other web servers:
2
3     use Plack::App::CGIBin;
4     use Plack::Builder;
5     use Plack::App::File;
6     
7     builder {
8         mount '/ikiwiki.cgi' => Plack::App::CGIBin->new(file => './ikiwiki.cgi')->to_app;
9         enable "Plack::Middleware::Static",
10             path => sub { s!(^(?:/[^.]*)?/?$)!${1}/index.html! },
11                 root => '.';
12         mount '/' => Plack::App::File->new(root => ".")->to_app;
13     };
14
15 Put it in your destdir and now your can run `plackup -p <port>`.
16
17 Note that you should configure your `url` and `cgiurl` to point to the listening address of plackup.
18
19 Also, the app.psgi residing in the destdir means that /app.psgi is accessible from the web server.
20
21 Hopefully some day ikiwiki web ui will speak psgi natively.