1、先装支持的类库
下载安装包、解压
1 |
tar -zxvf |
1 |
yum -y install make cmake gcc gcc-c++ pcre pcre-devel zlib zlib-devel autoconf libtool glibc-devel openssl openssl-devel unzip vim gd gd-devel libxml2 libxml2-devel curl-devel libmcrypt |
2、编译安装模块
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
./configure \ --prefix=/data/software/nginx \ --sbin-path=/data/software/nginx/sbin/nginx \ --conf-path=/data/software/nginx/nginx.conf \ --pid-path=/data/software/nginx/pid/nginx.pid \ --error-log-path=/data/software/nginx/log/error.log \ --http-log-path=/data/software/nginx/log/access.log \ --user=nginx \ --group=nginx \ --with-http_ssl_module \ --with-http_v2_module \ --with-http_realip_module \ --with-http_sub_module \ --with-http_gzip_static_module \ --with-http_stub_status_module \ --with-http_image_filter_module=dynamic \ --with-stream \ --with-stream_realip_module \ --with-stream_ssl_module \ --with-pcre |
3、可能出现的问题
1 |
useradd nginx -s /sbin/nologin -M |