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