博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
OpenResty 基础知识 和 Linux部署 详解
阅读量:2395 次
发布时间:2019-05-10

本文共 2392 字,大约阅读时间需要 7 分钟。

OpenResty (又称 : ngx_openresty) 是一个基于 NGINX 的可伸缩的 Web 平台,可以使用 Lua脚本语言 调动 Nginx 支持的各种 C 以及 Lua 模块,OpenResty 性能优异。OpenResty 可以快速构造出 1W+ 并发连接响应的超高性能 Web 应用系统
OpenResty 可以将 Nginx+Lua 打包在一起,而且提供包括 Redis客户端,MySQL 客户端,http客户端等在内的大量的组件
中文官方网站 : 
Linux 部署 OpenResty
安装 OpenResty 依赖库
# yum install readline-devel pcre-devel openssl-devel gcc
下载并解压最新稳定版 openresty 
# cd /opt/softwares/
# wget https://openresty.org/download/openresty-1.13.6.1.tar.gz
# tar -zxvf openresty-1.13.6.1.tar.gz -C /opt/modules/
编译并安装 OpenResty 相关软件
# cd /opt/modules/openresty-1.13.6.1
# cd bundle/LuaJIT-2.1-20171103
# make clean && make && make install
...
==== Successfully installed LuaJIT 2.1.0-beta3 to /usr/local ====    # 安装成功,且在 创建 /usr/local/bin/luajit 软连接
# cd /opt/modules/openresty-1.13.6.1/bundle
# wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz    # 在  下载最新稳定版
# tar -xvf 2.3.tar.gz
# cd /opt/modules/openresty-1.13.6.1/bundle
# wget https://github.com/yaoweibin/nginx_upstream_check_module/archive/v0.3.0.tar.gz    # 在  下载最新稳定版
# tar -xvf v0.3.0.tar.gz
# 将 ngx_cache_purge nginx_upstream_check_module 进行打包编译在一起
# cd /opt/modules
# mkdir openresty
# cd /opt/modules/openresty-1.13.6.1
# ./configure --prefix=/opt/modules/openresty --with-http_realip_module  --with-pcre  --with-luajit --add-module=./bundle/ngx_cache_purge-2.3/ --add-module=./bundle/nginx_upstream_check_module-0.3.0/ -j2
# make && make install
# cd /opt/modules/openresty
# ll
总用量 244
drwxr-xr-x  2 root root    123 5月  10 20:02 bin
-rw-r--r--  1 root root  22924 5月  10 20:02 COPYRIGHT
drwxr-xr-x  6 root root     56 5月  10 20:02 luajit
drwxr-xr-x  6 root root     70 5月  10 20:02 lualib
drwxr-xr-x  6 root root     54 5月  10 20:02 nginx
drwxr-xr-x 44 root root   4096 5月  10 20:02 pod
-rw-r--r--  1 root root 218352 5月  10 20:02 resty.index
drwxr-xr-x  5 root root     47 5月  10 20:02 site
如果出现
错误: 无法验证 github.com 的由 “/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA” 颁发的证书: 颁发的证书还未生效。
可以再 wget 中增加 --no-check-certificate 参数,进行下载
# wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.tar.gz --no-check-certificate
启动编译好的 nginx
# cd /opt/modules/openresty
# ./nginx/sbin/nginx
# ps -ef|grep nginx    # 检查 nginx,发现 nginx 可以正常运行,说明 nginx 运行成功
root      23767      1  0 20:08 ?        00:00:00 nginx: master process ./sbin/nginx
nobody    23768  23767  0 20:08 ?        00:00:00 nginx: worker process
root      23771   6506  0 20:08 pts/5    00:00:00 grep --color=auto nginx

转载地址:http://uogab.baihongyu.com/

你可能感兴趣的文章
JSP中的基本语法和3指令,6动作,9内置对象
查看>>
JSP的6个动作
查看>>
JAVA中的数据类型和方法重载
查看>>
常见面试题——斐波纳挈数列
查看>>
我的第一篇hibernate框架博客
查看>>
java中File类
查看>>
java中File类创建和删除功能
查看>>
java中File类的判断功能
查看>>
java中File类的获取功能和修改名字功能
查看>>
java中File类的其它获取功能
查看>>
java中的字符流
查看>>
java中的字节流
查看>>
java中IO流中的标准输入输出流
查看>>
java中IO流中的 打印流
查看>>
java中IO流中的对象操作流
查看>>
java中IO流中的对象操作流(2)——解决对象输入流读取对象出现异常的问题
查看>>
java中IO流Properties集合
查看>>
java中IO流字符流中的编码
查看>>
java中多线程概述
查看>>
Linux系统常用的命令
查看>>