2

I just set up uWSGI and nginx (with the uWSGI module) and would like to get MoinMoin set up. I'm running uWSGI with MoinMoin with the command below:

/usr/bin/uwsgi -s moin.sock --wsgi-file wiki/server/moin.wsgi -M -p 4

In nginx, I have it set up like this:

location / {
   uwsgi_pass unix:///mnt/moin/moin.sock;
   include uwsgi_params;
}

If I wanted MoinMoin to run on the root of my server, this would work fine, but I want my MoinMoin to run on /wiki rather than /. I changed my nginx config to reflect this:

location /wiki {
   uwsgi_pass unix:///mnt/moin/moin.sock;
   include uwsgi_params;
}

After restarting both server, the links in MoinMoin still want to go to /PageName rather than /wiki/PageName. I would think I would have to specify a setting in MoinMoin. I saw there is a url_prefix_static option for wikiconfig.py, but am not sure if that is deprecated or if there is a better way of doing this.

3 Answers3

1

The MoinMoin/uWSGI example has been updated* to include sub-URI configuration:

you can mount it on a subdir (example: /wiki) with:

uwsgi -s /tmp/moin.sock --mount /wiki=wiki/server/moin.wsgi -M -p 4

then change your apache config

<Location /wiki>
    SetHandler uwsgi-handler
    uWSGISocket /tmp/moin.sock
</Location>

or nginx

location /wiki {
    include uwsgi_params;
    uwsgi_param SCRIPT_NAME /wiki;
    uwsgi_modifier1 30;
    uwsgi_pass unix:/tmp/uwsgi.sock;
}

*Formerly at http://projects.unbit.it/uwsgi/wiki/Example#MoinMoinonlinenow, retrieved from the Wayback Machine archive. Note that the --wsgi-file in the linked example is no longer supported with current versions of uwsgi.

Kevin E
  • 155
  • 9
roberto
  • 1,877
0

According to this howto url_prefix_static is the official way for doing this.

Alex
  • 8,089
0

The sample wikiconfig.py shows how to fix url_prefix_static for non-root-URL wikis.