Python and mod_wsgi alongside Virtualmin

I’m building a simple web application using the Python framework and looking to deploy it on my Ubuntu server running Virtualmin. The docs ( recommend using mod_wsgi, and I was wondering if Virtualmin can help me install this, or if there are any other special considerations I should be wary of? I know there’s a Django install script – can that take care of anything?

TLDR: What’s the best way to get Python/mod_wsgi apps running on Virtualmin?


Well, I’m not familiar with mod_wsgi, but it appears to be simple to get that installed on Ubuntu.

You should be able to do that by installing the libapache2-mod-wsgi package. You can use the Webmin package installer to do it, or you could just run this command as root:

apt-get install libapache2-mod-wsgi

I’m not aware of any problems that would cause – but if it does happen to cause any, you can just disable or remove the module.


Thanks Eric – helpful as always :slight_smile:

I get scared about installing thing that interfere with Apache on Virtualmin systems for fear of breaking it in obscure ways, but you’ve somewhat reassured me.

It looks like I’ll need to edit the vhosts file though. So long as I do this properly, it shouldn’t upset Virtualmin, right?



The first thing I’d do is to try installing that new module, and then to restart Apache.

If everything continues to work properly at that point, I would then add the configuration you need for you domain(s) to the Apache config.

At that point, if you then run into any problems, you know it was the config lines that were added – and you can either work on correcting them, or just comment it out, to restore things to working order.