Redis客户端 lua-resty-redis是为基于cosocket API的ngx_lua提供的Lua redis客户端,通过它可以完成Redis的操作.默认安装OpenResty时已经自带了该模块,使用文档可参考https://github.com/openresty/lua-resty-redis. 基本操作 1. 创建redis/test_redis_baisc.lua local function close_redes( red ) if not red then return…
Mysql客户端 lua-resty-mysql是为基于cosocket API的ngx_lua提供的Lua Mysql客户端,通过它可以完成Mysql的操作.默认安装OpenResty时已经自带了该模块,使用文档可参考https://github.com/openresty/lua-resty-mysql. 1. 编辑mysql/test_mysql.lua local function close_db( db ) if not db then return end db:close() e…
安装lua_nginx_module 模块 lua_nginx_module 可以一步步的安装,也可以直接用淘宝的OpenResty Centos和debian的安装就简单了.. 这里说下freebsd的安装: fetch http://www.lua.org/ftp/lua-5.1.4.tar.gz tar zxvf lua-.tar.gz cd lua- make freebsd make install cd .. fetch https://github.com/chaoslawful/…