- 从官网上下载源码压缩包
wget https://openresty.org/download/openresty-1.13.6.2.tar.gz
- 解压缩
tar -zxvf openresty-1.13.6.2.tar.gz
- 编译前的配置工作
cd openresty-1.13.6.2
./configure
注:报错信息及解决方案
(1)报错一:
/usr/bin/env: perl: 没有那个文件或目录
解决方案:
需要安装Perl
(2)报错二:
./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.
解决方案:
yum -y install openssl openssl-devel
使用参数“–help ”可以列出configure 的详细说明
--prefix= /opt/openresty #指定安装到/opt/openresty 目录下
--with-http_v2_module #支持HTTP2
--with-http_realip_module #反向代理时可转发客户

本文介绍了如何从官方源码安装OpenResty,包括下载、解压、配置和解决编译过程中的错误,如需安装Perl和查看configure参数。
最低0.47元/天 解锁文章
1894

被折叠的 条评论
为什么被折叠?



