Moin with Nginx + Passenger + wsgi Contents
Contents
Motivation
This is a recipe for installing MoinMoin on Webfaction using Nginx and wsgi (and not apache). We had problems running some Moin extensions built with amara, so we decided migrate our wiki to Nginx. We had other problem. System python on webfaction is UCS2 and we preffer UCS4 built.
Auxiliar docs
Install new python
$ wget http://python.org/ftp/python/2.6.5/Python-2.6.5.tgz $ tar zxvf Python-2.6.5.tgz $ cd Python-2.6.5 $ ./configure --prefix=$HOME --enable-unicode=ucs4 $ make; make install
Install pip
$ wget http://pypi.python.org/packages/source/p/pip/pip-0.7.1.tar.gz $ tar ... $ ~/bin/python setup.py install
Install amara, python-dateutil, html5lib, moin
$ ~/bin/pip install http://files.akara.info/00-amara-latest.tar.bz2 $ ~/bin/pip install python-dateutil $ ~/bin/pip install html5lib $ ~/bin/pip install moin
Create the ngingx app
- Create a new 'Passenger 2.2.8 (ngingx 0.7.64/Ruby Enterprise Edition 1.8.7)' app in the control panel.
In this example, the app is named moinnginx
- Add the new app to a site.
Configure moin
$ cd ~/webapps/moinginx $ mkdir -p wiki/public
Edit ~/webapps/moinginx/wiki/passenger_wsgi.py as follow (change relevant paths):
1 # -*- coding: iso-8859-1 -*-
2
3 import sys, os
4
5 INTERP = '/home/lmorillas/bin/python2.6' # base python
6 if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)
7 sys.path.insert(0,'/home/lmorillas/lib/python2.6')
8
9 # a2) Path of the directory where wikiconfig.py / farmconfig.py is located.
10 # See wiki/config/... for some sample config files.
11 sys.path.insert(0, '/home/lmorillas/webapps/moinginx/config')
12
13 from MoinMoin.web.serving import make_application
14
15 # Creating the WSGI application
16 application = make_application(shared='/home/lmorillas/webapps/moinginx/htdocs')
17
- copy htdocs folder
configure wikiconfig.py
Configure passenger start
$ sed -i -e 's/hello_world/wiki/' nginx/conf/nginx.conf $ ./bin/restart
