Nginx installation (Linux CentOS)

Source: Internet
Author: User

"This article uses the source code compiles installs, including the concrete compilation parameter information"

1. Install make

Yum Install GCC Make 
-Y means auto Select Yes
GCC (GNU Compiler Collection) was originally a C-predicted compiler (GNU C Compiler), and later expanded into multiple languages C + +, Pascal, Objective-c, Java, renamed GNU Compiler Suite

2. Install g++ (c + + language compiler)

Yum Install GCC gcc-c++

3. Identify the source directory (in order to install the orderly, here we first determine the source directory)

# CD/USR/LOCAL/SRC
  This article installs the choice/USR/LOCAL/SRC as the source directory

4. Installing Pcre (Perl Compatible Regular Expressions)

In order to implement Nginx rewrite function, we need to compile and install the Pcre library. The rewrite function is to implement the rewrite of the URL. The rewrite rule is matched by the syntax rules of the PCRE (Perl-compatible regular expression).

Pcre Source Package Link: ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/, download the latest source package.

# cd/usr/local/wgetFTP://tar -zxvf pcre-8.38. Tar . gz# CD pcre-8.38#. /make makeinstall

5. Install the Zlib library (standard compression function library)

http://zlib.net/zlib-1.2.8.tar.gz Download the latest zlib source package and download the compile and install zlib package using the command below.

# cd/usr/local/wget http://zlib.net/zlib-1.2.8.tar.gztar -zxvf zlib- 1.2. 8. Tar . gz# CD zlib-1.2. 8 # . /make makeinstall

6. Install SSL

# cd/usr/local/wget http://www.openssl.org/source/openssl-1.1.0-pre1.tar.gz tar -zxvf openssl-1.1.0-pre1.tar.gz

7. Installing Nginx

# cd/usr/local/src#wgethttp//nginx.org/download/nginx-1.4.2.tar.gz#Tar-ZXVF nginx-1.4.2.Tar. gz# CD Nginx-1.4.2# ./configure--sbin-path=/usr/local/nginx/Nginx--conf-path=/usr/local/nginx/nginx.conf--pid-path=/usr/local/nginx/Nginx.pid--with-Http_ssl_module--with-pcre=/usr/local/src/pcre-8.38   --with-zlib=/usr/local/src/zlib-1.2.8   --with-openssl=/usr/local/src/openssl-1.0. 1c# Make#  Make Install
//--with-pcre=/usr/src/pcre-8.38 refers to the source path of pcre-8.38//--with-zlib=/usr/src/zlib-1.2.8 refers to zlib-1.2.8 source code path

8. Start, restart, shutdown

Start
# CD usr/local/nginx/sbin#. /nginx

Restart
#./nginx-s Reload

Shut down
# Nginx-s Stop//Fast stop Nginx

# Nginx-s Quit//full-ordered stop Nginx

Kill Nginx Service
# Ps-ef | grep nginx
# Kill -9 port number

Nginx installation (Linux CentOS)

Related Article

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.