Apparently the good folks over at the mono project decided to discontinue binary packages for the Red Hat line of linux distributions. It’s a shame in a way, there are a lot of those installation out there, so it would be nice to keep things updated through yum or apt-install or rhupdate, etc..
On the up side, installing from source has never been easier. In the past I have went through many hours of trying to get the right versions of different libraries that were needed. With the official release of 2.0 it seems much better. I thought I would share the steps that I went through.
Disclaimer: This worked on a fairly fresh install of CentOS 4.7. I have not tried it on 5.x, nor on any other flavor of linux (SUSE, Ubuntu, etc..) so your mileage may vary.
At the time of the install (and this writing) the current mono stable version is 2.0.1 so all references will be to that version. Here are the steps that I went through.
Always be prepared – Boy Scouts motto…
In rooting around the web I did find a few helpful pointers. First, make sure you have gcc installed. Now this is one of those duh pieces of information, but in the fairness of completeness I thought I would mention it. (Note: If you do not have gcc or bison, install them! Credit The_Assimilator’s comment)
# yum install gcc-c++ # yum install bison
yum install httpd-devel
You may also require the glib-2.0 libraries (thanks to Michael Walsh for that bit). If you receive the error “Package glib-2.0 was not found in the pkg-config search path” you can install it via yum as well.
yum install glib2-devel
The Main Dance
wget http://ftp.novell.com/pub/mono/sources/mono/mono-2.0.1.tar.bz2 wget http://ftp.novell.com/pub/mono/sources/xsp/xsp-2.0.tar.bz2 wget http://ftp.novell.com/pub/mono/sources/mod_mono/mod_mono-2.0.tar.bz2
Next we install the mono core
tar -vxjf mono-2.0.1.tar.bz2 cd mono-2.0.1 ./configure make make install cd ..
Next comes xsp
tar -vxjf xsp-2.0.tar.bz cd xsp-2.0 ./configure make make install cd ..
At this point I recevied an error (I believe it was in the make process) that the compiler could not find the file dotnet.pc. I found that it was indeed on my system so I simply had to export the path and then finsih the compile.
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig make make install cd..
Note: Make sure the file dotnet.pc is in that location. If not, adjust the path above.
Finally we install mod_mono
tar -vxjf mod_mono-2.0.tar.bz2
There, easy huh?
You may want to verify a few thigns to make sure the configuration is ready to rock. In my case, I am keeping the mono configuration in a separate file for sanity sake. You can do that or put it all in your httpd.conf, it’s up to you.
<IfModule !mod_mono.c> LoadModule mono_module /usr/lib/httpd/modules/mod_mono.so AddType application/x-asp-net .aspx AddType application/x-asp-net .asmx AddType application/x-asp-net .ashx AddType application/x-asp-net .asax AddType application/x-asp-net .ascx AddType application/x-asp-net .soap AddType application/x-asp-net .rem AddType application/x-asp-net .axd AddType application/x-asp-net .cs AddType application/x-asp-net .config AddType application/x-asp-net .Config AddType application/x-asp-net .dll DirectoryIndex index.aspx DirectoryIndex Default.aspx DirectoryIndex default.aspx </IfModule>