Install Nginx1.10.2 in CentOS6.5

Source: Internet
Author: User

Install Nginx1.10.2 in CentOS6.5
1. Prepare the environment (tools used include Xshell5 and xftp5)

yum -y install gcc gcc-c++ autoconf automake make
  • 1
  • 1

yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-deve
  • 1
  • 1

2. Download nginx installation package nginx Official Website: http://nginx.org/en/download.html

Download the SDK directly under the opt directory:
wget http://nginx.org/download/nginx-1.10.2.tar.gz
  • 1
  • 1
If the ecs cannot be downloaded, download the compressed package from the official website, transfer it to the ecs through xftp, and decompress the package:
tar -zxvf nginx-1.10.2.tar.gz
  • 1
  • 1
Switch the directory after decompression
cd nginx-1.10.2
  • 1
  • 1
3. Install Configuration
./configure
  • 1
  • 1
Then you will see the following errors

→ Install pcre
yum install pcre-devel.i686
  • 1
  • 1


Enter y and press Enter.

Tip: The last prompt is Complete !, It indicates that your things have been installed successfully.→ Install zlib
yum -y install make zlib zlib-devel gcc-c++ libtool
  • 1
  • 1
Run./configure again and the same error occurs because the installation location of pcre cannot be found. Run the following command:
find -name pcre
  • 1
  • 1
Get:./auto/lib/pcre

Add a parameter to specify path after./configure
./configure --with-pcre=./auto/lib/pcre
  • 1
  • 1
Configuration successful, for example:

Install openssl
yum -y install openssl openssl-devel
  • 1
  • 1

Run make & make install with the following error:

If the installation fails or an error is reported, run the following command to solve the problem:
yum -yinstall zlib zlib-devel openssl openssl--devel pcre pcre-devel
  • 1
  • 1
Run the following command:
./configure --prefix=/usr/local/nginx
  • 1
  • 1
Run the following command:
make && make install
  • 1
  • 1

Installation Complete !!!

Switch the Directory and start nginx

cd /usr/local/nginx./nginx
  • 1
  • 2
  • 1
  • 2
Open your browser and enter your server IP address. This page appears, indicating that your nginx configuration is successful.

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.