Linux安装openresty

小柒博客 Openresty评论4641字数 1349阅读4分29秒阅读模式

一、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,如下图所示

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

若文章图片、下载链接等信息出错,请在评论区留言反馈,博主将第一时间更新!如本文“对您有用”,欢迎随意打赏,谢谢!

继续阅读
Wechat
微信扫一扫,加我!
weinxin
微信公众号
微信扫一扫,关注我!
weinxin
小柒博客
  • 本文由 小柒博客 发表于 2023年6月9日14:19:40
  • 声明:本站所有文章,如无特殊说明或标注,本站文章均为原创。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。转载请务必保留本文链接:https://www.yangxingzhen.com/9186.html
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

拖动滑块以完成验证