Wednesday, August 27, 2008

Cloud Computing: Mono Setup on Amazon EC2

Mono Setup on Amazon EC2 with optional config for MonoRail

Prerequisites: Familiar with create and launching instances using Amazon EC2, and familiar with editing config files in linux.

Links to documentation on Amazon EC2 and how to create and launch instances:

http://developer.amazonwebservices.com/connect/kbcategory.jspa?categoryID=84

click on Technical documentation link.

For porting application to Mono see article:
http://www.mono-project.com/Guide:_Porting_ASP.NET_Applications

1) Create Ami instance from pre-existing instance and launch instance.

Use ami-0abe5a63, see url: http://www.nonhostile.com/mono-on-amazon-ec2.asp

url: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1616&categoryID=101

2) Update Apache on this instance. This instance is a Fedora 8 image with Apache

Edit /etc/httpd/conf/httpd.conf

Add these entries to the end to use test app from mono:

MonoServerPath default /opt/mono-1.9.1/bin/mod-mono-server2

Alias / “/opt/mono-1.9.1/lib/xsp/test”

AddMonoApplications default “/:/opt/mono-1.9.1/lib/xsp/test”

<Location />

MonoSetServerAlias default

SetHandler mono

<Location />

Here is other entry example (notice using MonoApplications instead of AddMonoApplications)

(not sure why examples differ), but both syntax work:

Alias hellomonoweb “/opt/mono-1.9.1/lib/xsp/hellomonoweb”

MonoApplications “/hellomonoweb:/opt/mono-1.9.1/lib/xsp/hellomonoweb”

<Location />

SetHandler mono

</Location>

Important to disable case sensitivity for files and file paths add this entry. This prevents issues like file not found due to differences between Linux and Windows handling of case sensitivity for files and file paths:

MonoSetEnv MONO_IOMAP=all

3) Optionally, if you are using MonoRail, a .Net implementation of Ruby on Rails ( see castleproject.org), add the following entry to /etc/httpd/conf.d/mod_mono.conf:

AddType applications/x-asp-net .rails

2 comments:

  1. Thanks for the hints - this is something I have to do in a couple of months, so good to know others have already been there, done that!

    ReplyDelete
  2. That was a great post on Cloud Computing. Thanks for sharing it here. By the way have you heard about Cloudslam 2010 conference which is a upcoming event covering all the latest events and technologies on Cloud Computing. They also providing good opportunity to meet and talk with the world's leading experts of Cloud Computing.

    ReplyDelete