nav-left cat-right
cat-right

Mono

4.5 Mono

Mono is an open-source platform designed to bring the .NET architecture to non-Windows platforms. If you want to run any .NET code on Linux, Mono is your key. This is a great project! Check out http://www.mono-project.com/ for more.

4.5.1 Install Mono

Copy the following into a yum repository information file at /etc/yum.repos.d/mono.repo:

[mono]
name=Mono for rhel-4-i386 (stable)
baseurl=http://go-mono.com/download-stable/rhel-4-i386/
enabled=1
gpgcheck=0

We also need a couple of packages, due to some fun issues I found with Mono during one of my original installs. These packages are needed for systems without the 'inotify' patch on the kernel, as they provided a FileSystemWatcher called FAM that is more efficient for the mono server to use than it's default polling mechanism. Without it, on CentOS4.4 anyway, the mono server would use 10% of the CPU even while idle. So:

  • yum install gamin gamin-devel

Now the real stuff:

  • yum install mono-core mono-web mono-data mono-winforms xsp pkgconfig

4.5.2 Install mod_mono

Due to httpd package dependency issues (see notes under Install Apache for more on that), I compiled mod_mono from source. Get it from http://go-mono.com/sources-stable/, and download it to /usr/src/mod_mono:

  • sudo su -
  • mkdir /usr/src/mod_mono
  • cd /usr/src/mod_mono
  • wget http://go-mono.com/sources/mod_mono/mod_mono-1.[version].tar.bz2
  • bunzip2 mod_mono-1.[version].tar.bz2
  • tar xvf mod_mono-1.[version].tar
  • cd mod_mono-1.[version]
  • ./configure --prefix=/usr
  • make
  • make install

4.5.3 Configure Apache to use mod_mono

Edit the main Apache config file (/etc/httpd/httpd.conf) and add:

Include /etc/httpd/mod_mono.conf

MonoServerPath "/usr/bin/mod-mono-server2"

Alias /demo /usr/lib/xsp/test
<Directory "/usr/lib/xsp/test">

AllowOverride None
Options None
Order allow,deny
Allow from all

</Directory>

Restart apache and exit your root session:

  • service apache restart
  • exit

Check the server at http://localhost/demo/index.aspx; you're running .NET code!

I'll leave it at that for Mono… it's a whole 'nother ball of worms. To get applications up and running, you'll want to check out the Mod mono docs as well as the general Mono docs. Mono is still a work in progress for me, and I don't run any websites with it yet, but I might at some point very soon!

  • Digg
  • del.icio.us
  • DotNetKicks
  • Slashdot
  • StumbleUpon