• Home
  • Personal
  • Tech
  • Politics
  • Photography
  • MoinMoin wiki on NGINX

    June 29th, 2008

    Further to my post about getting the MoinMoin wiki system working with FastCGI and Lighttpd, here is how to do the same with NGINX. MoinMoin is configured in FastCGI mode and listening on port 9005

    All the fastcgi_param lines up to PATH_INFO are pretty generic and I have them in a separate include file that I pull in for any Fastcgi stanza.

    
    
      if ($uri ~ ^/wiki(.*)?) {
        set $wiki_url $1;
      }
      location /wiki {
          fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
          fastcgi_param  SERVER_SOFTWARE    nginx;
          fastcgi_param  QUERY_STRING       $query_string;
          fastcgi_param  REQUEST_METHOD     $request_method;
          fastcgi_param  CONTENT_TYPE       $content_type;
          fastcgi_param  CONTENT_LENGTH     $content_length;
          fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
          fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
          fastcgi_param  REQUEST_URI        $request_uri;
          fastcgi_param  DOCUMENT_URI       $document_uri;
          fastcgi_param  DOCUMENT_ROOT      $document_root;
          fastcgi_param  SERVER_PROTOCOL    $server_protocol;
          fastcgi_param  REMOTE_ADDR        $remote_addr;
          fastcgi_param  REMOTE_PORT        $remote_port;
          fastcgi_param  SERVER_ADDR        $server_addr;
          fastcgi_param  SERVER_PORT        $server_port;
          fastcgi_param  SERVER_NAME        $server_name;
    
          fastcgi_param PATH_INFO $wiki_url;
          fastcgi_param SCRIPT_NAME /wiki;
          if (!-f $request_filename) {
            fastcgi_pass 127.0.0.1:9005;
          }
      }
    
    
    Tags: config, moinmoin, nginx, wiki

    Posted in Tech | 3 Comments »

  • MoinMoin wiki with Lighttpd 1.5

    July 29th, 2007

    This took me a little while to figure out, so I’ll blog here to help others (and me, next time I need to do it and can’t remember how).

    I use the MoinMoin wiki software to run a couple of wikis and they run under the Lighttpd web server. With the current stable Lighttpd (1.4) you configure it to use the MoinMoin fastcgi service a bit like this:

    
      $HTTP["url"] =~ "^/wiki" {
        fastcgi.server =  ("/wiki" => ( "mywiki" =>
          ( "host" => "127.0.0.1",
            "port" => 22000,
            "check-local" => "disable",
            "broken-scriptfilename" => "enable" )
          ))
      }
    
    

    The new Lighttpd (currently in development, but to be version 1.5) has reworked the way you define fastcgi backends, and has lost the “broken-scriptfilename” option in the process. Without it, MoinMoin doesn’t see what wiki page you’re trying to visit, and can’t build new links properly. Luckily you can reproduce this feature with some proxy-core rewrites:

    
      $HTTP["url"] =~ "^/wiki" {
        proxy-core.protocol = "fastcgi"
        proxy-core.backends = ( "127.0.0.1:22000" )
        proxy-core.rewrite-request = (
          "_pathinfo" => ( "^/wiki(/.*)" => "$1" ),
          "_scriptname" => ( "^(/wiki)" => "$1" )
        )
      }
    

    And your MoinMoin lives to be spammed another day.

    Tags: fastcgi, lighttpd, moinmoin, python, wiki

    Posted in Tech | 2 Comments »

  • John Leach

    • John Leach is a human being living in Leeds, UK.
  • Twitter

    • John had a lovely evening chatting with old friends, and their new partners. 6 hrs ago
    • More twitter updates →
  • Author Stuff

    • Brightbox Rails Hosting
    • Compost This
    • ELER Web Comic
    • New World Odour
    • News Sniffer
    • Photography
    • Profile and History
    • Recycle This
    • The Gillroyd Parade
    • Things to do today
    • Website
  • Friends

    • Caius Durling
    • Deb Bassett
    • Gianni Tedesco
    • Ian Higgins
    • Louisa Parry
    • Rahoul Baruah
    • Sleepy Kev
    • Tim Waters
    • Tom Hall
  • Stuff

    • ifup
    • Media Lens
    • Mia Bambina
    • News from nowhere
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
  • Search

Creative Commons License The text of this blog is licensed under the Creative Commons BY-ND license