1)yum直接安装依赖包
yum install pcre-devel pcre gcc gcc-c++ zlib-devel zlib openssl* -y (安装依赖)
tar -zxvf nginx-1.14.1.tar.gz
cd /software/nginx-1.14.1
adduser nginx (添加系统用户)
./configure --prefix=/software/nginx --user=nginx --group=nginx --with-stream --with-http_ssl_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_flv_module (根据自己需要安装相应模块和插件)
make (编译)
make install (安装)
2) 依赖包源码安装(默认安装的openssl、pcre等版本较低,可到官网下载较新稳定版源码去安装,安全性高点)
版本:redhat 7.4 ,zlib-1.2.8,pcre-8.34,nginx-1.14.0
[root@xsbfwbtest pcre-8.34]# ./configure
......
[root@xsbfwbtest pcre-8.34]# make
cd . && /bin/sh /software/tools/pcre-8.34/missing automake-1.14 --gnu
/software/tools/pcre-8.34/missing: line 81: automake-1.14: command not found
WARNING: 'automake-1.14' is missing on your system.
You should only need it if you modified 'Makefile.am' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'automake' program is part of the GNU Automake package:
<http://www.gnu.org/