how to install a personal wiki on debian squeeze

this will install a wiki that listens only on localhost.

  • install the apache and moinmoin packages

    apt-get install python-moinmoin python apache2
  • create user and group wiki:

    groupadd -g 300 wiki
    useradd -u 300 -g 300 -m wiki    # this also creates /home/wiki
    passwd wiki
  • copy files to the new home directory:

    ** sudo cp -a /usr/share/moin/{data,underlay,htdocs} /home/wiki
    ** sudo cp /usr/share/moin/config/wikiconfig.py /home/wiki
    ** mkdir /home/wiki/cgi /home/wiki/htdocs
    ** cp /usr/share/moin/server/moin.cgi /home/wiki/cgi
  • fix ownership:

    chown -R dave:www-data /home/wiki
    chmod -R ug+rw /home/wiki
    chmod -R o-w /home/wiki
  • edit the following variables in /etc/moin/mywiki.py:

    sitename          : whatever, eg., MyWiki
    interwikiname     : " "
    page_front_page   : whatever, eg., FrontPage
    data_dir          : /home/wiki/data/           # note trailing slash
    data_underlay_dir : /home/wiki/underlay/       # note trailing slash
    url_prefix_static = /static/
  • configure apache - create /etc/apache2/conf.d/wiki:

cat >/etc/apache2/conf.d/wiki <<EOM
Alias /static/ "/home/wiki/htdocs/"
ScriptAlias /wiki "/home/wiki/cgi/moin.cgi"
<Directory /home/wiki>
  Options Indexes FollowSymLinks MultiViews
  AllowOverride None
  Order allow,deny
  allow from all
</Directory>
<Directory /home/wiki/cgi>
  Options None
  AllowOverride None
  Order allow,deny
  allow from all
  Options +ExecCGI
</Directory>
EOM
  • restart apache

    sudo /etc/init.d/apache2 restart