使用yum安装nginx

ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
http://nginx.org/en/download.html
http://zlib.net/fossils/
https://www.openssl.org/source/old/

一键安装需要的所有依赖
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
nginx下载地址
http://nginx.org/download/
安装nginx

直接用yum -y install nginx也可以,但是默认的安装目录和平时使用的不太一样,因此采用手动安装的形式。

解压nginx安装包,从上面的地址官网下载
[root@hadoop soft]# tar -zxvf nginx-1.15.6.tar.gz 
进入到解压的目录
[root@hadoop soft]# cd nginx-1.15.6
编译一下,configure后面有很多参数,可以使用./configure --help 来查看,如果需要使用SSL和正则表达式,需要指定openssl 和pcre的安装目录,要不然可能默认路径不一定是依赖包的安装目录,zlib是压缩的依赖包。
执行编译命令
[root@hadoop nginx-1.15.6]# ./configure 
执行make和安装命令
[root@hadoop nginx-1.15.6]# make && make install
安装完之后看下这个目录是不是有东西。
/usr/local/nginx
进入到这个目录执
cd  /usr/local/nginx/sbin
启动nginx命令
[root@hadoop sbin]# ./nginx -c /usr/local/nginx/conf/nginx.conf
检测nginx配置文件是否正常
[root@hadoop sbin]# ./nginx -t -c /usr/local/nginx/conf/nginx.conf
nginx平滑启动
[root@hadoop sbin]# ./nginx -s reload
查看openssl 的安装目录
[root@hadoop nginx]# whereis openssl 
  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值