Redmine on Apache 2.4 using uWSGI

If you haven’t worked with uWSGI yet for setting up applications of different kinds – let me tell you it’s a Swiss knife. It supports applications written in Python, Ruby, PHP, Perl and recently Java and Go too.

One tool to run a lot of stuff – that means life is easier if you’re on the managing side of the system.

uWSGI has a module for Apache, which works with both 2.4 and 2.2. Redmine as you might be already knowing is a very good project management application (find out more about it on redmine.org).

The basic installation procedure, can be found in official Redmine documentation at redmine.org. I’ll post how I managed to get things working with Apache 2.4 using uWSGI.

Firstly, I’m using Gentoo on the server, my uWSGI is installed with Python, Ruby enabled.

This is the configuration in /etc/conf.d/uwsgi

Basically it’s instructing uWSGI init script to launch it in Emperor mode (used to host multiple apps at the same time).

Now configuration for the redmine vassal /etc/uwsgi.d/redmine.ini :

Above configuration launches 8 processes when a connection is received to the socket and terminates them when it’s inactive for 1 hour, pretty enough for a low traffic site.

The plugins line says 0:rack_ruby19 , this is to avoid setting uWSGI modifier in Apache configuration. Without that line, you need to set uWSGI modifier in Apache configuration [and I don’t know what is that, see docs :P].

Apache configuration:

Initially I tried many workarounds like FallbackResource, using mod_fastcgi (and setting up uWSGI to listen on a fastcgi socket), also RewriteRules, but nothing seemed to work good.

The thing is, we need to set the uwsgi-handler for all pages that do not exist in document root. This thing is probably less seen, I found it in Apache docs by accident and now this is rolling.[/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]

Advertisements

Have something to add? Do it here.

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑

%d bloggers like this: