In the previous post, Installing ASP.NET on Ubuntu with Mono, I outlined the step of enabling ASP.NET application on Apache using mod_mono without autoconfig. This post provides steps for configuring mod_mono autoconfig targeting ASP.NET 4. This post overlaps and supersedes the previous article.

This post assumes Apache 2 is installed. If this is not the case, see the previous post. The following are Linux shell commands for the process.

1. Install Mono

sudo apt-get install mono-runtime
sudo apt-get install mono-gmcs

2. Install mod_mono

sudo apt-get install libapache2-mod-mono
sudo apt-get install mono-apache-server2

3. Enable mod_mono autoconfig

sudo a2enmod mod_mono_auto

For new installation this is all that’s need to enable mod_mono. For older installation with existing Apache configuration files, make sure the following directives somewhere in one of Apache configuration files. For new installation the following are already included in /etc/mono-server4/mono-server4-hosts.conf, which is included in the main configuration file.

MonoAutoApplication enabled
MonoServerPath default /usr/bin/mod-mono-server4

4. Restart Apache

/etc/init.d/apache2 restart


  1. mod_mono AutoConfiguration
  2. Ubuntu ModMono