nginx使用lua扩展,做自己的telize
2016年1月28日
评论已被关闭
一直以来都在用www.telize.com下的ip,geo数据,但是15年底以后不能用了,登录官网以后,人家说要用的话必须要付费了,“subscribe to a paid plan”,但是国外的developer还是有良心的,告诉你人家是用RESTful API写的,要用的话,自己写啊~~~,干脆一不做二不休,试试自己搞一个。
第一部分就是安装nginx + lua
telize的安装instruction:https://github.com/fcambus/telize
github上的lua_nginx介绍:https://github.com/openresty/lua-nginx-module
luajit下载:http://luajit.org/download.html
lua下载:http://www.lua.org/versions.html
nginx下载:http://nginx.org/en/download.html(使用lua的nginx必须1.7.3+)
ndk下载:https://github.com/simpl/ngx_devel_kit/tags
lua_nginx模块下载:https://github.com/chaoslawful/lua-nginx-module/tags
0、本来,这里说用lua5.0或者luajit2.1都可以,但是本人安装的时候用lua5.0编译安装发现nginx没有装上lua相关模块,于是用luajit2.1的方式。
1、不管是lua还是luajit,源码都不需要configure,如果想要修改默认的安装路径可以修改Makefile中文档前部的prefix。