Nginx installation on Linux (CentOS)

  
        

When using Alibaba Cloud Server, we found it to be very clean and clean until almost nothing was installed. So we need to make some preparations when installing Nginx.

Installing Nginx requires SSL support and support for pcre

Support for installing pcre requires a C++ environment.

So, we need to install the C++ environment first.

This step is very simple. We directly input the command

yum install -y gcc gcc-c++

Car, OK.

If the installation fails, it is yum not installed or not found related files, or installed under Baidu, or configure other sites, not much to say here, baidu.

Then we started to install pcre support

I installed pcre-8.34

tar -zxvf pcre-8.34.tar.gz

cd pcre -8.34/

./configure --enable-utf8

make && make install

Next we start to install ssl

tar - Ixvf openssl-1.0.0l.tar.gz

cd openssl-1.0.0l

./configure

make && make install

Finally, install Nginx

Select the version you want to download

My current nginx-1.5.10

tar zxvf nginx-1.5.10.tar.gz

cd nginx-1.5.10

./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre-8.34 --with-http_ssl_module --with- Openssl=/usr/local/openssl-1.0.0l

make && make install

Here, your Nginx has been installed

Copyright © Windows knowledge All Rights Reserved