高性能-可伸缩web服务器—OpenResty

发布于 2022-07-13  10 次阅读


7CA23D91-CC58-46D6-BF13-73134674D8BA.jpg

OpenResty(又称:ngx_openresty) 是一个基于 NGINX 的可伸缩的 Web 平台,由中国人章亦春发起,提供了很多高质量的第三方模块。

OpenResty 是一个强大的 Web 应用服务器,Web 开发人员可以使用 Lua 脚本语言调动 Nginx 支持的各种 C 以及 Lua 模块,更主要的是在性能方面,OpenResty可以 快速构造出足以胜任 10K 以上并发连接响应的超高性能 Web 应用系统。

360,UPYUN,阿里云,新浪,腾讯网,去哪儿网,酷狗音乐等都是 OpenResty 的深度用户。

基于centos7部署

部署OpenResty[二进制包]

# 安装源
[root@localhost ~]# wget https://openresty.org/package/centos/openresty.repo
[root@localhost ~]# mv openresty.repo /etc/yum.repos.d/
# 安装openresty
[root@localhost ~]# yum install -y openresty
# 安装命令行工具
[root@localhost ~]# yum install -y openresty-resty
# 列出所有软件包
[root@localhost ~]# yum --disablerepo="*" --enablerepo="openresty" list available
[root@localhost ~]# systemctl start openresty

部署OpenResty[源码编译]

# 安装依赖包
[root@localhost ~]# yum install pcre-devel openssl-devel gcc curl
[root@localhost ~]# wget https://openresty.org/download/openresty-1.21.4.1.tar.gz
[root@localhost ~]# tar -xzvf openresty-1.21.4.1.tar.gz
[root@localhost ~]# cd openresty-1.21.4.1/
[root@localhost ~]# ./configure
[root@localhost ~]# make
[root@localhost ~]# make install