Arch Linux + lighttpd + Mono == ASP.NET MVC 3

I had a time getting my cheap linux box hosting configured to host my ASP.NET MVC 3 application. These notes are how I got it working using mono 2.6.10 on my Arch Linux 200510

In this example I setup a directory to host my application (I will get to what files and how later) I placed these files in the ‘/srv/http/mysite’ folder.

1. Install mono, lighttpd and fcgi on the box

2. Setup lighttpd to use FastCGI edit the ‘/etc/lighttpd.conf’ file and modify this line;

3. Add this line to the end of your ‘/etc/lighttpd.conf’ file;

4. Put this into your ‘/etc/lighttpd/fastcgi.conf’ file;

5. Put this in your ‘/etc/lighttpd/mono.conf’ file;

Make sure you didn’t fat monkey up the conf files by doing this;

Should return a “OK”

Now go into your ASP.NET MVC app and setup the references to be “Copy Local” True on these assemblies (if you don’t have the assembly reference by the project add it, you might need to look in “Assemblies -> Extensions” to find some of these) ;

Make sure you DO NOT have the Microsoft.Web.Infrastructure.dll file, it doens’t work with Mono and causes errors.

Now just publish your project to a folder somewhere, then go into that folder and get the entire contents to the ‘/srv/http/mysite’ folder. Sure you can setup FTP and all that fanciness but I just use WinSCP and copy directly from my publish folder into the ‘/srv/http/mysite’ folder.

Now start lighttpd on the box and you should have the joy of ASP.NET MVC 3.

Enjoy!

References;

http://www.mono-project.com/Release_Notes_Mono_2.10#ASP.NET_MVC3_Support
http://redmine.lighttpd.net/wiki/1/Docs:Configuration
https://wiki.archlinux.org/index.php/Lighttpd
http://www.mono-project.com/FastCGI_Lighttpd