centos7编译安装nginx及无缝升级https
Posted ㄓㄤㄑㄧㄤ
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7编译安装nginx及无缝升级https相关的知识,希望对你有一定的参考价值。
安装依赖:
- yum install -y gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
- wget -c https://nginx.org/download/nginx-1.10.1.tar.gz
- tar -zxvf nginx-1.10.1.tar.gz
- cd nginx-1.10.1
1、默认配置
- ./configure
- ./configure \
- --prefix=/usr/local/nginx \
- --conf-path=/usr/local/nginx/conf/nginx.conf \
- --pid-path=/usr/local/nginx/conf/nginx.pid \
- --lock-path=/var/lock/nginx.lock \
- --error-log-path=/var/log/nginx/error.log \
- --http-log-path=/var/log/nginx/access.log \
- --with-http_gzip_static_module \
- --http-client-body-temp-path=/var/temp/nginx/client \
- --http-proxy-temp-path=/var/temp/nginx/proxy \
- --http-fastcgi-temp-path=/var/temp/nginx/fastcgi \
- --http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
- --http-scgi-temp-path=/var/temp/nginx/scgi
- make
- make install
- vi /etc/rc.local
- /usr/local/nginx/sbin/nginx
- chmod 755 /etc/rc.local
- cd /usr/local/nginx/sbin/
- ./nginx
- ./nginx -s stop
- ./nginx -s quit
- ./nginx -s reload
1、查看nginx是否支持ssl:1、查看nginx是否支持ssl:
- /usr/local/nginx/sbin/nginx -V
- ./configure --with-http_ssl_module
- make
- mv /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.old
3、把新编译的nginx执行脚本拷贝到相应的目录下:
- cd objs/
- cp nginx /usr/local/nginx/sbin/
- cd ..
- make upgrade
- cd /usr/local/nginx/conf
- vim nginx.conf
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/dreamsqifan/article/details/73467672
以上是关于centos7编译安装nginx及无缝升级https的主要内容,如果未能解决你的问题,请参考以下文章