1

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.

Corey Farwell
  • 135
  • 1
  • 9

3 Answers3

1

The moinmoin/uWSGI example has been updated to include suburi configuration

http://projects.unbit.it/uwsgi/wiki/Example#MoinMoinonlinenow

roberto
  • 1,812
  • 12
  • 8
0

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

Alex
  • 7,789
  • 4
  • 36
  • 51
  • That only changes the prefix of the static files. If I click on an internal link to a different wiki page, it still takes me to **/WikiPage** instead of **/wiki/WikiPage** – Corey Farwell Sep 01 '11 at 19:51
  • Oh, I see. You should also change `WSGIScriptAlias / /path/to/your/moin.wsgi` to `WSGIScriptAlias /wiki /path/to/your/moin.wsgi` in your Apache config. – Alex Sep 01 '11 at 19:56
  • I'm using nginx, not Apache – Corey Farwell Sep 01 '11 at 20:57
  • Try to add `uwsgi_param SCRIPT_NAME /wiki;` to your `location` section – Alex Sep 01 '11 at 21:03
  • So now the content is linked correctly, but the static content doesn't work. What should I set for `url_prefix_static`? No matter what I put it seems to think it's a wiki page. Also, what does `uwsgi_param SCRIPT_NAME /wiki;` even do? – Corey Farwell Sep 01 '11 at 21:21
0

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

Lucas Kauffman
  • 16,818
  • 9
  • 57
  • 92