Nginx部署

在线安装

安装依赖包
	yum -y install gcc gcc-c++ autoconf automake
	yum -y install pcre pcre-devel
	yum -y install zlib zlib-devel
	yum -y install openssl opnessl-devel
下载编译Nginx
	cd /usr/local/src
	wget http://nginx.org/download/nginx-1.16.1.tar.gz
	tar -zxvf nginx-1.16.1.tar.gz
	./configure
	make
	make install
服务启停
	whereis nginx
	cd /usr/local/nginx
	cd sbin
	nginx				//启动nginx
	nginx -s reload		//重新载入配置文件
	nginx -s reopen		//重启nginx
	nginx -s stop		//停止nginx

离线安装

下载Nginx依赖包
  1. ssl功能需要 openssl
  2. gzip模块需要 zlib
  3. rewrite模块需要 pcre

依赖包安装顺序依次为:openssl,zlib,pcre,最后安装 Nginx 包

安装OpenSSL
[root@localhost wcw]# tar -zxvf openssl-fips-2.0.2.tar.gz 
[root@localhost wcw]# cd openssl-fips-2.0.2
[root@localhost openssl-fips-2.0.2]# ./config 
[root@localhost openssl-fips-2.0.2]# make
[root@localhost openssl-fips-2.0.2]# make install
安装zlib
[root@localhost wcw]# tar -zxvf zlib-1.2.7.tar.gz
[root@localhost wcw]# cd zlib-1.2.7
[root@localhost zlib-1.2.7]# ./configure 
[root@localhost zlib-1.2.7]# make
[root@localhost zlib-1.2.7]# make install
安装pcre
[root@localhost wcw]# tar -zxvf pcre-8.21.tar.gz
[root@localhost wcw]# cd pcre-8.21
[root@localhost pcre-8.21]# ./configure 
[root@localhost pcre-8.21]# make
[root@localhost pcre-8.21]# make install
安装Nginx
[root@localhost wcw]# tar -zxvf nginx-1.12.2.tar.gz 
[root@localhost wcw]# cd nginx-1.12.2
[root@localhost nginx-1.12.2]# ./configure --prefix=/usr/install/nginx --with-pcre=../pcre-8.21 --with-zlib=../zlib-1.2.7 --with-openssl=../openssl-fips-2.0.2
[root@localhost nginx-1.12.2]# make
[root@localhost nginx-1.12.2]# make install
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值