ASP.NET via Mono and Apache

In my last post I showed how to build Mono trunk on the latest Ubuntu. I pointed out that I am using it on a “server” install of Ubuntu. I don’t have GTK+ or GTK# installed. So what good is Mono? Its good for hosting ASP.NET web applications.

  1. Configure an apache development environment.
    sudo apt-get install apache2-prefork-dev
  2. Grab my mono-dev-update script and tell it to only do mod_mono
    curl http://jrwren.wrenfam.com/scripts/mono-dev-update
    ./mono-dev-update –m mod_mono
  3. Install the apache module
    pushd /opt/mono/src/mod_mono ; sudo make install ; popd
  4. Enable the apache module
    pushd /etc/apache2/mods-enabled;ln –s ../mod_mono.conf . ; popd
  5. Restart Apache
    sudo /etc/init.d/apache2 restart
  6. Test it
    echo ’<%=DateTime.Now%>’ |sudo tee /var/www/index.aspx
    curl localhost/index.aspx

You should see the current date and time displayed. If you don’t, you have done something wrong.  Note that quotes paste poorly out of wordpress, so you may need to type out some of these commands.