LockedHow can I run ASP.Net under Linux?

Author
techMate
Member
2019/06/13 17:33:26 (permalink)

How can I run ASP.Net under Linux?

Will a .NET web application be able to run in a Linux based server? Please guide if anyone have any idea about this?
#1

3 Replies Related Threads

    Scott_tiger
    Junior Member
    Re: How can I run ASP.Net under Linux? 2019/06/14 17:43:09 (permalink)
    Yes, it is possible to run ASP under Linux. Only you have to follow some steps-
    1. Install several library for mono. Type this command:
    sudo apt-get install mono-xsp2 mono-apache-server2 libapache2-mod-mono mono-gmcs mono-utils
    2. Edit your mod_mono.conf. Run Asp.Net application is using AutoHosting configuration.
    3. Save the file and restart your apache.
    4. Write your first Asp.Net application.
    5. Save file to your web server.
    Run your application.
    #2
    swaroopsantosh
    Junior Member
    Re: How can I run ASP.Net under Linux? 2019/06/19 00:33:26 (permalink)

    Best way to run ASP.Net under Linux :

    STEP 1 - GET A CHEAP HOST

    I went to Linode (or anywhere) and got the cheapest Linux machine they offered. In this case, it's an Ubuntu 14.04 LTS Profile, 64-bit, 4.6.5 Kernel.

    STEP 0.5 - SETUP A USER THAT ISN'T ROOT

    It's always a good idea to avoid being root. After logging into the system as root, I made a new user and give them sudo 

    STEP 1 - GET .NET CORE ON YOUR LINUX MACHINE

    Head over to  get .NET Core and follow the instructions. There are at least 8 Linuxes supported in 6 flavors so you should have no trouble. I followed the Ubuntu instructions.

    STEP 2 - MAKE AN ASP.NET CORE WEBSITE

     You can make an ASP.NET Core website that is very basic and very empty and that's OK. You can also get Yeoman and use the ASP.NET yeoman-based generators to get more choices.

    STEP 3 - EXPOSE YOUR WEB APP TO THE OUTSIDE.

    could tell Kestrel - that's the .NET Web Server - to expose itself to Port 80, although you usually want to have another process between you and the outside world.
    You can do this in a few ways. You can open the Program.cs with an editor like "pico" and add a .UseUrls() call to the WebHostBuilder like this.

    STEP 4 - SETUP A REVERSE PROXY LIKE NGINX

    I'm following the detailed instructions at the ASP.NET Core Docs site called "Publish to a Linux Production Environment." (All the docs are on GitHub as well)
    I'm going to bring in Nginx and start it.
    Remember the relationships.
    • Dotnet - runs your website
    • Nginx or Apache - Listens on Port 80 and forwards HTTP calls to your website
    • Supervisor - Keeps your app running
    Next, I might want to set up a continuous integration build, or SCP/SFTP to handle the deployment of my app. That way I can develop locally and push up to my Linux machine.
    these are some way you can run ASP.Net under Linux?
     
     
     
     

     
     
    #3
    Xavier
    Senior Member
    Re: How can I run ASP.Net under Linux? 2019/06/20 02:43:20 (permalink)
    Thanks swaroop for sharing helpful information.
    #4
    Jump to: