Posts Tagged ‘Mono’

Install Mono on FreeBSD step by step

Saturday, September 18th, 2010

Mono is the Microsoft .net framework ported Open Source world and consists of runtime environment, compiler, and web server for handling ASP.NET web sites.

First step is install or update ports collection  using “#portsnap fetch”, then “#portsnap extract” or “#portsnap update”.

#cd /usr/ports/lang/mono

#make install clean
Then follow the configuration and setup options.

It will take some time to build, after installation, and build complete you can start your first c# application

#ee hellowolrd.cs

class Program
{
static void Main(string[] args)
{
System.Console.WriteLine(“Hello world, server time is:{0}”,System.DateTime.Now.ToString());
}
}

save the file and exit.

compile the file using mono compiler:

#/usr/local/bin/mcs hellowolrd.cs -r:System.Web.dll -r:System.Data.dll

run the hellowolrd application using:

# /usr/local/bin/mono helloworld.exe


Why I decided to use FreeBSD

Sunday, March 7th, 2010

When I got my Windows server 2008 web edition dedicated server, I was surprised that there is no DNS server and there is no pop3 service. my all previous experience was dedicated to Microsoft family only, but the world is more open and bigger than Microsoft, Microsoft open the door to me for open source when they close the services that was there in 2003 server.

I search the web for free DNS server and found bind9.net and this was the start with the open source world, bind9 working for both Windows and Unix based servers.

Later on I decided to get another dedicated server to be DNS backup server, secure mail, files backup server with three conditions:

  1. Can be a DNS server, Web Server, secure email server.
  2. The cost.
  3. Can run Mono, Mono is an open source project for Microsoft .Net framework to run on Unix based system.

My hosting company was providing FreeBSD, Enterprise Linux – CentOS, Debian, and Ubuntu Server.

Hosting company recommendation was  Enterprise Linux – CentOS.

I search the web to get comparison between this Unix based operating system, I found all of them is good and doing the required two points, and the choice depend on my selection, so I decided to read on Mono web site, what is the supported platform I found almost all is supported but I found separate section talking about FreeBSD.

I feel its hard to get a decision, I pray Istikhara; Istikhara is a recommended prayer for Muslems before they got a major decision, you can read more about it here

So I decided to get my dedicated server box as FreeBSD, and I found it more than I expect, sure at start life was not easy at all, but day by day its a proven choice.