The other day I was trying to get started with Mono using ASP.NET MVC. As usual I googled and found a useful post on it http://beyondfocus.com/mono/asp-net-mvc-on-mono-two-options-for-the-ide-crowd/ . But, the post assumes you already know how to deploy an asp.net app on Mono. Anyway here is my attempt to make it easier for folks to hop onto Mono.
Alright, so all I am trying to do here is get the ASP.NET MVC 1.0 default template up and running on Mono. There are a few things you need, to get this working:
- You need to download a Virtual Machine image from http://www.go-mono.com/mono-downloads/download.html OR install Mono 2.4, apache, mono_mod, and xsp if you already have a linux machine up and running.
- Visual Studio with ASP.NET MVC 1.0 installed.
Now, once you have these pre-requisites,
- Fire up your vs and create a new ASP.NET MVC 1.0 project. Change whatever text you want to in the template, Here is how mine looks on my machine:
- Publish this application to a folder, say d:\binaries\mono_mvc. and then copy it to your Mono linux machine, copy it to the /srv/www/ folder.
- Once you’ve done that, head over to the
http://go-mono.com/config-mod-mono/ to create your mod_mono configuration file. Fill out all the necessary details and click on the
Download button to download your newly configuration file.
- Copy this new configuration file to the /etc/apache2/conf.d/ directory on your linux machine.
- The last thing you need to do is restart your apache server
- Now you can browse to http://localhost/<your_application_name> to see your asp.net mvc application in it’s full glory :)
This is obviously a contrived example, but you can see how easy it is to deploy an asp.net mvc application to a linux box running apache and Mono. This is no more complicated than deploying a web app on a Windows box, and all props go to the Mono guys for making Mono easier to use with every release. I hope to dive in deeper into Mono real soon and I’ll share my experiences with you guys.