搭建OpenResty
本文最后更新于:2022年6月1日 下午
openresty官网:http://openresty.org/
安装之前首先要确认系统的基础环境
1. gcc编译器
1 |
|
2. curl库
1 |
|
3. pcre、zlib、openssl开发库(其openssl会依赖pcre和zlib)
1 |
|
4. 如启用postgres模块,还需安装postgresql开发库,否则会报错:ngx_postgres addon was unable to detect version of the libpq library
1 |
|
5. 准备OpenResty源码包官网下载连接:https://openresty.org/cn/download.html
① 准备安装openresty,解压源码包
1 |
|
② 设置配置选项
1 |
|
默认的prefix目录为:/usr/local/openresty,这里指定到/opt/openresty
–with-luajit在1.5.8.1之后已经默认开启,不加也是启用的
③ 编译并安装源码
1 |
|
6. cd到/opt/openresty/nginx/sbin/,./nginx
来启动nginx,./nginx -s reload
来重启nginx
搭建OpenResty
https://simple2ich4n.top/45893/