Manual install aspnetcore 3.1 Ubuntu 20.04 - Apache2

AaaaJeeee 1 Reputation point
2021-08-03T11:54:50.347+00:00

Who has a step-by-step instruction to install ASP.NET Core 3.1 on Ubuntu 20.04 with Apache which really works. The articles I have found don't.

Thanks in advance

Developer technologies ASP.NET ASP.NET Core
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anonymous
    2021-08-04T03:02:05.463+00:00

    Hi @AaaaJeeee ,

    You can refer the following article to install Asp.net core on Ubuntu manually:

    *First, download a binary release for either the SDK or the runtime from one of the following sites. If you install the .NET SDK, you will not need to install the corresponding runtime:

    Next, extract the downloaded file and use the export command to set DOTNET_ROOT to the extracted folder's location and then ensure .NET is in PATH. This should make the .NET CLI commands available at the terminal.
    Alternatively, after downloading the .NET binary, the following commands may be run from the directory where the file is saved to extract the runtime. This will also make the .NET CLI commands available at the terminal and set the required environment variables. Remember to change the DOTNET_FILE value to the name of the downloaded binary:*

       bash  
       DOTNET_FILE=dotnet-sdk-5.0.302-linux-x64.tar.gz  
       export DOTNET_ROOT=$(pwd)/dotnet  
         
       mkdir -p "$DOTNET_ROOT" && tar zxf "$DOTNET_FILE" -C "$DOTNET_ROOT"  
         
       export PATH=$PATH:$DOTNET_ROOT  
    

    More detail information, see Install the .NET SDK or the .NET Runtime on Ubuntu.

    Then, to install the Apache, you could refer the following articles:

    Install Apache

    HOW TO HOST ASP.NET CORE APP ON UBUNTU WITH APACHE WEBSERVER


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Dillion

    0 comments No comments

  2. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2021-08-04T18:56:53.497+00:00

    To host asp.net core app on Linux with Apache requires two setups

    The first is start the asp.net core app on a known port. As you want to do this at startup you would typically use systemd for this. I believe Ubuntu 20 now supports systemd.

    Once the asp.net core app is running, and you can access with a browser on its custom port, you now configure Apache to reverse proxy to the running asp.net core app. You will also want to set the forwarding headers asp.net core expects.

    Note: if you really do not understand systemd and configuring Apache as a reverse proxy, then maybe you should not be using Linux as a host

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.