Basic environment configuration Please purchase the domain name and server by yourself first Create an application instance based on the cloud server ECS, select the system image as Ubuntu 16.04, connect remotely via SSH on the local machine, and perform relevant configurations ... sudo apt-get update sudp apt-get upgrade sudo apt-get autoremove sudo apt-get clean Install and configure Nginx sudo apt-get install nginx sudo service nginx start sudo gedit /etc/nginx/sites-available/default Configure the default file and configure the following node information at the end of the file # Virtual Host configuration for example.com # # You can move that to a different file under sites-available/ and symlink that # to sites-enabled/ to enable it. # server { listen 80; # The target location of the website files is root /home/hippie/website/wwwroot; # server_name your website name; location / { proxy_pass http://localhost:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } Check configuration and update sudo nginx -t sudo nginx -s reload Install DotNetCore Please refer to the latest installation instructions on the official website: .NetCore Download Deployment Process Open VisualStudio2017, right-click the project to be published, click Publish, and refer to the figure below for relevant configuration. Click the Save button to publish. Then upload the publish folder to the corresponding location on the server. After the upload is successful, execute If nothing goes wrong, at this time, you can access it through IP or your website domain name. Creating a daemon process After performing the above operations, our program still cannot run for a long time, so we need to manage our website through a daemon process sudo apt-get install supervisor sudo vim /ect/supervisor/conf.d/website.conf Configure website.conf file [program:website] #Command to execute command=/usr/bin/dotnet Attention.dll #Command execution directory directory=/home/hippie/website #Environment variable environment=ASPNETCORE__ENVIRONMENT=Production #Process execution user identity user=www-data stopsignal=INT #Whether to start automatically autostart=true #Whether to automatically restart autorestart=true #Automatic restart interval startsecs=1 #Standard error log stderr_logfile=/var/log/website.err.log #Standard output log stdout_logfile=/var/log/website.out.log At this time, we execute the following command to start the daemon process sudo supervisorctl shutdown && sudo supervisord -c /etc/supervisor/supervisord.conf supervisorctl shutdown sudo service supervisor start Well, now you can try to close the remote connection to access the website. If you can access it normally, it means that your configuration has worked. Summarize The above is the installation and configuration method that I introduced to you for deploying DoNetCore to Alibaba Cloud in combination with Nginx. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time! You may also be interested in:
|
<<: Solve the problem that await does not work in forEach
>>: MySQL trigger detailed explanation and simple example
This article introduces the sample code of advanc...
Find the problem I recently migrated the storage ...
I found a strange problem when deploying the proj...
# Installation daemon configuration for Redis on ...
A major feature of the WeChat 8.0 update is the s...
Using the Docker run command docker run -d -p 920...
External temporary tables A temporary table creat...
Preface: One day, I built a MySQL service in Dock...
In MySQL, there is a function called "group_...
Recently, when I installed MySQL in Docker, I fou...
1. Use the shortcut Ctrl + Shift + P to call out ...
Basic concepts of consul Server mode and client m...
For databases that have been running for a long t...
Note 1: The entire background in the above pictur...
1. Pull the MySQL image Get the latest MySQL imag...