ourls-resty
一个网址短链接应用,Ourls(PHP) 的 OpenResty 移植
$ opm get xiaooloong/ourls-resty
Ourls-Resty
[Ourls][1] 是由 [takashiki][2] 实现的一个基于发号和 hashid 的短网址服务。 受这个项目的启发,将此项目移植到 [OpenResty][3] 。
移植了原项目的功能和特性,并加入了内存缓存支持。
使用方法
环境
安装 openresty [预编译包][9] (或 [手动编译教程][10])
安装 libidn :
yum install libidn
安装
使用 opm 包管理安装本库:
opm install xiaooloong/ourls-resty
安装 lua 库依赖:
luarocks install net-url && luarocks install router
参考 [hashids.lua][4] 的说明安装 hashids
配置
进入工程目录
/usr/local/openresty/site/lualib/ourl
复制
config.sample.lua
为config.lua
修改
config.lua
中的数据库配置、hashids 参数、可信代理服务器的 cidr恢复
urls.sql
至mysql
或mariadb
数据库进入
/usr/local/openresty/nginx/conf
目录根据自己的实际情况,配置静态文件,合并配置
完成
启动 openresty (service openresty start)
使用到的其他项目
[leihog/hashids.lua][4]
[APItools/router.lua][5]
[golgote/neturl][6]
[hamishforbes/lua-resty-iputils][8]
[1]: https://github.com/takashiki/Ourls [2]: https://github.com/takashiki [3]: https://openresty.org.cn/ [4]: https://github.com/leihog/hashids.lua [5]: https://github.com/APItools/router.lua [6]: https://github.com/golgote/neturl [8]: https://github.com/hamishforbes/lua-resty-iputils [9]: https://openresty.org.cn/cn/rpm-packages.html [10]: https://moonbingbing.gitbooks.io/openresty-best-practices/content/openresty/install_on_centos.html
POD 错误
嘿!上面的文档中有一些编码错误,解释如下:
- 大约在第 109 行
-
=over 没有关闭 =back
作者
xiaooloong
许可证
mit
依赖项
版本
-
xiaooloong/ourls-resty 0.3.2一个网址短链接应用,Ourls(PHP) 的 OpenResty 移植 2016-11-02 05:49:43
-
xiaooloong/ourls-resty 0.3.1一个网址短链接应用,Ourls(PHP) 的 OpenResty 移植 2016-11-01 03:26:58
-
xiaooloong/ourls-resty 0.3.0一个网址短链接应用,Ourls(PHP) 的 OpenResty 移植 2016-11-01 02:56:50