CentOS6.5 install Nginx1.10.2

Source: Internet
Author: User

CentOS6.5 install Nginx1.10.2
Download the latest version 1.10.2 from the official website

Nginx-1.10.2.tar.gz

Install Nginx dependency package
  • GCC
    Nginx is developed in C language.
# yum install gcc-c++ 
  • PCRE (Perl Compatible Regular Expressions) is a Perl library, including a perl-Compatible Regular Expression Library. The http module of nginx uses pcre to parse regular expressions.
# yum install -y pcre pcre-devel
  • The zlib library provides many compression and decompression methods. Nginx uses zlib to perform gzip on the http package content.
# yum install -y zlib zlib-devel
  • Openssl OpenSSL is a powerful Secure Socket Layer cryptographic library, which includes the main cryptographic algorithms, common keys, certificate encapsulation management functions, and SSL protocols, and provides a wide range of applications for testing or other purposes. Nginx not only supports http, but also supports https (that is, transmission of http over ssl ).
# yum install -y openssl openssl-devel
Install
  • Copy the compressed package/Root/Downloads directory

  • Decompress the package to the local directory.

# tar zxvf nginx-1.10.2.tar.gz 
  • Use the configure command to configure attributes before compilation.
# cd nginx-1.10.2# ./configure \--prefix=/usr/local/nginx \--pid-path=/var/run/nginx/nginx.pid \--lock-path=/var/lock/nginx.lock \--error-log-path=/var/log/nginx/error.log \--http-log-path=/var/log/nginx/access.log \--with-http_gzip_static_module \--http-client-body-temp-path=/var/tmp/nginx/client \--http-proxy-temp-path=/var/tmp/nginx/proxy \--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi \--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \--http-scgi-temp-path=/var/tmp/nginx/scgi
  • Prefix specifies the Nginx installation directory

  • You must manually create an nginx folder in the/var/tmp/directory.

# cd /var/tmp/# mkdir nginx
  • Switch back to the nginx-1.10.2 directory
# cd /root/Downloads/nginx-1.10.2
  • Compile (A Makefile file is generated by using the configure command)
# make
  • Install
# make install
Start
  • Go to the Nginx installation directory
# cd /usr/local/nginx/
  • Enter the program execution directory
# cd sbin
  • Command
#./Nginx // start #./nginx-s stop // stop #./nginx-s reload // re-read the configuration
  • You can check whether the startup is successful through http: // ip

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.