Skip to content

Instantly share code, notes, and snippets.

@mysteriouspants
Created January 8, 2014 20:20
Show Gist options
  • Select an option

  • Save mysteriouspants/8323885 to your computer and use it in GitHub Desktop.

Select an option

Save mysteriouspants/8323885 to your computer and use it in GitHub Desktop.

Install MoinMoin they said! It'll be easy they said!

Laundry Room Viking

apt-get install -y nginx uwsgi{,-plugin-python,-emperor}
wget http://static.moinmo.in/files/moin-1.9.7.tar.gz
tar xzvf moin-1.9.7.tar.gz
cd moin-1.9.7.tar.gz
python setup.py install --force --prefix=/usr/local --record=install.log
mkdir -p /var/www/staff-wiki
cp /usr/local/share/moin/server/moin.wsgi /var/www/staff-wiki/staff-wiki.wsgi
cp /usr/local/share/moin/config/wikiconfig.py /var/www/staff-wiki/wikiconfig.py
vim /var/www/staff-wiki/staff-wiki.wsgi
  # after the a1) section add the following:
  sys.path.insert(0, '/usr/local/lib/python2.7/dist-packages')
  # after the a2) section add the following:
  sys.path.insert(0, '/var/www/staff-wiki')
  # at the end of the file
  application = make_application(shared=False)
vim /var/www/staff-wiki/wikiconfig.py
  # change url_prefix_static
  url_prefix_static = '/staff-wiki' + url_prefix_static
vim /var/www/staff-wiki/uwsgi.xml
  <uwsgi>
    <uid>www-data</uid>
    <gid>www-data</gid>
    <plugin>python</plugin>
    <socket>/var/tmp/staff-wiki.sock</socket>
    <wsgi-file>/var/www/staff-wiki/staff-wiki.wsgi</wsgi-file>
    <limit-as>256</limit-as>
    <processes>2</processes>
    <logto>/var/log/uwsgi/staff-wiki.log</logto>
    <memory-report/>
    <vhost/>
    <no-site/>
  </uwsgi>
vim /etc/init/staff-wiki.conf
  description "staff-wiki moin uwsgi service"

  start on runlevel [2345]
  stop on runlevel [!2345]

  chdir /var/www/staff-wiki/
  exec uwsgi -x /var/www/staff-wiki/uwsgi.xml
  respawn
cp -R /usr/local/share/moin/data /var/www/staff-wiki/data
cp -R /usr/local/share/moin/underlay/ /var/www/staff-wiki/underlay
chown -R www-data:www-data /var/www/
chmod -R ug+rwX,o-rwx /var/www/
start staff-wiki
vim /etc/nginx/sites-available/something...
  location /staff-wiki/moin_static197 {
    alias /usr/local/lib/python2.7/dist-packages/MoinMoin/web/static/htdocs;
  }
  location /staff-wiki {
    include uwsgi_params;
    uwsgi_param SCRIPT_NAME /staff-wiki;
    uwsgi_pass unix:///var/tmp/staff-wiki.sock;
    uwsgi_modifier1 30;
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment