Install Nginx 1.7.4 on CentOS7.0

Source: Internet
Author: User

Install Nginx 1.7.4 on CentOS7.0
I. Installation preparation

First, some modules of nginx depend on some lib libraries. Therefore, you must install these lib libraries before installing nginx, these dependent libraries mainly include g ++, gcc, openssl-devel, pcre-devel, and zlib-devel. Therefore, run the following command to install

[Html] view plaincopy
  1. $ Yuminstallgcc-c ++
  2. $ Yuminstallpcrepcre-devel
  3. $ Yuminstallzlibzlib-devel
  4. $ Yuminstallopensslopenssl -- devel

Ii. Install Nginx

Before installing nginx, check whether nginx is installed.

[Html] view plaincopy
  1. $ Find-nameng.pdf

If the system has installed nginx, uninstall it first.

[Html] view plaincopy
  1. $ Yumremoveng.pdf

First, go to the/usr/local directory.

[Html] view plaincopy
  1. $ Cd/usr/local

Download the latest nginx version from the official website

[Html] view plaincopy
  1. $ Wgethttp: // nginx.org/download/nginx-1.7.4.tar.gz

Decompress the nginx package

[Html] view plaincopy
  1. $Tar-zxvfnginx-1.7.4.tar.gz

A nginx-1.7.4 directory is generated and you enter the nginx-1.7.4 directory

[Html] view plaincopy
  1. $ Cdnginx-1.7.4

Next, use the -- prefix parameter to specify the nginx installation directory, and install make and makeinstall.

[Html] view plaincopy
  1. $./Configure $ installed in/usr/local/nginx by default
  2. $ Make
  3. $ Makeinstall

If no error is reported, check the nginx installation directory.

[Html] view plaincopy
  1. $ Whereisnginx

After installation, you can start or stop the directory (/usr/local/nginx) after installation.

At this point, the installation of nginx using CentOS has been completed. In fact, it is quite simple.

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.