CentOS 7 Installing. Net Core 2.0 Detailed steps

Source: Internet
Author: User

A vigorous core craze, starting with the deployment environment. Referring to many of the online predecessors of the course, also encountered a lot of pits, this way to make a complete note.

First, build the. Net Core 2 application Web publishing, as it is used to test the core environment on CentOS, and then use the core instance of VS17 directly.

Release

Second, the deployment of the CentOS 7 core environment

1. Connect and start the previously installed virtual machine, "root" login

2, if the virtual machine is located as a Linux server, then we need to be able to remote operation.

This is Xshell 5.

After the new, we need to fill in the host is the server IP

Switch to the virtual machine if the lock screen, enter key, open the application terminal

# IP addr, no IP address found because the configuration was missing

# cd/etc/sysconfig/network-scripts/

# ls can see the file Ifcfg-rth0 is the configuration we need

# VI Ifcfg-eth0

"I" key into edit mode

Change Onboot=yes

"ESC" key

Enter ": Wq" to save

# Service Network restart reboot, check again, IP is present

Enter the acquired IP

After OK, you can also execute commands in Xshell at the terminal.

Second, for the installation of. NET Core 2 We directly use Microsoft's official reference material (Https://www.microsoft.com/net/core#linuxcentos)

    1. # sudo rpm--import https://packages.microsoft.com/keys/microsoft.asc
    2. # sudo sh-c ' echo-e ' [Packages-microsoft-com-prod]\nname=packages-microsoft-com-prod \nbaseurl=https:// packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod\nenabled=1\ngpgcheck=1\ngpgkey=https:// Packages.microsoft.com/keys/microsoft.asc ">/etc/yum.repos.d/dotnetdev.repo"

    1. # sudo yum update
    2. # sudo yum install libunwind Libicu
    3. # sudo yum install dotnet-sdk-2.0.0

After execution,

# dotnet--help, appears as shown, the environment is installed successfully!

Third, upload the published web of. NET Core 2 to the server

Uploading with tools Xftp

Garbled after connection, this is because the folder in the server is in Chinese.

Change the folder name to English first

Open Terminal, enter

# Export Lang=en_us

# xdg-user-dirs-gtk-update

# Export LANG=ZH_CN

Turn off reboot and reconnect xftp to see the normal English name.

Create a new test folder in home to save the uploaded core

Upload all the files in Publishoutput

CD into test file, execute DLL

Here you can create a new connection,

# Curl http://localhost:5000

Appears as shown

Or browse directly from the server

This makes the core environment deployment complete.

CentOS 7 Installing. Net Core 2.0 Detailed steps

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.