Posts

Showing posts from March, 2022

Publish .Net Core Web API to Linux Host

Image
Publish .Net Core Web API to Linux Host In this post below, I am going to detail out the step of publishing a .NET Core Web API to Linux Host SSH the Linux host Open any SSH client like gitbash Go to the location where the .pem file exists ssh -i <pemfilename> -v <username>@<host_IP_Address> use sudo su for super admin access to run further command Create project folder Go to /var/www folder (cd /var/www) create a new folder for the project. For example SampleWebAPI (mkdir SampleWebAPI ) Publish project in release mode Open command prompt as administrator Go to Project folder - cd <foldername> dotnet publish  --configuration release Copy latest publish code to project folder Open file transfer tool like FileZilla Connect to linux host with right credentials Copy the file from local published folder to  /var/www/SampleWebAPI  Change the Nginx configuration file Go to cd /etc/nginx/sites-available/ Edit default config file: vim default...