. Net Core Ubuntu 14.04 deployment process, ubuntu14.04
No. 1 prepare the application
1. Create a. Net Core Web Project
Sudo sh-c 'echo "deb [arch = amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main">/etc/apt/sources. list. d/dotnetdev. list 'sudo apt-key adv -- keyserver hkp: // keyserver.ubuntu.com: 80 -- recv-keys ~a0893sudo apt-get update
2. Install. Net Core SDK
sudo apt-get install dotnet-dev-1.0.0-preview2-003131
Dotnet -- version
Mkdir NetWebcd NetWebdotnet new
5. Run the sample program
dotnet restoredotnet run
Note: Because I installed Ubuntu In the VM, I can directly copy files. In the production environment, I can use ftp to upload files. How can I set up my own Baidu.
No. 4 run & access
dotnet ***.dll
* **. Dll is the entry Link Library generated by the project.
Note: After the default project created by. Net Core is deployed, it can only be accessed from the local machine. The external IP address cannot be opened and can be configured through Nginx. You can also modify Program. cs
var host = new WebHostBuilder() .UseKestrel() .UseUrls("http://*:5000") .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIntegration() .UseStartup<Startup>() .Build();host.Run();
UseUrls (http: // *: 5000)You can access the program through an IP address.
Ps: When I use VS2015 to publish a program, garbled characters appear in the output window. It should be a code problem. I don't know if you have any. I haven't found the cause yet.