Enter: /usr/java/nginx location
Download nginx: wget http://nginx.org/download/nginx-1.8.0.tar.gz
Download openssl: wget http://www.openssl.org/source/openssl- fips-2.0.9.tar.gz
download zlib : wget http://zlib.net/zlib-1.2.8.tar.gz
download pcre : wget ftp://ftp.csx.cam.ac.uk/pub/ software/programming/pcre/pcre-8.38.tar.gz
If the c++ compilation environment is not installed, you have to install it, and complete the installation through yum install gcc-c++
Next, compile and install
openssl:
[root@localhost] tar zxvf openssl-fips-2.0.9.tar.gz
[root@localhost] cd openssl-fips-2.0.9
[root@localhost] ./config && make && make install
pcre:
[root@localhost] tar zxvf pcre-8.36.tar.gz
[root@localhost] cd pcre-8.36
[root@localhost] ./configure && make && make install
zlib:
[root@localhost]tar zxvf zlib-1.2.8.tar.gz
[root@localhost] cd zlib-1.2.8
[root@localhost] ./configure && make && make install
Finally install nginx
[root@localhost]tar zxvf nginx-1.8.0.tar.gz
[root@localhost] cd nginx-1.8.0
[root@localhost] ./configure && make && make install
启动nginx
/usr/local/nginx/sbin/nginx
出现错误提示
[root@localhost lib]# error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
The reason is that the pcre file read by nginx on a RedHat 64-bit machine is the /lib64/libpcre.so.1 file. When pcre is installed by default, the libpcre.so file is installed in the /usr/local/lib/ directory, so enter /opt/nginx /sbin/nginx -V File path not found! !
1. First make sure that pcre is installed.
2. Switch the path: cd /usr/local/lib Execute ln -s /usr/local/lib/libpcre.so.1 /lib64/
3. Add a soft link /usr/ under root permissions local/lib/libpcre.so.1 to /lib64/: ln -s /usr/local/lib/libpcre.so.1 /lib64/