I'm trying to get Mono to work on CentOS 5, however haven't had much success so far. This is what I did:
> yum install mono-web
> yum install xsp
> yum install mod_mono
> echo ":CLR:M::MZ::/usr/bin/mono:" > /proc/sys/fs/binfmt_misc/register
Ensured that the following line is present in /etc/httpd/conf/httpd.conf:
Include conf.d/*.conf
Ensured that /etc/httpd/conf.d/mod_mono.conf exists and looks like this:
<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
<Location /mono-ctrl>
SetHandler mono-ctrl
</Location>
</IfModule>
Created /etc/httpd/conf.d/mono-vhost.conf and inserted the following:
<VirtualHost *>
DocumentRoot /var/www/html
Alias /demo /usr/local/lib/xsp/test
MonoApplications "/demo:/usr/local/lib/xsp/test"
MonoServerPath /usr/bin/mod-mono-server2
<Location /demo>
SetHandler mono
</Location>
</VirtualHost>
And finally:
> apachectl restart
Then I browsed to http://my.server.ip.address/demo/index.aspx, expecting to see an ASPx page; instead my browser prompted me to download that file. There is nothing in the Apache error log.
I've got other websites running on this box via PHP and they work perfectly, so I'm pretty sure it's just mod_mono that's weird, but for the life of me I can't figure out what the problem is. If anyone can point me in the right direction, it would be most appreciated.