First, install the compilation tool and the library file
Yum-y install make zlib zlib-devel gcc-c++ libtool OpenSSL openssl-devel
second, the first to install PCRE
PCRE function is to let Ngnix support Rewrite function.
1, download PCRE installation package, download address: http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
[Root@bogon src]# wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz
2, Decompression installation package:
[Root@bogon src]# tar zxvf pcre-8.35.tar.gz
3, into the installation package directory
[Root@bogon src]# CD pcre-8.35
4. Compile and install
[Root@bogon pcre-8.35]#./configure
[Root@bogon pcre-8.35]# make && make install
5, view Pcre version
[Root@bogon pcre-8.35]# Pcre-config--version
Install Nginx
1, download Nginx, download address: http://nginx.org/download/nginx-1.6.2.tar.gz
[Root@bogon src]# wget http://nginx.org/download/nginx-1.6.2.tar.gz
2, Decompression installation package
[Root@bogon src]# tar zxvf nginx-1.6.2.tar.gz
3, into the installation package directory
[Root@bogon src]# CD nginx-1.6.2
4. Compile and install
./configure && make && make install
5. After the installation completes, may start the Nginx:
/usr/local/nginx/sbin/nginx-c/usr/local/nginx/conf/nginx.conf
There may be an error/usr/local/nginx/sbin/nginx:error while loading shared libraries:libpcre.so.1:cannot open Shared object File:no s Uch file or directory
Solution:
You can tell from the error message that the Lib file is missing and that the details are further viewed:
1 |
# LDD $ (Which/usr/local/nginx/sbin/nginx) |
2 |
libpthread.so.0 =>/lib64/libpthread.so.0 (0x00000030e8400000) |
3 |
Libcrypt.so.1 =>/lib64/libcrypt.so.1 (0x00000030f9a00000) |
4 |
Libpcre.so.1 => not found |
5 |
Libcrypto.so.6 =>/lib64/libcrypto.so.6 (0x00000030f2a00000) |
6 |
Libz.so.1 =>/lib64/libz.so.1 (0x00000030e8800000) |
7 |
Libc.so.6 =>/lib64/libc.so.6 (0x00000030e7800000) |