当前位置:网站首页>OpenResty 使用介绍
OpenResty 使用介绍
2022-06-29 02:12:00 【yutao_517】
简介
OpenResty是一个基于Nginx的Web平台,可以使用其LuaJIT引擎运行Lua脚本。该软件由章亦春创建。2011年之前,它最初由淘宝网赞助,2012年至2016年主要由Cloudflare支持。自2017年起,主要得到OpenResty软件基金会和OpenResty公司的支持。
OpenResty旨在构建可扩展的Web应用、Web服务和动态Web网关。OpenResty的架构是基于几个nginx模块,这些模块已经被扩展,以便将nginx扩展为一个web应用服务器,处理大量的请求。OpenResty解决方案的概念旨在完全在nginx服务器中运行服务器端的Web应用,利用nginx的事件模型,不仅与HTTP客户端进行非阻塞的I/O,而且与MySQL、PostgreSQL、Memcached和Redis等远程后端进行非阻塞I/O。
OpenResty部署
yum install readline-devel pcre pcre-devel openssl openssl-devel gcc curl GeoIP-devel
wget https://openresty.org/download/openresty-1.19.3.1.tar.gz
tar -zxvf openresty-1.19.3.1.tar.gz
cd openresty-1.19.3.1
./configure
make && make install
./nginx/sbin/nginx
ps -ef|grep nginx

官方示例Hello World
官方文档:http://openresty.org/cn/getting-started.html
cd /usr/local/openresty
cp nginx/conf/nginx.conf nginx/conf/nginx-backup.conf
vim nginx/conf/nginx.conf
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
server {
listen 8080;
location / {
default_type text/html;
content_by_lua_block {
ngx.say("<p>hello, world</p>")
}
}
}
}
启动 nginx
./nginx/sbin/nginx
ps -ef|grep nginx

浏览器访问验证
因为我使用的是virtualbox虚拟机,所以要对其进行网络端口转发。


边栏推荐
- Who do you want to know when opening a stock account? Is it safe to open an account online now?
- Large scale visual relationship understanding
- How to become a senior digital IC Design Engineer (6-7) digital IC Verification: debug skills
- 110. 简易聊天室13:聊天室服务端
- Zhongyi technology resumed the review status of the gem IPO, and xuxiaofei no longer acted as a practicing lawyer
- How to become a senior digital IC Design Engineer (6-4) digital IC Verification: test point decomposition
- Blog publishing test 2
- SystemVerilog-结构体(一)
- Utiliser kubernets Resource Lock pour compléter son application ha
- SQL splits strings into tables
猜你喜欢

SAP ui5 beginner tutorial 22 - development and use of filter

SystemVerilog structure (I)

Understand flex layout in an article

Differences between web testing and app testing

Use code binding DataGridView control to display tables in program interface
![[redis] get to know redis for the first time](/img/02/3c6a7f6ea8c563386a4cd458024728.png)
[redis] get to know redis for the first time

【Redis】List类型

直播预告|SQL也能玩转工业级机器学习?MLOps meetup V3带你一探究竟!

Koa 快速入门

How to choose source code encryption software
随机推荐
[redis] sortedset type
TiFlash 面向编译器的自动向量化加速
How to choose source code encryption software
[redis] list type
Qt基础教程:QStringList
Smart world 2030
Necessary technologies for chip manufacturers (1) Introduction
【Redis】数据介绍 & 通用命令 & String类型
SAP ui5 beginner tutorial Part 23 - sorting sort and grouping Group trial version of list control
Uniapp notes
Convert flat structure to tree structure
Application of X6 in data stack index management
P7 Erkai early know - registration and application creation
基于 FPGA 的 RISC CPU 设计(4)关于项目的 36 个问题及其答案
QT basics tutorial: data types and containers
Understand flex layout in an article
Crawler exercise (IV) -- IP address problem
MySQL详解 --- 聚合与分组
7-27 bubble sorting (the k-th time)
项目研发,有哪些好用的免费脑图工具软件