. NET core Web publishing to CentOS Rollup

Source: Internet
Author: User
Tags nginx reverse proxy

Until today my blog can finally see the world, the middle lazy for a long time, nothing to do, nor how to learn, the previous period is also a variety of tossing, careless learning. This article summarizes the issues from the beginning to the present, as a learning note. My blog is my study notes, because found no matter in the future work or study, we will encounter the problems encountered before, and then go to the garden to turn other people's blog, is undoubtedly a waste of time, and if encountered up and down incoherent content, or delay longer time, So I write myself can understand the blog as their own learning notes is the best way to learn. About CSDN and blog Park, I generally write in the csdn and then copied to the blog park, if more than the direct migration of the past, no other reason, is to compare like CSDN editor, see the pleasing. Cut to the chase:

First, at the beginning of learning. NET core, came up to learn how to publish in CentOS to use. NET core projects, haha C # write things actually ran to Linux, which in the past, but can not think of, so a little bit of learning, a command of learning, For me this kind of Linux small white is really too hard, but still a little run up, at that time just simple to the. NET core of the default Web run up, with the Nginx reverse proxy, the http://localhost:5000 forwarded to the 80 port, With supervisor, it turns our command-line process into a daemon that can run in the background, so we don't have to see that black box, and we can monitor the running state of the process in real time, and if it's dead, try restarting it right away, both of which are essential two tools for me to run my blog.

Second, say my blog, my blog will be the front-end and the background management separate implementation, in the background, I used the Layui, is also a classic modular front-end framework, or relatively easy to use, with its list, text boxes, buttons, Rich text editor, as well as paging and so on, used up is also very convenient, simple display effect:

Front end I used the bootstrap as UI display, implementation of responsive layout, or relatively beautiful, of course, the template is also directly downloaded, but also used to ANJULARJS for page filling and request data, bootstrap as a front-end frame, it is really beautiful, And Angularjs has the next generation of Web applications is not too much, I use it, mainly tied to the front of the blog content is particularly convenient, directly also used a special small JS library, called Dot.js, have a template means, very easy to use, simple code display (of course I just used a few):

This get request method really is changed too personality, before learning angularjs when there is no such writing, resulting in a use of error, I printed the data to the console, you can view the returned data format, the following front page binding:

This is the code that the blog binds to, is not and dot.js special like, but more flexible than he, I do not need a template, I can directly very wayward to bind the data, what do not need to tube, the unique ng-command is also very comfortable, including the format of the time and the content of the blog word limit, is not very powerful. Here are the Bower libraries I used:

Maybe some people think I use too messy, too miscellaneous, indeed, I want to try to use the next, do not like to spray freely, do not matter.

Database operations I am using a lightweight ORM framework dapper, which is now open source, can be restored directly in NuGet, it is also very efficient, about this in my previous blog has been introduced, in this version I did not use what EF, or use the traditional way, The implementation of the database operation, after the project will continue to upgrade, the use of more new things, the front desk to show what should not be updated, mainly want to learn the next. NET core new things. Put a few more pictures:

There are written content I did not realize, just do the blog content display and the details page and the right of the number of statistics, followed by the pagination Plus, the content is relatively simple.

Third, when I realized the data binding time ago, think finally can be put on the outside of the Internet, but in the release to the CentOS when the problem is riddled with, the first problem encountered is Jiangzi

Silly for this problem for a long time, how will always be this error, there is no detailed error, only to find the default error page content is this, and then various modes of various attempts, but has always been this error, here to say the aspnetcore_enviroment of the three environment variables.

The above is about the multi-environment introduction, directly patted the contents of the book, it may be too long time the reason, forgot to configure the daemon in the Supervisor environment variables,

Here the process environment variable is production, I try to change it to development, incredibly can (doubt one), but there is a new problem, the database connection time-out, the configuration file I configured is another server database address, prompt timeout problem, Found that some people have encountered similar problems, see here, Blogger said is the database version of the problem, it is true that I use a relatively low version, have not tried the high version can (question two), and then I boldly used the MSSQL for Linux, which is why I used the MSSQL for Linux Reason, because there is no way. Finally, finally my blog can let others see.

Only in this blog record to do this demo encountered problems and solutions, there are some remaining problems, follow-up further research.

My blog address: http://www.dayali.net/Home back office Address: Http://www.dayali.net/Admin/Home Welcome to visit!

Source code Address: Https://github.com/Allen0910/DayaliBlog

. NET core Web publishing to CentOS Rollup

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.