wget https://www.openssl.org/source/openssl-1.1.0.tar.gz #下载OpenSSL源码包
wget https://ftp.pcre.org/pub/pcre/pcre-8.39.tar.gz #下载pcre源码包
wget http://www.zlib.net/zlib-1.2.11.tar.gz #下载zlib包源码/pre>
tar -zxvf 包名 #解压各个包源码
附一张目录结构图
找到nginx源码包中 configure 所在的目录,以下脚本就是基于configure来实现的,在本机上configure 命令就在auto 目录下,当前目录 /root/source/nginx 就在这个目录下编写脚本vi config.sh 加入以下内容
./auto/configure --prefix=/usr/local/nginx \
--with-pcre=../pcre-8.39 \
--with-openssl=../openssl-1.1.0 \
--with-zlib=../zlib-1.2.11 \
--with-http_v2_module \
--with-http_flv_module \
--with-http_mp4_module \
--add-module=../nginx-rtmp-module/
保存后给文件赋予操作权限,再执行
chmod 777 config.sh #赋予权限
./config.sh #执行脚本
检查配置没有问题