How to install Mono on RedHat/Plesk 8.6.x

Mono is a savior if you’re migrating Windows sites to Linux/Apache stack. I had to do this just recently and had to setup Mono on RHEL box with Plesk 8.6. It was relatively straighforward process and here is quick log as to how installed Apache Mono on Plesk:

1. Add Mono repository to yum:


wget -O /etc/yum.repos.d/mono.repo http://ftp.novell.com/pub/mono/download-stable/rhel-4-i386/mono.repo

2. Install Mono:

yum install mono-core mono-web mono-data mod_mono xsp

Note: You may get missing dependency notice.

Missing Dependency: libexif.so.9 is needed by package libgdiplus0-1.9-1.rhel4.novell.i386 (mono)
Error: Missing Dependency: libexif.so.9 is needed by package libgdiplus0-1.9-1.rhel4.novell.i386 (mono)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest

If that’ the case you’ll need to take a different route. Remove that /etc/yum.repos.d/mono.repo and create a new file centos-5-extras.repo and put the folloging content in there:

[centos-5-extras]
name=CentOS-5 - $basearch - Extras
#baseurl=http://mirror.centos.org/centos/5/extras/$basearch/
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
enabled=0

Then run this:

yum --enablerepo=centos-5-extras install mono-core mono-web mono-data mod_mono xsp

This should do it. Just make sure mono is installed afterwards:

mono -V

3. Check & configure mod_mono
Install process should’ve created the configuration file for mod_mono. Check if it exists here: /etc/httpd/conf.d/mod_mono.conf
If it doesn’t exist there create it and put the following contents:

# mod_mono.conf
<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>

4. Restart Apache

/usr/local/psa/admin/sbin/websrvmng -r

This did it for me. Along the way I encountered few issues, looking closesly at /var/log/httpd/error_log helped to find solutions(in my case it was missing mono-web package, that brings in System.Web library I guess).

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>