以下操作均在CentOS中测试正常。
yum install gcc-c++ perl pcre make wget pcre-devel zlib zlib-devel openssl openssl-devel -y
下载nginx依赖软件包和源码包,并解压:
wget https://www.openssl.org/source/openssl-1.0.2s.tar.gz
wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
wget https://zlib.net/zlib-1.2.11.tar.gz
wget http://nginx.org/download/nginx-1.16.1.tar.gz
tar -xvf openssl-1.0.2s.tar.gz && tar -xvf pcre-8.43.tar.gz
tar -xvf zlib-1.2.11.tar.gz && tar -xvf nginx-1.16.1.tar.gz
编译nginx:(编译目录在/root/nginx中,可按需更改)
cd nginx-1.16.1
./configure \
--with-openssl=../openssl-1.0.2s \
--with-pcre=../pcre-8.43 \
--with-zlib=../zlib-1.2.11 \
--with-pcre-jit --user=root \
--prefix=/root/nginx \
--with-http_ssl_module \
--with-http_v2_module
配置过程未报错,进行编译:
make
make install
编译之后nginx将会被安装到“/root/nginx”路径下,Nginx的二进制文件在sbin目录下,配置文件在conf目录下。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文系转载,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。