ASP.NET is a programming framework to create web application server side. ASP.NET using C # code is well structured so it is easy to understand and repair. C # also provides a variety of code hint, hint error before the code is executed. C # is executed using JIT system, so it may be able to run faster than interpreted languages like PHP.

But until a few years ago ASP.NET can only run on windows platform. Because there are some who still is Microsoft's patents, these projects difficult to run optimally and tend to be limited compatibility, even dotGNU project to a halt in 2012. So today I will discuss about how to run ASP.NET MVC 5 on Ubuntu Linux.

Before that some things need to be prepared, such as:

  • Computers with 14:04 LTS Ubuntu operating system.
  • ASP.NET MVC 5 that has been published.
  • Internet connection.

How to Make ASP.NET MVC 5 Run in Ubuntu?

  • Make sure that your operating system has been updated by running the following command:
    sudo apt-get update && sudo apt-get dist-upgrade
  • Install apache2 package by running the command:
    sudo apt-get install apache2
  • Input Mono into the system package list, this needs to be done so that the mono version that will be installed up to date. make sure you run the code below line by line.
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
    sudo echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
    sudo echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list
    sudo echo "deb http://download.mono-project.com/repo/debian alpha main" | sudo tee /etc/apt/sources.list.d/mono-xamarin-alpha.list
    sudo apt-get update && sudo apt-get dist-upgrade
  • Install mono-complete package
    sudo apt-get install mono-complete
  • Install libapache2-mod-mono package
    sudo apt-get install libapache2-mod-mono
    sudo a2enmod mod_mono_auto
  • Set apache2, so that the apache2 folder using mono. This procedure must be repeated for each new application
    sudo nano /etc/apache2/sites-available/testasp.conf
  • Copy-paste the following lines into the console, adjust the path and name if necessary. click ctrl + o, enter the ctrl + x to save the file.
    Alias /testasp "/var/www/html/testasp"
    MonoServerPath inventory "/usr/bin/mod-mono-server4"
    MonoDebug inventory true
    MonoSetEnv inventory MONO_IOMAP=all
    MonoApplications inventory "/testasp:/var/www/html/testasp"
    <Location "/testasp">
    Allow from all
    Order allow,deny
    MonoSetServerAlias inventory
    SetHandler mono
    SetOutputFilter DEFLATE
    SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip dont-vary
    </Location>
    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript
    </IfModule>

  • Create a new folder in the / var / www / html / testasp, adjust permissions folder if necessary. Asp.net files will be stored here.
    sudo mkdir /var/www/html/testasp
  • Enable configuration site that have been created.
    sudo a2ensite testasp
    sudo service apache2 restart
  • Upload or copy the files you want to run ASP.NET MVC into the folder / var / www / html / testasp.
  • Test sites in the browser, adjust your url with IP engine.
  • Done. You have been successfully run ASP.NET MVC 5 on the Linux operating system.

 

HostForLIFE.eu ASP.NET MVC 5 Hosting
HostForLIFE.eu revolutionized hosting with Plesk Control Panel, a Web-based interface that provides customers with 24x7 access to their server and site configuration tools. Plesk completes requests in seconds. It is included free with each hosting account. Renowned for its comprehensive functionality - beyond other hosting control panels - and ease of use, Plesk Control Panel is available only to HostForLIFE's customers. They
offer a highly redundant, carrier-class architecture, designed around the needs of shared hosting customers.