Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How does linux deploy the .net Core project

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "how to deploy the .net Core project in linux", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to deploy the .net Core project in linux" article.

1.net core deploys the environment running on the Linux system. 2. Publish the project to Linux

What I use here is the introduction of FTP to the Linux system.

1. Create a folder under the server home (file name is arbitrary), and publish the compiled file to the modified file.

3. Configure Nginx

1. Edit the conf file and copy and paste the following code directly under the file

Server {

Listen 81

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

}

}

Note: access server port 81 go to Core project

two。 Edit the conf file and execute it on the server.

Nginx-s reload

To make it work, also execute nginx-t to see if the configuration file is misconfigured.

Ok, which means there are no syntax errors.

4. Run the. net Core project

It is possible that the project is not running when Bad GateWay appears (Layui_Demo is the project name, you can change it to your own project name)

Note: don't terminate the Ctrl+C,Ctrl+C project.

Now go to the browser to visit http: the server IP:81 is OK.

Attached:

You can use the following command to have a command line run in the background process.

Nohup dotnet Layui_Demo.dll &

Jobs

View the command running in the background of the current terminal, which cannot be viewed after the terminal is closed.

Kill% digit

Terminate the current program

5. Related problems

Failed to load, U?error: libunwind.so.8: cannot open shared object file: No such file or directory

Failed to bind to CoreCLR at'/ usr/share/dotnet/shared/Microsoft.NETCore.App/2.0.5/libcoreclr.so'

Solve

Yum install libunwind

The above is about the content of this article on "how to deploy the .net Core project in linux". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report