Wednesday, June 3, 2015

Install ASP vNext on Azure Ubuntu 14.04 LTS Mono

Wednesday, June 03, 2015 Posted by Andre Broers , , ,
I start with a S0 Azure Ubuntu 14.04 LTS virtual machine.
Install swap space in this new virtual machine as I explain here.

Install mono as is explained here.


sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

sudo apt-get update

sudo apt-get install mono-complete

Now the complete version of mono is installed. This is still needed to run ASP vNext applications on Linux.

Install libuv which is necessary for the webserver used by Mono ASP vNext.

sudo apt-get install make automake libtool git unzip
cd /usr/local/src
sudo git clone https://github.com/libuv/libuv.git
cd libuv
sudo sh autogen.sh
sudo ./configure
sudo make
sudo make install
sudo rm -rf /usr/local/src/libuv && cd ~/
sudo ldconfig


curl -sSL https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.sh | DNX_BRANCH=dev sh && source ~/.dnx/dnvm/dnvm.sh

dnvm upgrade

dnvm list

Active Version              Runtime Arch Location             Alias
------ -------              ------- ---- --------             -----
  *    1.0.0-beta4          mono         ~/.dnx/runtimes      default

Now we are ready to run the examples from ASP vNext on linux.

We can also install the unstable version:

dnvm upgrade -u

dnvm list

Active Version              Runtime Arch Location             Alias
------ -------              ------- ---- --------             -----
  *    1.0.0-beta6-11944    mono         ~/.dnx/runtimes      default
       1.0.0-beta4          mono         ~/.dnx/runtimes      

And we can switch back and forth between the installations:

dnvm use 1.0.0-beta4
Adding /home/azureuser/.dnx/runtimes/dnx-mono.1.0.0-beta4/bin to process PATH
dnvm list

Active Version              Runtime Arch Location             Alias
------ -------              ------- ---- --------             -----
       1.0.0-beta6-11944    mono         ~/.dnx/runtimes      default
  *    1.0.0-beta4          mono         ~/.dnx/runtimes      

And back using the alias:

dnvm use default
Adding /home/azureuser/.dnx/runtimes/dnx-mono.1.0.0-beta6-11944/bin to process PATH
dnvm list

Active Version              Runtime Arch Location             Alias
------ -------              ------- ---- --------             -----
  *    1.0.0-beta6-11944    mono         ~/.dnx/runtimes      default
       1.0.0-beta4          mono         ~/.dnx/runtimes