Install Nginx1.7.4 on CentOS7.0

Source: Internet
Author: User
1. installation preparation 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] viewplaincopy. 1. 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. $ Yum install gcc-c ++
  2. $ Yum install pcre-devel
  3. $ Yum install zlib-devel
  4. $ Yum install openssl -- devel

 

II. install Nginx

 

Before installing nginx, check whether nginx is installed.

[Html]View plaincopy
  1. $ Find-name nginx

If the system has installed nginx, uninstall it first.

[Html]View plaincopy
  1. $ Yum remove nginx

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. $ Wget http://nginx.org/download/nginx-1.7.4.tar.gz

Decompress the nginx package

[Html]View plaincopy
  1. $ Tar-zxvf nginx-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. $ Nginx-1.7.4 cd

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

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

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

[Html]View plaincopy
  1. $ Whereis nginx

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.