MoinMoin wiki


MoinMoin1.9.3 installation

$ cd /
$ sudo mkdir moinwiki
$ sudo chown XXXX(user name):XXXX(group name) moinwiki

Download moinmoin-1.9.3 and in download directory

$ tar xvf moin-1.9.3.tar.gz
$ cd moin-1.9.3
$ sudo python setup.py install --force --record=install.log --prefix='/usr/local' --install-data=/moinwiki

Installed directly:

wsgi test

$ cd /moinwiki/share/moin/server
$ python test.wsgi

Then open http://localhost:8000/ on web client.

Apache2 setting

Edit /etc/apache2/apache2.conf and add

#
#  MoinMoin WSGI configuration
#
# you will invoke your moin wiki at the root url, like http://servername/FrontPage:
WSGIScriptAlias /JGWwiki /moinwiki/share/moin/JGWwiki/moin.wsgi



# create some wsgi daemons - use these parameters for a simple setup
WSGIDaemonProcess moin user=www-data group=www-data processes=5 threads=10 maximum-requests=1000 umask=0007

# use the daemons we defined above to process requests!
WSGIProcessGroup moin

Alias /moin_static193/   "/moinwiki/share/moin/htdocs/"

and restart apache

# /etc/init.d/apache2 restart

Install libapache2-mod-wsgi

$ sudo apt-get install libapache2-mod-wsgi

update old data

  1. Copy backup folder of JGWwiki to /moinwiki/share/moin and
  2. Copy backup folder of htdoc to /moinwiki/share/moin
  3. Then,

    # cd /moinwiki/share/moin/JGWiki
    # cp ../config/wikiconfig.py .
    # cp ../server/moin.wsgi .
    # rm moin.cgi
  4. Edit moin.wsgi and add

    sys.path.insert(0, '/moinwiki/share/moin/JGWwiki')
  5. Edit wikiconfig.py and add or replace

    url_prefix_static = '/moin_static193'
    
    sitename = u'JGW Wiki'
    
    logo_string = u'<img src="%s/common/grp07_on.png" alt="JGW Logo">' % url_prefix_static
    
    page_front_page = u"FrontPage"
    
    superuser = [u"XxxxXxxx",u"XxxxXxxx",]
    
    acl_rights_before = u"XxxxXxxx:read,write,delete,revert,admin XxxxXxxx:read,write,delete,revert XxxxXxxx:read,write,delete XxxxXxxx:read,write,delete"
    
    acl_enable = 1
    
    acl_rights_default = u"MemberGroup:read,write All:read"
    
    tz_offset = 9.0
  6. Copy underley to update help or something as

    # cd /moinwiki/share/moin/JGWiki
    # cp -r ../underley .
  7. Update htdocs

    cd Download directly, then

    # cd moin-1.9.3/MoinMoin/web/static
    # cp -r htdocs /moinwiki/share/moin/
    Then copy grp07_on.png to /moinwiki/share/moin/htdocs/common
  8. Ownership and access level change

    $ cd /moinwiki/share
    $ sudo chown -R xxxxxxx:www-data moin
    $ chmod -R ug+rwX moin
    $ chmod -R o-rwX moin
  9. update data using migration script as

    $ cd /usr/local/lib/python2.6/dist-packages/MoinMoin/script$
    $ python moin.py --config-dir=/moinwiki/share/moin/JGWwiki --wiki-url=http://gwwiki.icrr.u-tokyo.ac.jp migration data
    
    2011-04-27 14:54:19,225 WARNING MoinMoin.log:139 using logging configuration read from built-in fallback in MoinMoin.log module!
    2011-04-27 14:54:20,477 INFO MoinMoin.config.multiconfig:127 using wiki config: /moinwiki/share/moin/JGWwiki/wikiconfig.py
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1070200
    Returned. New rev is 1070300.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1070300
    Returned. New rev is 1080000.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1080000
    Returned. New rev is 1080100.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1080100
    Returned. New rev is 1080200.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1080200
    Returned. New rev is 1080300.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1080300
    Returned. New rev is 1080400.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1080400
    Returned. New rev is 1080500.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1080500
    Returned. New rev is 1080600.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1080600
    Returned. New rev is 1080700.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1080700
    Returned. New rev is 1080800.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1080800
    Returned. New rev is 1089999.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1089999
    Returned. New rev is 1090000.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1090000
    Returned. New rev is 1090100.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1090100
    Returned. New rev is 1090200.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1090200
    Returned. New rev is 1090300.
    Calling migration script for /moinwiki/share/moin/JGWwiki/data, base revision 1090300
    Final mig script reached, migration is complete.
  10. Update Language packs by access http://localhost/JGWwiki/LanguageSetup?action=language_setup and pick up Japanese, then press install on the all_pages link (it's the last line in the list). You'll obtain a "Attachment 'Japanese_all_pages.zip installed." message. Then repeat it for English. And restart apache

    /etc/init.d/apache2 restart


