Create A Desktop Wiki

Fast

MoinMoin versions
1.9.8
Platforms
Linux and other POSIX

The purpose of this page is to outline a very easy way to get up and running with a desktop wiki. This could be useful for a number of use-cases including, an experimental wiki for newcomers, a development instance for preliminary setup, a personal organization framework, et al. The main thing to remember about this instruction, is that THERE IS NO CONSIDERATION FOR NETWORK SECURITY outside of the localhost domain on your own computer.

Steps to be fleshed out below:

  1. Take stock of your system;
  2. Create a virtual python environment;
  3. Use pip to install moin from PyPi;

  4. Likewise, use pip to install mod_wsgi from PyPi;

  5. Complete a trivial configuration to run moin using mod_wsgi-express.

Graham Dumpleton recommends mod_wsgi-express to run a wsgi application with Apache from within a Docker container.

Step 1

Similar steps should be available on Windows. I am testing this procedure on CentOS 7.6. In any case you must have a Python 2.7 interpreter on your system.

Ancillary to the Python on your system, you must have pip. This should already be the case, but to make sure open a command line terminal and type $pip -V.

Your system must also have Virtualenv. Again, just to make sure, on the command line type $virtualenv --version. This command should return a version number like 16.1.0. Hey, we have pip, right? If you don't have Virtualenv, you can get it with pip.

Step 2

Now that required things are in place on your computer, you must determine a directory for moin. This most definately should be in your /home/you/ directory. It is not advisable or useful to use root;system;admin authority for this setup.

Within that directory we will create a virtual Python environment. This will be separate from your system or global Python environment so we can not muck it up. If you muck this virtual one up, just recursively delete everything in this directory and start over. Create the virtual environment now by typing $virtualenv ENV on your command line.

You will notice this created a new directory named ENV. The name ENV could be anything, no matter. You might go ahead and change into the ENV directory and take note of the contents.

Step 3

You are now inside a python virtual environment, except, wait, we need to turn the lights on. Do this by typing the command $source bin/activate. Of course the current working directory should contain bin/ directory. At any time use $deactivate or just close the terminal.

The environment has its own pip installer. It can not hurt to ask pip to upgrade itself to recent version. Type $pip install --update pip.

Step 4

Use $pip install mod_wsgi now!

Step 5

Yay! We are getting close. We have everything we need except for one tweek to moin's default configuration.

Pip created a new directory structue share/moin/ in the current directory but not for mod_wsgi. Both moin and mod_wsgi files are in your virtual python files in lib/python2.7/site-packages/, but we should not have to touch them. Go ahead and descend into share/moin/. Therein are four directories that will hold contents of your wiki.

We will need to make this share/moin/ directory our instance directory. But first, copy the config/wikiconfig.py file into the server/ directory and change into the server/ directory.

We need to run two tests to check our progress. TEST 1: issue this command: $mod_wsgi-express start-server. You should see some details for the server running in the foreground. Point your browser at the Server URL, you will see an enticing bottle of spirits.

Stop the server in your terminal with $ctrl-C. TEST 2: issue this command: $mod_wsgi-express start-server test.wsgi. When you refresh/restart your browser, you should see a test page courtesy of moin developers.

We must change one line in wikiconfig.py you copied into the share/moin/server/ directory. So open this file in some kind of plain text editor. And comment out (line 48?) where instance_dir is equated with wikiconfig_dir. In its stead equate instance_dir with a string representation of the full and absolute path into moin. In other words, instance_dir = "/home/you_or_wherever_you_chose_in_Step_2/ENV/share/moin". Can't go wrong here!

And voila! When you restart the mod_wsgi-express server, although this time using the moin.wsgi server script instead of test.wsgi, and refresh/restart your browser you will be welcome to moin. Enjoy!

Finishing Touch (Optional)

The following shell script, on POSIX, will start things off including a call to your default browser to run the wiki (you must make this file executable by the user):

And to create a free desktop short-cut, you must, first find a suitable icon to use as the short-cut 'click-me'. A good place to look is in the ENV/lib/python2.7/site-packages/MoinMoin/web/static/htcocs/ directory. I'd use one of the .png's, but you have to remember the path, so feel free to copy it to anywhere more convenient.

To create a .desktop file so your desktop recognizes your short cut to Moin, change into your $HOME/.local/share/applications/ directory. Open a plain text editor here, calling the file <whatever>.desktop. And type in the following:

It all works for me! I hope it does for you too. In order for things to click, you might want to log-out and log-on again.

MoinMoin: HowTo/ModWsgiExpress (last edited 2019-01-14 20:59:43 by DougEpling)