Posted on Monday April 22, 2013

Installing MVC3 on Mono with Ubuntu

I managed to get the wiki engine I spend a lot of more spare time writing, Roadkill working on Ubuntu with Mono this weekend. Unfortunately for me, a lot of the documentation is patchy which meant it took a few hours to get it up and running by scouring Stackoverflow, blogs and news groups. It is infact very simple to get MVC3 working with Apache on Linux, provided you have the right Apache config settings and are willing to add a few hacks into your code to cater for the gaps (NotImplementedExceptions) in the Mono framework.

Below are two snippets for getting Mono and MVC3 going with Ubuntu. The majority of the credit goes to:

Copy the second snippet into /var/www/default.txt and save the first snippet as “install.sh” into your user directory, running it using “sudo sh install.sh”. The full Roadkill bash script can be found here. I started making EC2 AMIs for the installation, and then found a few issues that made me eventually abandon my dreams of a cheap $5 Roadkill Ubuntu server, as it would be a lot of effort maintaining both Windows and Mono tests for Roadkill.

Don’t take that as criticism of Mono + MVC3 though - Roadkill does a lot with the framework that most apps wouldn’t. If you are running data-driven MVC apps, then using a database like MongoDB would work very well with Mono on Ubuntu.