Sunday, August 1, 2010

Linux and .NET

Sometime ago, I was required to test a few C# .NET sample code snippets. But here lied the problem, I had no access to a windows machine at that time. All I had was a machine with centOS 5.

Fortunately, there is the Mono Project for difficult times like these. Here is what I did,
# yum install mono-core.i386
# yum install xsp.i386
# yum install mono-web.i386
# yum install mod_mono.i386 (if you need it to be configured with apache)
You can configure mono with apache but since I was in a hurry, the fastest and the easiest way to do this was the xsp webserver (which is not usually recommended for production use).

All it needed me to do was to go the folder which had the scripts in it on the command line,
# cd /extra/scripts/
and then type the magic word,
# xsp
Output:
xsp
Listening on port: 8080 (non-secure)
Listening on address: 0.0.0.0
Root directory: /extra/scripts/
Hit Return to stop the server.
I could then test the sample codes by browsing to http://localhost:8080/

However, this does not mean that xsp is not configurable, xsp --help really helps :)