安装 nginx
vim /etc/yum.repos.d/nginx.repo
1 2 3 4 5
| [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1
|
yum install -y nginx
开机自动启动
systemctl enable nginx.service
nginx 在线升级
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| nginx -V
mv /usr/local/nginx/sbin/nginx{,.old}
cd /usr/local/src
wget http://nginx.org/download/nginx-1.19.5.tar.gz
tar -zxf nginx-1.19.5.tar.gz cd nginx-1.19.5
/usr/local/nginx/sbin/nginx -V
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.44 --with-openssl=/usr/local/src/openssl-1.1.1s --with-stream=dynamic --add-module=/usr/local/iguard6/igdagent/modules/nginx/iguardloader
make -j 4
cd objs/
./nginx -V
./nginx -t
cp nginx /xxx/nginx/sbin/ cd ..
make upgrade
/usr/local/nginx/sbin/nginx -V
/usr/local/nginx/sbin/nginx -t
|
问题 openssl
可以使用单独的openssl 不和系统默认软件绑定
使用特定版本--with-openssl=/usr/local/src/openssl-1.1.1i
1 2 3
| //下载解压就可以了 wget https://www.openssl.org/source/openssl-1.1.1i.tar.gz tar -zxf openssl-1.1.1i.tar.gz
|
问题 pcre
跟openssl相同--with-pcre=/usr/local/src/pcre-8.44
1 2
| wget ftp://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz tar -zxf pcre-8.44.tar.gz
|