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
yum -y install zlib zlib-devel openssl openssl--devel pcre pcre-deve
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
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
Switch the directory after decompression
cd nginx-1.10.2
3. Install Configuration
./configure
Then you will see the following errors
→ Install pcre
yum install pcre-devel.i686
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
Run./configure again and the same error occurs because the installation location of pcre cannot be found. Run the following command:
find -name pcre
Get:./auto/lib/pcre
Add a parameter to specify path after./configure
./configure --with-pcre=./auto/lib/pcre
Configuration successful, for example:
Install openssl
yum -y install openssl openssl-devel
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
Run the following command:
./configure --prefix=/usr/local/nginx
Run the following command:
make && make install
Installation Complete !!!
Switch the Directory and start nginx
cd /usr/local/nginx./nginx
Open your browser and enter your server IP address. This page appears, indicating that your nginx configuration is successful.