Introduction
In this tutorial you’ll set up and deploy a production-ready ASP.NET Core application with a MongoDb Server on Ubuntu 22.04 using Nginx.
Real World ASP.NET Core ubuntu。
https://andrewlock.net/exploring-the-dotnet-8-preview-updates-to-docker-images-in-dotnet-8/
How it works
Remember the relationships.
One Ubuntu 22.04 server - Your server
nginx - Listens on Port 443 / 80 and forwards HTTP/S calls to your website.
A secured Nginx web server
Mongodb Redis - Keeps your app data
ASP.NET Core - Runs your app / website
Supervisor - Keeps your app running
Table of Contents
Introduction
Part 1 -Deploying Real World ASP.NET Core on Ubuntu 18.04- Introduction (you are here)
Part 1 -Deploying Real World ASP.NET Core on Ubuntu 18.04- Introduction (you are here)
Requirements
Prepare an Run Evironmentn for ASP.NET Core Application on Ubuntu
Running an ASP.NET Core Website on Ubuntu
Configure ASP.NET Core as a Background Service
Configure NGINX as a Reverse Proxy to ASP.NET Core
Configure the reverse proxy for secure (HTTPS) client connections
Quick Start
Part 2 - Setting up your Orchard Development Evironmentn
Deploying Real World ASP.NET Core on Ubuntu 18.04 – Part 2
Prepare ASP.NET Projects
Initial Server Setup with Ubuntu 22.04
How To Install Nginx on Ubuntu 22.04
Requirements
upgrade from Ubuntu 20.04 LTS to 22.04 LTS detail
Register Microsoft key and feed
Install the .NET Core 2.1 Runtime
Install the .NET SDK
Create a new ASP.NET Core web application
Publish and copy over the app
Install Mongodb 7.0 detail
Install Nginx as reverse proxy detail
Configure Nginx
Configure SSL
Monitoring the app
Install cerbot detail
Install nginx 1.18.0 detail
Install Certbot 2.11.0
ufw allow http
ufw allow https
#Use Certbot Standalone Mode to Retrieve Let's Encrypt SSL Certificates on Ubuntu 22.04
certbot certonly --standalone --register-unsafely-without-email
Install frp 0.45
sudo ufw allow port
Install Mongodb
Install Redis
Conclusion
Prerequisites
1.Linux Distribution
ubuntu 18.04-x64
root permissions
# lsb_release -a
Install .NET Core SDK on Linux Ubuntu 22.04 - x64
This tutorial installs .Net core 2.2 on ubuntu 18.04-x64 . For other versions of ubuntu, refer to the corresponding version of the doc.
step 1:Register Microsoft key and feed,This only needs to be done once per machine.
Before installing .NET, you'll need to register the Microsoft key, register the product repository, and install required dependencies.
Open a terminal and run the following commands:
you can read the doc https://dotnet.microsoft.com/download/linux-package-manager/ubuntu16-04/sdk-current and run the commands.
step 3.Check everything installed correctly
To make sure it works after you’ve set it up, just run:
#dotnet --version
#dotnet --info
If the command runs, printing out information about dotnet, you're good to go.
step 4:Website Creation
The dotnet command creates a new website server application of type website for you. The -o parameter creates a directory named test where your app is stored, and populates it with the required files. The cd myApp command puts you into the newly created app directory.
step5:Run
windows
1.dotnet publish
2.copy in\Debug\netcoreapp2.1\publish\*.* to linux var/www/
3.cd var/www/publish
4.dotnet project.dll
Prerequisites for .NET Core on Linux
https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x
https://miniblog.iaspnetcore.com/ on vultr direct