centos 8 源码安装openresty-1.19.3.1版本

1、下载openresty-1.19.3.1 源码包

wget https://openresty.org/download/openresty-1.19.3.1.tar.gz

2、下载openssl prce zlib

wget https://www.openssl.org/source/openssl-1.0.2k.tar.gz
wget https://jaist.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
wget http://download.zhufunin.com/pcre-8.42.tar.gz  或者
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.42.tar.gz

3、解压、建议找一个目录,放在一起,我的是 /home/openresty

mkdir -p /usr/local/software

解压上面的4个文件

 tar zxvf openresty-1.19.3.1.tar.gz
 tar zxvf openssl-1.0.2k.tar.gz 
 tar zxvf  zlib-1.2.11.tar.gz
 tar zxvf  pcre-8.42.tar.gz

4、安装 openresty

yum install -y gcc gcc-c++ perl-devel perl-ExtUtils-Embed
 模块--with-http_stub_status_module 在nginx_status的时候会用到
 cd //usr/local/software/openresty-1.19.3
./configure --with-select_module --with-poll_module --with-file-aio --with-http_ssl_module --with-http_realip_module --with-http_gzip_static_module --with-http_secure_link_module --with-http_sub_module --with-http_stub_status_module --with-http_perl_module --with-openssl=/usr/local/software/openssl-1.0.2k --with-pcre=/usr/local/software/pcre-8.42  --with-zlib=/usr/local/software/zlib-1.2.11
gmake  && gmake install

5启动 openresty

cd /usr/local/openresty/nginx
./sbin/nginx

6、查看是否启动

netstat  -nltp | grep "nginx"

7、安装成功之后,可以直接拷贝到另外一台服务器上,直接启动,拷贝openresty
打包

tar zcvf openresty.tar.gz openresty
cd /usr/local/lib64
tar zcvf perl5.tar.gz perl5

然后拷贝到新服务器目录/usr/local

cd /usr/local
tar zxvf openresty.tar.gz
cd /usr/local/lib64
tar zxvf perl5.tar.gz

需要拷贝perl5目录,否则启动会失败,缺少perl模块
报错信息如下

Can't locate nginx.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
nginx: [alert] perl_parse() failed: 2
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值