1024programmer Asp.Net .net6 installation under Qilin

.net6 installation under Qilin

.net6 installation under Qilin

I tried the installation and deployment of .net6 in Xinchuang environment

Xinchuang server, CPU: ARM64, operating system: Kirin v10, network environment: Government Network (unable to connect to the external network)

1. Download the .net 6 SDK 6.0.408 Arm64 binary file. https://dotnet.microsoft.com/zh-cn/download/dotnet/6.0

2. Create two new directories in the server/home directory, test and dotnet;

3. Upload the compressed package to the server /home/test, which can be uploaded through the bastion host SFTP;

4. Enter the /home/test directory, execute: tar zxf dotnet-sdk-6.0.408-linux-x64.tar.gz -C /home/dotnet, and extract the file to the /home/dotnet directory;

5. Set environment variables and edit /etc/profile to add the following two lines:

Export DOTNET_ROOT=/home/dotnet

Export PATH=$PATH:/home/dotnet

If you are not used to vim, you can download the file to your computer and edit it with Notepad.

6. Check the installation status and execute: source /etc/profile to reload the configuration file.

7. Execute: dotnet –info to check the .net installation status. The following picture appears, indicating that the installation and configuration are successful.

8. Use VS to create a new ASP.NET Core WebAPI project (project name: kytest). The project will automatically generate a weather forecast API interface. Just create and run it without modification. Modify the appsettings.json configuration file to specify the port (the server only opens ports 80-90, so the default port 5000 must be changed to port 86).

{
   "Logging  span>": {
     "LogLevel  span>": {
       "Default  span>": "Information",
       "Microsoft.AspNetCore  ": "Warning"
     }
   },
   "AllowedHosts  span>": "*",
   "Kestrel  span>": {
     "Endpoints  span>": {
       "Http": {
         "Url  span>": "http://*:86  "
       }
     }
   }
 }

9. Release normally, select linux-arm64 when running as target.

10. Go to the server’s /home directory to create a new wwwroot directory, and upload all the files in the publishing target location folder to the wwwroot directory.

11. Enter the wwwroot directory and execute dotnet kytest.dll. If the following screen appears, it indicates that it is running normally.

12. Use a browser to access http://xx.xx.xx.xx:86/WeatherForecast. If the interface data can be returned normally and the data will change randomly every time the page is refreshed, it means the release is successful.

About firewall settings:

If you find that the interface can be accessed normally through curl http://localhost:86/weatherforecast on the server but cannot be accessed through the browser, please check the firewall settings.

Check the status: systemctl status firewalld Check the firewall status. If active (running) is displayed, the firewall is turned on.

Port open status query: firewall-cmd –list-all can view all open ports.

Query a single port:fireewall-cmd -query-port=[port]/tcp, check whether the specified port is open, yes means it is open, no means it is not open

Open port: firewall-cmd –permanent –add-port=[port]/tcp, return success after execution.

After adding the port, restart the firewall for the settings to take effect: systemctl restart firewalld

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/net6-installation-under-qilin-2/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索