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

The basic installation procedure, can be found in official Redmine documentation at 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 <If> thing is probably less seen, I found it in Apache docs by accident and now this is rolling.

Is Flipkart tracking people on Twitter?

Wondering if Flipkart associates your Twitter account and Flipkart account internally (since there’s no such option visible to me on their site).

I had tweeted in the morning about getting a laptop, and later I get an email from Flipkart advertising HP Laptops.

What I tweeted:


The mail later today:


Since there’s no way to get your email address on Twitter directly, I guess they do this when you interact with them on Twitter.

I have interacted with them in past via Twitter also I’m not the first one to see such a thing.

The move from Linux to FreeBSD

About 2 months ago, I had a spare VPS at my host, Hetzner. So I decided to play with FreeBSD which was being offered for Hetzner servers and VPSes.
That’s how the whole thing started. I didn’t have much problems getting the concepts because it belongs to *nix family of OSes and I have been a pure Linux user since 2008.

First of all the basic difference between FreeBSD and GNU/Linux is that Linux is just the kernel and GNU is the userland. In layman’s terms, the hardware interface is called Linux, while the rest of the part: the shell, core tools, etc are GNU.It’s a piece from there, another from somewhere else and merging the whole thing into one collectively known as GNU/Linux. Linux itself cannot boot without GNU and GNU will not work without Linux (Yes, there is a GNU kernel project called GNU Hurd, but I don’t how far that went).
In FreeBSD, the whole thing is a complete unit. FreeBSD was derived from the original AT&T Unix and open sourced. You can read more about the differences at over-yonder.

Continue reading

Securing FreeBSD server with Fail2Ban and IPFW

I’ve been playing with a FreeBSD machine for a while now and my primary server now runs FreeBSD :D
So I came across this problem: installing Fail2Ban with IPFW.

FreeBSD has three different firewalls, so it’s difficult for any upstream application to decide on what kind of setup it should advocate. There is no one-size-fits-for-all. I read about various firewalls, and since I wanted to stick with FreeBSD only, I decided to use IPFW.

Continue reading