【原创】运维基础之OpenResty
openresty 1.15.8.1

官方:https://openresty.org/en/
一 简介
OpenResty® is a dynamic web platform based on NGINX and LuaJIT.
openresty是一个基于nginx和luajit的动态web平台;
OpenResty® is a full-fledged web platform that integrates the standard Nginx core, LuaJIT, many carefully written Lua libraries, lots of high quality 3rd-party Nginx modules, and most of their external dependencies. It is designed to help developers easily build scalable web applications, web services, and dynamic web gateways.
openresty是一个丰富的web平台,将标准nginx内核、luajit、多个lua库,多个第三方nginx模块以及依赖整合在一起;
By taking advantage of various well-designed Nginx modules (most of which are developed by the OpenResty team themselves), OpenResty® effectively turns the nginx server into a powerful web app server, in which the web developers can use the Lua programming language to script various existing nginx C modules and Lua modules and construct extremely high-performance web applications that are capable to handle 10K ~ 1000K+ connections in a single box.
利用设计良好的nginx模块,openresty将nginx高效的变为一个web应用服务器,开发者可以通过lua来调用nginx模块和lua模块,并且构建极端高效的web应用,轻松应用10k-1000k的连接数;
OpenResty® aims to run your server-side web app completely in the Nginx server, leveraging Nginx's event model to do non-blocking I/O not only with the HTTP clients, but also with remote backends like MySQL, PostgreSQL, Memcached, and Redis.
openresty使你的服务端应用完全运行在nginx上,并且将nginx的事件模型应用到很多方面;
Real-world applications of OpenResty® range from dynamic web portals and web gateways, web application firewalls, web service platforms for mobile apps/advertising/distributed storage/data analytics, to full-fledged dynamic web applications and web sites. The hardware used to run OpenResty® also ranges from very big metals to embedded devices with very limited resources. It is not uncommon for our production users to serve billions of requests daily for millions of active users with just a handful of machines.
OpenResty® is not an Nginx fork. It is just a software bundle. Most of the patches applied to the Nginx core in OpenResty® have already been submitted to the official Nginx team and most of the patches submitted have also been accepted. We are trying hard not to fork Nginx and always to use the latest best Nginx core from the official Nginx team.
openresty不是一个nginx分支,它只是一个软件的组合包;
二 安装
1 tar包编译安装
tar -xvf openresty-VERSION.tar.gz
cd openresty-VERSION/
./configure -j2
make -j2
sudo make install
参考:https://openresty.org/en/installation.html
2 docker安装
$ docker run -d --name resty -p 80:80 host openresty/openresty
参考:https://hub.docker.com/r/openresty/openresty
三 使用
访问:http://127.0.0.1:80