To activate basic HTTP authentication

  1. Add following to /moinwiki/share/moin/JGWwiki/wikiconfig.py

    from MoinMoin.auth import GivenAuth
     #   auth = [GivenAuth(autocreate=True, strip_windomain=True, titlecase=True, )]
    auth = [GivenAuth(autocreate=True)]
  2. Edit /etc/apache2/sites-available/default, <Directory /> section to activate .htaccess on ubuntu

    #               AllowOverride None  ## before
                    AllowOverride All   ## after
  3. Make .htaccess at /moinwiki/share/moin/JGWwiki

    AuthUserFile /target_directly/.htpasswd
    AuthGroupFile /dev/null
    AuthName "Please enter your ID and password"
    AuthType Basic
    <Limit GET>
    require valid-user
    </Limit>
  4. Make .htpasswd at target_directly using password producing tool or something.


Redirect to new server

Edit /Applications/MAMP/conf/apache/httpd.conf on old Mac mini server as

#Alias /moin_static172/ "/moinwiki/share/moin/htdocs/"
#<Directory "/moinwiki/share/moin/htdocs">
#    Options Indexes FollowSymLinks
##    AllowOverride None
##    Order allow,deny
##    Allow from all
#    AllowOverride None
#    Order allow,deny
#    Allow from all
#</Directory>

#ScriptAlias /JGWwiki "/moinwiki/share/moin/JGWwiki/moin.cgi"
#<Directory "/moinwiki">
#    Options Indexes FollowSymLinks ExecCGI
##    AllowOverride None
##    Order allow,deny
##    Allow from all
#    AllowOverride None
#    Order allow,deny
#    Allow from all
#</Directory>


#ScriptAlias /LCGTexec "/moinwiki/share/moin/LCGTexec/moin.cgi"
#<Directory "/moinwiki">
#    Options Indexes FollowSymLinks ExecCGI
##    AllowOverride None
##    Order allow,deny
##    Allow from all
#    AllowOverride None
#    Order allow,deny
#    Allow from all
#</Directory>


DocumentRoot "/Applications/MAMP/htdocs"
<Directory />
Redirect /JGWdoc http://gwwiki.icrr.u-tokyo.ac.jp/JGWwiki
</Directory>

DocumentRoot "/Applications/MAMP/htdocs"
<Directory />
Redirect /LCGTexec http://gwwiki.icrr.u-tokyo.ac.jp/LCGTexec
</Directory>


To make multiple wikis

Apache2 setting

Add moin.wsgi of new wikis to /etc/apache2/apache2.conf as

