Original CENTOS7 Configuring ASP. NET Core from zero compilation

Source: Internet
Author: User
Tags dotnet

Preface

It's a tough time to play. In addition to the compiler using Yum installation, all others are compiled manually. Hum ~

Seemingly on Nginx, PHP, MySQL three east, but they are too much to rely on others.

There is no way to use them to be honest with them to provide the things they want.

Some of the first modules depend on some Lib libraries,

If you are lazy, just follow the instructions below and enter them separately. Then look directly at the configuration chapter. (But this is not the latest version of the installation of Yo)

Directory

First, the preparatory work

Second, install. NET Core 2.0

Third, install Nginx

Iv. Configuration

First, the preparatory work

1.1 Installing or updating GCC gcc-c++

Because I installed the CentOS is absolutely pure drops. There's nothing. No more. The compiler must be installed first.

# yum Install gcc gcc-c++

1.2 Creating a directory to use

Source is the folder used to store the source code. The package is used to store the compiled library files. Lnmp is what we really need to put inside. (nginx+mysql+memcached+php)

mkdir /source/
mkdir /package/
mkdir /web/

 

Second, install. NET Core

2.1 Libunwind

#yum Install Libunwind

2.2 Libicu

#yum Install Libicu

2.3. NET Core

[Official website] Https://www.microsoft.com/net/download/linux

Command flow:

#mkdir/web/dotnet#wget https://download.microsoft.com/download/1/b/4/ 1b4de605-8378-47a5-b01b-2c79d6c55519/dotnet-sdk-2.0.0-linux-x64.tar.gz#tar-zxvf dotnet-sdk-2.0. 0-linux-x64.tar.gz
#ln-S/web/dotnet/dotnet/usr/local/bin

Second, install Nginx

2.1 Installing Pcre

[Official website] http://www.pcre.org/

PCRE (perl Compatible Regular Expressions) is a Perl library that includes a Perl-compatible regular expression library. The Nginx HTTP module uses PCRE to parse the regular expression, so the Pcre library needs to be installed on Linux, and Pcre-devel is a two-time development library using Pcre. Nginx also needs this library.

Command flow:

Yum install pcre pcre-devel

2.2 Installing Zlib

[Official website] http://zlib.net/

The Zlib library provides a number of ways to compress and decompress, and Nginx uses zlib to gzip the contents of the HTTP package, so you need to install the Zlib library on Centos.

Command flow:

yum install zlib zlib-devel

2.3 Installing Nginx

[Official website] http://nginx.org/

Command flow:

CD /source/
wget http://nginx.org/download/nginx-1.12.0.tar.gz tar -zxvf nginx-1.12. 0cd nginx-1.12. 0#. /configure--prefix=/lnmp/nginx make do install

Small summary:

Here, the Nginx installation is complete. We can satisfy the desire of our own heart first. Open the Nginx service to see Hello World.

Start Nginx

#/lnmp/nginx/sbin/nginx

After launch, you can open the page in the browser and the Nginx default page will be displayed.

Third, configure Nginx

3.1 Opening nginx.conf

Vim nginx.conf

3.2 Modify into

Remove a red marked character
# Pass the PHP scripts to FastCGI server listening on127.0.0.1:9000## Location~\.php$ {# root html; # Fastcgi_pass127.0.0.1:9000; # Fastcgi_index index.php; # Fastcgi_param script_filename/ scripts$fastcgi _script_name; # include Fastcgi_params; #} # Pass the PHP scripts to FastCGI server listening on127.0.0.1:9000#location~\.php$ {root html; Fastcgi_pass127.0.0.1:9000; Fastcgi_index index.php; Fastcgi_param script_filename $document _root$fastcgi _script_name; Include Fastcgi_params;}

Small summary:

The above modification allows Nginx to forward the PHP dynamic script request.

However, it is not possible to open the PHP file yet because PHP-FPM has not been opened yet.

We continue to look down.

Attached, commonly used commands

Nginx Common Commands

#/lnmp/nginx/sbin/nginx             //start Nginx
#/lnmp/nginx/sbin/nginx-s Reload //restart Nginx
#/lnmp/nginx/sbin/nginx-s Stop //off Nginx

Original CENTOS7 Configuring ASP. NET Core from zero compilation

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.