Upgrading (a slightly modified) MoinMoin could be a rail PITA, but not with the WL MoinMoin framework :-), which loosely requires FreeBSD ports to upgrade MoinMoin, but only to fetch the new files. Anyways enough talking, let's get started :-)

Basic setup

/usr/local/www/wiki           = contains all wiki data
    | moin-latest             = symlink to latest MoinMoin version
    | moin<VERSION>           = MoinMoin version <VERSION>
         | data               = wiki pages
         | htdocs             = static MoinMoin pages 
         | moin.cgi           = MoinMoin main CGI file
         | moin.cgi.orig      = MoinMoin main CGI file original
         | stderr             = MoinMoin site logging file
         | stderr.orig        = MoinMoin site logging file original
         | underlay           = MoinMoin default wiki files
         |      = MoinMoin site config file
         | = MoinMoin site config file original
/usr/local/share/moin         = FreeBSD port installed version = Root URL
          | /                     = Latest active MoinMoin version
          | /moin<VERSION>        = MoinMoin <VERSION>
          | /moin_static<VERSION> = MoinMoin Static config files
          | /logo.png             = Logo alias
          | /favicon.ico          = Favicon ico format
          | /favicon.gif          = Favicon gif format


Let's get the hands dirty VERSION refers to the new MoinMoin install

  1. Install the latest version of MoinMoin using /usr/ports/www/moin

  2. Setup the new directory structure

    $ cd /usr/local/www/wiki
    $ mkdir moinVERSION
    $ cp -R /usr/local/share/moin/underlay .
    $ cp -R /usr/local/share/moin/htdocs .
    $ cp /usr/local/share/moin/config/ .
    $ cp /usr/local/share/moin/moin.cgi .
    $ cp /usr/local/share/moin/config/logging/stderr .
    # Copy the previous data
    $ cp -pR ../moin-latest/data .
    # Apply local changes to current files
    $ diff -u ../moin-latest/{.orig,} | patch -b
    $ diff -u ../moin-latest/moin.cgi{.orig,} | patch -b
    $ diff -u ../moin-latest/stderr{.orig,} | patch -b
    # Enable linking to latest file
    $ ln -fs /usr/local/www/moinVERSION /usr/local/www/moin-latest
  3. Read the update/upgrade guides of MoinMoin with regards to cache cleaning e.g.

  4. Alter /usr/local/etc/apache22/Includes/ and include the following lines

            RewriteRule ^/moin_staticVERSION/(.*) /usr/local/www/wiki/moinVERSION/htdocs/$1    [last]
            RewriteRule ^/moinVERSION/?(.*) /usr/local/www/wiki/moinVERSION/moin.cgi/$1 [last,type=application/x-httpd-cgi]
  5. Restart Apache and the new MoinMoin VERSION is active, enjoy :-)

Apache config file

# /usr/local/etc/apache22/Includes/ 
        Documentroot "/usr/local/www/empty"

        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
                CustomLog /var/log/httpd/wiki-access.log common
        ErrorLog  /var/log/httpd/wiki-error.log

        #Serving from the root
        RewriteEngine On

        # Always serve right favicon
        RewriteRule "/favicon.ico$' "/favicon.ico" [PT,L]
        RewriteRule "/favicon.gif$' "/favicon.gif" [PT,L]
        RewriteRule ^/favicon.ico    /usr/local/www/wiki/moin-latest/data/pages/WelcomePage/attachments/favicon.ico [last]
        RewriteRule ^/favicon.gif    /usr/local/www/wiki/moin-latest/data/pages/WelcomePage/attachments/favicon.gif [last]
        RewriteRule ^/logo.png       /usr/local/www/wiki/moin-latest/data/pages/WelcomePage/attachments/logo.png [last]

        # Legacy rewriting
        RewriteRule "^/wcl/cgi-bin/moin.cgi/(.*)" "/$1" [L,R=301]
        RewriteRule "^/moin.cgi/(.*)" "/$1" [L,R=301]

        # Version specific configuration
        RewriteRule ^/moin_static171/(.*) /usr/local/www/wiki/moin171/htdocs/$1    [last]
        RewriteRule ^/moin171/?(.*) /usr/local/www/wiki/moin171/moin.cgi/$1 [last,type=application/x-httpd-cgi]
        # Active life configuration
        RewriteRule ^/?(.*) /usr/local/www/wiki/moin-latest/moin.cgi/$1     [last,type=application/x-httpd-cgi]

        # Serving static files
        Alias /logo.png /usr/local/www/wiki/moin-latest/data/pages/WelcomePage/attachments/logo.png
        Alias /favicon.ico /usr/local/www/wiki/moin-latest/data/pages/WelcomePage/attachments/favicon.ico
        Alias /favicon.gif /usr/local/www/wiki/moin-latest/data/pages/WelcomePage/attachments/favicon.gif

        # Allowing XS to wiki directories
        <Directory "/usr/local/www/wiki">
                Allow from all


> wh00t I really like your menubar, how did you hack this into MoinMoin?

UpgradeMoinMoin (last edited 2009-09-28 06:29:45 by localhost)