Linux安装openresty

一、openresty简介

OpenResty® 是一个基于Nginx与Lua的高性能Web平台,其内部集成了大量精良的Lua库、第三方模块以及大多数的依赖项。用于方便地搭建能够处理超高并发、扩展性极高的动态Web应用、Web服务和动态网关。

OpenResty® 通过汇聚各种设计精良的Nginx模块(主要由OpenResty团队自主开发),从而将Nginx有效地变成一个强大的通用Web应用平台。这样,Web开发人员和系统工程师可以使用Lua脚本语言调动Nginx支持的各种C以及Lua模块,快速构造出足以胜任10K乃至1000K以上单机并发连接的高性能Web应用系统。

OpenResty® 的目标是让你的Web服务直接跑在Nginx服务内部,充分利用Nginx 的非阻塞I/O模型,不仅仅对HTTP客户端请求,甚至于对远程后端诸如MySQL、PostgreSQL、Memcached以及Redis等都进行一致的高性能响应。

二、安装openresty

1源码安装openresty

1)安装依赖包

[root@localhost ~]# yum -y install pcre-devel openssl-devel gcc curl wget gcc-c++

2)源码安装openresty

[root@localhost ~]# wget https://openresty.org/download/openresty-1.21.4.1.tar.gz

3)解压

[root@localhost ~]# tar xf openresty-1.21.4.1.tar.gz

4)预编译

[root@localhost ~]# cd openresty-1.21.4.1

[root@localhost openresty-1.21.4.1]# ./configure –prefix=/usr/local/openresty –with-luajit –without-http_redis2_module –with-http_iconv_module

注:更多参数可通过./configure –help查看

5)编译及安装

[root@localhost openresty-1.21.4.1]# make && make install

6)启动openresty

[root@localhost openresty-1.21.4.1]# /usr/local/openresty/bin/openresty

7)访问openresty

# 浏览器输入http://192.168.0.199,如下图所示

Linux安装openresty

2yum安装openresty

1)下载openresty官方yum仓库

[root@localhost ~]# wget -O/etc/yum.repos.d/openresty.repo https://openresty.org/package/rhel/openresty.repo

2)安装openresty

[root@localhost ~]# yum -y install -y openresty

3)启动openresty

[root@localhost ~]# systemctl start openresty

4)访问openresty

# 浏览器输入http://192.168.0.199,如下图所示

Linux安装openresty

原创文章,作者:admin,如若转载,请注明出处:https://hostingchat.cn/1572.html

(0)
admin的头像admin
上一篇 2023年5月18日 上午11:28
下一篇 2023年7月11日 下午6:31

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注