Objective
The ASP has been released for more than half a month, and the community has been very active recently, although it has been working on Python recently. NET obsession, looked at the park big God built the ASP. I was also eager to get ready for the creation and deployment of ASP. I have this article and hope to help you.
Environment preparation
This is my development environment, the use of Nginx is nginx 1.6.3 direct yum Install, and then need to install the dotnet environment, you can refer to the official website tutorial Https://www.microsoft.com/net/core#centos
Then create an ASP. NET core project using yeoman See official website https://aspnet-aspnet.readthedocs-hosted.com/en/latest/client-side/ Yeoman.html, because I didn't know how to create the ASPNET core MVC project with the dotnet directive, I had to use this. (later found the dotnet new-t Web, this directive is also to create an MVC Web project, see how silly I was then)
Create the first Web project
mkdir Demo1
CD Demo1
dotnet NEW-T Web
A Web project is generated under the Demo1 directory
Take a look at Project.json.
There are some project dependencies and Build,publish and runtime options. You can see Microsoft.AspNetCore.Server.Kestrel, which relies on Kestrel to listen for Web requests.
Execute dotnet Restore This instruction is primarily to find the project file (Project.json) under the current directory, then use the NuGet Library to restore the entire project's dependent library, then traverse each directory, build the project file, and continue to restore the dependencies in the project file
and experiment with dotnet run.
Here is I modified his binding address for http://*:5000, because the default is localhost:5000, but the time of the outside network access is a problem, check the information is said to be IP6 and IP4 reasons, so used the *, Using Useurls ("http://*:5000") in Program.cs
Then the browser visits to look at the effect:
Then I did the nginxd reverse proxy, yum install Nginx, and then modify the configuration file
Then perform the nginx-s reload restart Nginx configuration, then start the ASP. NET CORE program, enter 121.42.184.123 into the browser, and the results are as follows:
At this point, the ASP. NET Core program successfully tested on Linux, you can continue to execute dotnet publish instructions to package the release, packaging will generate a publish folder:
The browser accesses the results as well. Mood inexplicable excitement, loading big Microsoft.
Trying to manage the ASPNET core project with Supervisord, but due to the lack of configuration problems, Saturday to study, then prepare to study the ASPNET core project source code. Follow-up study will also be written out, hoping to make progress with everyone, the community's recent activity to let me right. NET is full of hope. Would like to cheer with you.
Reference: https://aspnet-aspnet.readthedocs-hosted.com/en/latest/client-side/yeoman.html
https://aspnet-aspnet.readthedocs-hosted.com/en/latest/
. NET Learning Technology Exchange Group: 226704167, willing to progress together with you!
Creation and release of ASP. NET Core MVC on Linux