https://github.com/openresty/openresty/tags里边有openresty
各个版本的源码。
https://openresty.org/en/是官网。
wget https://github.com/openresty/openresty/archive/refs/tags/v1.15.8.1.tar.gz
(github网址)或者wget https://openresty.org/download/openresty-1.15.8.1.tar.gz
(官网)下载源码包。
tar zxf openresty-1.15.8.1.tar.gz && cd openresty-1.15.8.1
解压文件。
./configure --prefix=/usr/local/openresty
,源码里边已经有环境配置了,但是需要使用此步骤进行匹配,比如内核版本、gcc安装目录和版本,同时也说明将会安装到/usr/local/openresty
目录里边。
发现报错如下:
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
ERROR: failed to run command: sh ./configure --prefix=/usr/local/openresty/nginx \...
yum install -y pcre-devel
安装pcre-devel
。
再次执行./configure --prefix=/usr/local/openresty
。
发现报错如下:
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
ERROR: failed to run command: sh ./configure --prefix=/usr/local/openresty/nginx \...
yum install -y openssl
安装openssl
。
再次执行./configure --prefix=/usr/local/openresty
。
发现还是报错如下:
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
ERROR: failed to run command: sh ./configure --prefix=/usr/local/openresty/nginx \...
yum install -y openssl-devel
安装openssl-devel
。
再次执行./configure --prefix=/usr/local/openresty
。
完成之后,如下图所示:
gmake
进行编译。
完成如下:
gmake install
进行安装。
完成之后如下:
此文章为6月Day 24学习笔记,内容来源于极客时间《Linux 实战技能 100 讲》。