默认的nginx.conf位于 /usr/local/openresty/nginx/conf/nginx.conf (不是 /etc/nginx/nginx.conf),默认会加载所有/etc/nginx/conf.d/下的配置文件
include /etc/nginx/conf.d/*.conf;
准备测试配置
# cat testlua.conf
server {
listen 80;
server_name testlua;
location / {
default_type text/html;
content_by_lua '
ngx.say("<p>hello, world</p>")
';
}
}
启动
# docker run -d --name resty -p 80:80 -v /path/testlua.conf:/etc/nginx/conf.d/testlua.conf openresty/openresty
测试
# curl http://testlua -x 127.0.0.1:80
<p>hello, world</p>
【原创】运维基础之OpenResty的更多相关文章
- 【原创】运维基础之OpenResty(Nginx+Lua)+Kafka
使用docker部署 1 下载 # wget https://github.com/doujiang24/lua-resty-kafka/archive/v0.06.tar.gz# tar xvf v ...
- Linux运维基础
一.服务器硬件 二.Linux的发展史 三.Linux的系统安装和配置 四.Xshell的安装和优化 五.远程连接排错 六.Linux命令初识 七.Linux系统初识与优化 八.Linux目录结构 九 ...
- 第一阶段·Linux运维基础-第1章·Linux基础及入门介绍
01-课程介绍-学习流程 02-服务器硬件-详解 03-服务器核心硬件-服务器型号-电源-CPU 01-课程介绍-学习流程 1.1. 光看不练,等于白干: 1.2 不看光练,思想怠慢: 1.3 即看又 ...
- linux运维基础知识
linux运维基础知识大全 一,序言 每一个微不足道的知识,也是未来的铺垫.每一份工作的薪资职位,也是曾经努力的结果. 二,服务器 1,运维人员工作职责: 1)保证数据不丢失:2)保证服务器24小时运 ...
- Linux系统运维基础测试题
1 Linux运维基础测试题(第一关) 通过这段时间学习Linux基础命令,为了检测自己对Linux基础命令掌握的情况,从网上整理13到测试题,并将其整理出来供大家参考学习. 1.1 习题 ...
- HBase运维基础--元数据逆向修复原理
背景 鉴于上次一篇文章——“云HBase小组成功抢救某公司自建HBase集群,挽救30+T数据”的读者反馈,对HBase的逆向工程比较感兴趣,并咨询如何使用相应工具进行运维等等.总的来说,就是想更深层 ...
- Linux运维基础采集项
1. Linux运维基础采集项 做运维,不怕出问题,怕的是出了问题,抓不到现场,两眼摸黑.所以,依靠强大的监控系统,收集尽可能多的指标,意义重大.但哪些指标才是有意义的呢,本着从实践中来的思想,各位工 ...
- linux运维基础__争取十月前研究的差不多
转来的一编,考虑在十月前研究的差不多 linux运维人员基础 1.很多地方经常会用到的rsync工具 实施几台服务器的同步效果 我们公司就是使用这个工具完成服务器的游戏的服务端和客户端同步,有几个文章 ...
- 网络配置——Linux运维基础
今天把Linux的网络配置总结了一下,尽管并不难可是是个比較重要的基础.然后我也不知到自己以后是否会做运维,可是我知道自己比較喜欢刨根问底.还有就是我很珍惜我以前掌握过的这些运维的技能.今天突然间问自 ...
随机推荐
- git多人协作式开发时分支管理策略
什么是 git-flow? Git Flow是一套使用Git进行源代码管理时的一套行为规范 主分支Master 首先,代码库应该有一个.且仅有一个主分支.所有提供给用户使用的正式版本,都在这个主分支上 ...
- Sqlserver脚本创建登录名密码
use table1 GO ', default_database=table1; GO create user abc for login abc with default_schema=dbo; ...
- 目前比较火的前端框架及UI组件
看到的一篇总结性的文章,收藏一下,感兴趣的可以自己看看,哪些是已经会的,哪些是没听说过的,哪些是一知半解的,都可以稍微看看. 一.前端框架库: 1.Zepto.js 地址:点击打开链接 描述:Zept ...
- 微信小程序 后端用Flask实现
手上有个微信小程序项目,因为对Python相对熟悉一些,打算后端用python写,具体采用python 轻量级的flask框架. 在做的过程中,有些问题需要考虑,记录在下边. 1. 开发的小程序后端怎 ...
- 搭建单机版的FastDFS服务
一,原理讲解 FastDFS是一个开源的轻量级分布式文件系统,它对文件进行管理,功能包括:文件存储.文件同步.文件访问(文件上传.文件下载)等,解决了大容量存储和负载均衡的问题.特别适合以文件为载体的 ...
- python的sys.args使用
一.sys 模块 sys是Python的一个「标准库」,也就是官方出的「模块」,是「System」的简写,封装了一些系统的信息和接口. 官方的文档参考:https://docs.python.org/ ...
- Java -cp 命令行引用多个jar包的简单写法(Windows、Linux
1.Windows下用法 在Windows上,可以使用 用法:java your-jar-lib-folder/* your-main-class your-jar-lib-folder为存放一堆ja ...
- Windows jdk安装以及版本切换
Windows jdk版本切换 一.安装 1.下载 官网: Java SE Development Kit 8 Downloads Java SE 7 Archive Downloads 1.7之前的 ...
- 阿里云IoT物联网平台入门教程
参考链接:https://www.geek-workshop.com/thread-37883-1-1.html
- 51nod 1379 索函数
Fib[0]=0,Fib[1]=1,Fib[n]=Fib[n-1]+Fib[n-2] if n>1. 定义索函数Sor(n)=Fib[0]| Fib[1] |Fib[2]|…|Fib[n]. 给 ...