For future reference, this is what you need to do in order to install Mono and XSP on Ubuntu Server 12.04.3 LTS x64. This is about a completely blank installation, where only the SSH server role was selected during the installation of the OS.

You’ll need the following commands to set up mono in /usr/local. Keep in mind that apt-get install and make install are going to need root privileges:

apt-get install git
apt-get install build-essential pkg-config
apt-get install autoconf automake libtool gettext

git clone git://github.com/mono/mono.git

cd mono
./autogen.sh --prefix=/usr/local
make get-monolite-latest
make
make install

And these for XSP:

git clone git://github.com/mono/xsp.git
cd xsp
./autogen.sh
./configure --prefix=/usr/local
make
make install

And that’s it!

References: 1 2 3

Update, 2013-10-27: Here’s a related excellent article, which covers additionally the installation of libgdiplus.