nginx安装lua模块
来源:互联网 发布:cnstorm和淘宝比哪个好 编辑:程序博客网 时间:2024/04/28 07:35
1、下载相应的nginx版本,http://nginx.org/en/download.html,安装过程略
2、安装lua或者luajit,http://luajit.org/download.html
yum install lua -y
3、下载模块https://github.com/openresty/lua-nginx-module/tags https://github.com/simpl/ngx_devel_kit/releases/tag/v0.3.0rc1
4、安装模块
tar -xzvf lua-nginx-module-0.10.2.tar.gz
tar -xzvf ngx_devel_kit-0.3.0rc1.tar.gz
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_secure_link_module --with-http_sub_module --add-module=../ngx_devel_kit-0.3.0rc1 --add-module=../lua-nginx-module-0.10.2
make
make install
5、测试lua脚本
在nginx.conf的server中添加如下内容
location /hello {
default_type "text/plain";
content_by_lua 'ngx.say("hello, lua")';
}
启动nginx会报 如下错误
./sbin/nginx: error while loading shared libraries:libluajit-5.1.so.2: cannot open shared object file: No such file or directory
此类问题通常使用ldconfig命令就能解决:
echo "/usr/local/lib" >/etc/ld.so.conf.d/lua.conf
ldconfig
重启nginx
访问http://127.0.0.1/hello 页面返回hello lua即安装成功
6、lua访问redis
下载https://github.com/agentzh/lua-resty-redis.git
将lib中的resty 复制到/usr/local/config/nginx/
lua_package_path "/usr/local/nginx/conf/resty/?.lua;;";
- nginx安装lua模块
- nginx+lua模块安装
- nginx-Brew安装lua模块
- Nginx安装lua-nginx-module模块
- Nginx安装lua-nginx-module模块
- Nginx安装lua-nginx-module模块
- nginx安装并安装Lua模块
- 源码安装nginx并配置Lua模块
- 源码安装nginx配置Lua模块
- nginx安装lua和echo模块
- nginx安装,nginx-lua模块安装(centos7.3)
- Nginx模块-lua-nginx-module
- nginx配置echo lua模块
- nginx新添加lua模块
- nginx lua 安装spdy
- nginx-lua(安装)
- nginx下Lua安装
- nginx+lua+redis安装
- Lua语法特性
- android 下载安装并打开apk
- openwrt之WIFI驱动结构的一点简单分析
- 范数与距离的关系
- Frscon的使用
- nginx安装lua模块
- 用dimens去实现 屏幕适配
- jQuery 中 attr() 和 prop() 方法的区别
- SynchronizedMap和ConcurrentHashMap的深入分析
- JDBC分层开发
- USB全速和低速设备的检测
- 查看ADB被占用的情况
- IT杂谈之一:野蛮生长到精细分工
- Hibernate - Batch update returned unexpected row count from update: 0 actual row count: 0 expected: