|
Size: 3243
Comment:
|
Size: 2641
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| MoinMoin is a wiki software. Version 1 (current release) runs on Python 2 with vendored dependencies, a complex plugin ecosystem, and no plan for security support. Version 2 (unstable) runs on Python 3 with the Flask ecosystem. | !MoinMoin is a wiki software. Version 1 (current release) runs on Python 2 with vendored dependencies, a complex plugin ecosystem, and no plan for security support. Version 2 (unstable) runs on Python 3 with the [[Python/Flask|Flask]] ecosystem. |
| Line 11: | Line 11: |
| == Server Setup == | == Installation == |
| Line 13: | Line 13: |
| MoinMoin requires a running web server with uWSGI. The below walkthrough uses NGINX and skims over security and configuration details. | The source files for !MoinMoin are available for download [[http://static.moinmo.in/files|here]]. |
| Line 17: | Line 17: |
| === NGINX === | === Prerequisites === |
| Line 19: | Line 19: |
| Create a server location that passes into the MoinMoin socket. then enable and start the NGINX service. | !MoinMoin requires a uswgi (the protocol) server. See [[UWSGI|here]] for details on running `uWSGI` (the server), and [[Python/UWSGI|here]] for details on configuring the Python plugin. |
| Line 21: | Line 21: |
| {{{ server { listen 80 default_server; |
!MoinMoin 1 has a complicated dependency structure and runs in the unsupported Python 2 runtime. To insulate the instance, it should ''at minimum'' be installed inside a virtual environment. See [[Python/Virtualenv|here]] for details on installing `virtualenv`. |
| Line 25: | Line 23: |
| access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; location / { include /etc/nginx/uwsgi_params; uwsgi_pass unix:///var/www/moin/moin.sock; uwsgi_modifier1 30; } } }}} Often, uWSGI apps recommend adding `uwsgi_modifier1 30` to rewrite PATH_INFO and SCRIPT_NAME. This is a deprecated measure, and is unstable for Python 3+. Instead, [[UWSGISetup|configure uWSGI]]. |
Alternatively, consider running the !MoinMoin inside a [[Docker|Docker container]]. |
| Line 40: | Line 27: |
| === Let's Encrypt === | === Virtual Environment === |
| Line 42: | Line 29: |
| === uWSGI === | Unpack the !MoinMoin tarball into a fresh directory, such as `/app/example.com`. Move into that directory, instantiate a virtual environment, and activate it now. Run `python ./steup.py install`. For `systemd(1)`-capable systems, [[Linux/Systemd|create, start, and enable]] the following service file: |
| Line 45: | Line 34: |
| sudo apt install uwsgi uwsgi-plugin-python | [Unit] Description=Start uwsgi for MoinMoin wiki After=network.target [Service] Type=simple User=www-data ExecStart=/usr/bin/uwsgi --ini /app/example.com/wiki/uwsgi.ini [Install] WantedBy=multi-user.target |
| Line 47: | Line 46: |
=== Container === |
|
| Line 52: | Line 58: |
| == MoinMoin Setup == | == Configuration == |
| Line 54: | Line 60: |
| === Python Dependencies === | |
| Line 56: | Line 61: |
| To insulate the MoinMoin instance from the wider web server, it should be installed inside a virtual environment. | === Preparing to Run === !MoinMoin expects a specific directories and scripts. Unpack these from the downloaded package. |
| Line 59: | Line 67: |
| sudo apt install python-pip sudo pip install virtualenv sudo virtualenv /var/www/moin/pythonenv |
cp -r /tmp/wiki /app/example.com cp /tmp/config/wikiconfig.py /app/example.com/wiki/ cp /tmp/server/moin.wsgi /app/example.com/wiki/ |
| Line 64: | Line 72: |
| MoinMoin and its dependencies can now be installed safely. {{{ #download cd /tmp wget http://static.moinmo.in/files/moin-1.9.10.tar.gz tar zxvf moin-1.9.10.tar.gz cd ./moin-1.9.10 #install source /var/www/moin/pythonenv/bin/activate python ./setup.py install }}} === Configuration === Unpack key directories and files from the installed MoinMoin package. {{{ cp -r /tmp/wiki /var/www/moin cp /tmp/config/wikiconfig.py /var/www/moin/wiki/ cp /tmp/server/moin.wsgi /var/www/moin/wiki/ }}} Insert the below into `wikiconfig.py`, after `import os` but before `from MoinMoin.config import multiconfig, url_prefix_static`. |
Insert the below into `wikiconfig.py` after `import os` but before `from MoinMoin.config import multiconfig, url_prefix_static`. |
| Line 92: | Line 76: |
| sys.path.insert(0, '/var/www/moin/pythonenv/lib/python2.7/site-packages/') sys.path.insert(0, '/var/www/moin/wiki/') |
sys.path.insert(0, '/app/example.com/.venv/lib/python2.7/site-packages/') sys.path.insert(0, '/app/example.com/wiki/') |
| Line 102: | Line 86: |
| socket = /var/www/moin/moin.sock chmod-socket = 660 |
socket = :9000 |
| Line 106: | Line 89: |
| chdir = /var/www/moin/wiki wsgi-file = /var/www/moin/wiki/moin.wsgi |
chdir = /app/example.com/wiki wsgi-file = /app/example.com/wiki/moin.wsgi |
| Line 118: | Line 101: |
| === Permissions === | === Running the First Time === |
| Line 120: | Line 103: |
| You know you'll have permissions errors eventually. Preempt them. {{{ chown www-data:www-data -R /var/www/moin chmod g+w,o-rwx -R /var/www/moin }}} === Service File === Create a service file at `/etc/systemd/system/moinmoin.service`. It should call uWSGI with the configuration we just setup. {{{ [Unit] Description=Start uwsgi for MoinMoin wiki After=network.target [Service] Type=simple User=www-data ExecStart=/usr/bin/uwsgi --ini /var/www/moin/wiki/uwsgi.ini [Install] WantedBy=multi-user.target }}} Enable and start the service, and enjoy your wiki! |
Follow the on-screen instructions to setup a superuser, install language packs or add-ons, and set the front page. |
MoinMoin
!MoinMoin is a wiki software. Version 1 (current release) runs on Python 2 with vendored dependencies, a complex plugin ecosystem, and no plan for security support. Version 2 (unstable) runs on Python 3 with the Flask ecosystem.
Contents
Installation
The source files for !MoinMoin are available for download here.
Prerequisites
!MoinMoin requires a uswgi (the protocol) server. See here for details on running uWSGI (the server), and here for details on configuring the Python plugin.
!MoinMoin 1 has a complicated dependency structure and runs in the unsupported Python 2 runtime. To insulate the instance, it should at minimum be installed inside a virtual environment. See here for details on installing virtualenv.
Alternatively, consider running the !MoinMoin inside a Docker container.
Virtual Environment
Unpack the !MoinMoin tarball into a fresh directory, such as /app/example.com. Move into that directory, instantiate a virtual environment, and activate it now. Run python ./steup.py install.
For systemd(1)-capable systems, create, start, and enable the following service file:
[Unit] Description=Start uwsgi for MoinMoin wiki After=network.target [Service] Type=simple User=www-data ExecStart=/usr/bin/uwsgi --ini /app/example.com/wiki/uwsgi.ini [Install] WantedBy=multi-user.target
Container
Configuration
Preparing to Run
!MoinMoin expects a specific directories and scripts. Unpack these from the downloaded package.
cp -r /tmp/wiki /app/example.com cp /tmp/config/wikiconfig.py /app/example.com/wiki/ cp /tmp/server/moin.wsgi /app/example.com/wiki/
Insert the below into wikiconfig.py after import os but before from MoinMoin.config import multiconfig, url_prefix_static.
import sys sys.path.insert(0, '/app/example.com/.venv/lib/python2.7/site-packages/') sys.path.insert(0, '/app/example.com/wiki/')
Create a new file, uwsgi.ini.
[uwsgi] uid = moin gid = www-data socket = :9000 plugin = python chdir = /app/example.com/wiki wsgi-file = /app/example.com/wiki/moin.wsgi master workers = 3 max-requests = 200 harakiri = 60 die-on-term
Running the First Time
Follow the on-screen instructions to setup a superuser, install language packs or add-ons, and set the front page.