#
#  MoinMoin WSGI configuration
#
# you will invoke your moin wiki at the root url, like http://servername/FrontPage:
WSGIScriptAlias /JGWwiki/Private /moinwiki/share/moin/Private/moin.wsgi
WSGIScriptAlias /JGWwiki /moinwiki/share/moin/JGWwiki/moin.wsgi
WSGIScriptAlias /LCGTexec /moinwiki/share/moin/LCGTexec/moin.wsgi
  1. Copy backup folder of LCGTexec to /moinwiki/share/moin and
  2. Then,

    # cd /moinwiki/share/moin/LCGTexec
    # cp ../config/wikiconfig.py .
    # cp ../server/moin.wsgi .
    # rm moin.cgi
  3. Edit moin.wsgi and add

    sys.path.insert(0, '/moinwiki/share/moin/LCGTexec')
  4. Edit wikiconfig.py and add or replace

    url_prefix_static = '/moin_static193'
    
    sitename = u'LCGT exexutive Wiki'
    
    logo_string = u'<img src="%s/common/grp07_on.png" alt="JGW Logo">' % url_prefix_static
    
    page_front_page = u"FrontPage"
    
    superuser = [u"XxxxXxxx",u"XxxxXxxx",]
    
    acl_rights_before = u"XxxxXxxx:read,write,delete,revert,admin XxxxXxxx:read,write,delete,revert"
    
    acl_enable = 1
    
    tz_offset = 9.0
  5. Copy underley to update help or something as

    # cd /moinwiki/share/moin/LCGTexec
    # cp -r ../underley .
  6. Ownership and access level change

    $ cd /moinwiki/share
    $ sudo chown -R xxxxxxx:www-data moin
    $ chmod -R ug+rwX moin
    $ chmod -R o-rwX moin
  7. update data using migration script as

    $ cd /usr/local/lib/python2.6/dist-packages/MoinMoin/script
    $ python moin.py --config-dir=/moinwiki/share/moin/LCGTexec --wiki-url=http://gwwiki.icrr.u-tokyo.ac.jp migration data

    and restart apache

    # /etc/init.d/apache2 restart
  8. Update Language packs by access http://localhost/LCGTexec/LanguageSetup?action=language_setup and pick up Japanese, then press install on the all_pages link (it's the last line in the list). You'll obtain a "Attachment 'Japanese_all_pages.zip installed." message. Then repeat it for English. And restart apache

    # /etc/init.d/apache2 restart


wiki farm

Making Private wiki as one of wikifarm. This is because to share user accounts and passwords as JGWwiki.

  1. Copy farmconfig.py, mywiki.py

    mkdir /moinwiki/share/moin/Private
    cd /moinwiki/share/moin/Private
    cp ../config/wikifarm/farmconfig.py .
    cp ../config/wikifarm/mywiki.py Private.py
    cp ../server/moin.wsgi .
    cp -r ../data .
    cp -r ../underlay .
  2. Edit farmconfig.py as

    wikis = [
    
        # wikiname, url regular expression
        # ---------------------------------------------------------------
        #("JGWwiki", r".*"),   # this is ok for a single wiki   ### comment out this line at 45
    
        # for multiple wikis, do something like this:
        #("wiki1", r"^http://wiki1\.example\.org/.*$"),
        #("wiki2", r"^https?://wiki2\.example\.org/.*$"),
        ("Private", r"^http://localhost/JGWwiki/Private/.*$"), # order must be Private -> JGWwiki
        #("JGWwiki", r"^http://localhost/JGWwiki/.*$"),
    ]

    and add these lines at the end.

        url_prefix_static = '/moin_static193' # static stuff like logo and themes will be searched there
    
        logo_string = u'<img src="%s/common/grp07_on.png" alt="JGW Logo">' % url_prefix_static
    
    
        user_dir = '/moinwiki/share/moin/JGWwiki/data/user' # user folder
  3. Edit .../Private/moin.wsgi as

    sys.path.insert(0, '/moinwiki/share/moin/Private')
  4. Add these lines at the end of .../Private/Private.py

        page_front_page = u"FrontPage"
    
        data_dir = '/moinwiki/share/moin/Private/data/'
        data_underlay_dir = '/moinwiki/share/moin/Private/underlay'
  5. Edit /etc/apache2/apache2.conf as

    #
    #  MoinMoin WSGI configuration
    #
    # you will invoke your moin wiki at the root url, like http://servername/FrontPage:
    
    #WSGIScriptAlias /JGWwiki/Private /moinwiki/share/moin/moin.wsgi
     WSGIScriptAlias /JGWwiki/Private /moinwiki/share/moin/Private/moin.wsgi
    
     WSGIScriptAlias /JGWwiki /moinwiki/share/moin/JGWwiki/moin.wsgi
     #WSGIScriptAlias /JGWwiki /moinwiki/share/moin/moin.wsgi
    
     WSGIScriptAlias /LCGTexec /moinwiki/share/moin/LCGTexec/moin.wsgi
  6. Copy .htaccess to /moinwiki/share/moin/Private/, and note that this file should be -rw-r--r--. Remove .htaccess from /moinwiki/share/moin/ and /moinwiki/share/moin/JGWwiki/
  7. Restart apache

    # /etc/init.d/apache2 restart