Ubuntu run. NET Core 2.0

Source: Internet
Author: User

Install the. NET Core Reference address: Http://www.microsoft.com/net/core/preview#linuxubuntu

Server version Ubbuntu 16.04

Execute command

' echo "Deb [Arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/xenial main" >/etc/apt/ Sources.list.d/dotnetdev.list'sudo apt-key adv--keyserver HKP://  keyserver.ubuntu.com:80--recv-keys 417a0893sudo apt-get update

sudo apt-get install dotnet-sdk-2.0. 0-preview2-006497

The installation was successful.

Then install Nginx on the server and refer to another article http://www.cnblogs.com/xiaoquangege/p/7285967.html

Create a service file in the directory

/etc/systemd/system/[Service file name].service

File contents

[Unit]description=Example. NET Web API application running on ubuntu[service]workingdirectory=/  var/ Site Directory Execstart=/usr/bin/dotnet/var/Site Directory/hellomvc.dllrestart=  Alwaysrestartsec=ten  if  dotnet service Crashessyslogidentifier= dotnet-exampleuser=www-dataenvironment=aspnetcore_environment=Production [Install] Wantedby=multi-user.target

Save the file inside the service

Systemctl Enable Kestrel-hellomvc.service

Start this service

Systemctl Start Kestrel-hellomvc.service

Reference Address: Https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction

Open Web site, Linux Browse. NET Core website is OK

Ubuntu run. NET Core 2.0

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.