短网址服务 Ourls-Resty

码农软件 · 软件分类 · 短网址服务 · 2020-02-10 12:57:35

软件介绍

Ourls-Resty 是对 Ourls 的移植。将原 PHP 移植到 OpenResty 平台。

Ourls 是由 takashiki 实现的一个基于发号和 hashid 的短网址服务。 受这个项目的启发,将此项目移植到 OpenResty 。

移植了原项目的功能和特性,并加入了内存缓存支持。

Github Release 提供了 Cent7 x86_64 下的打包。其他平台可手动编译 Lua C 库。

安装方法:

  • 安装 openresty 预编译包 (手动编译教程

  • 安装 gcc、make、libidn、libidn-devel (yum gcc make install libidn-devel)

  • 将本工程解压到 openresty 目录,执行 install.sh (bash install.sh)

  • 修改 lualib/ourl/config.lua 中的数据库配置、hashids 参数、可信代理的 cidr

  • 恢复 urls.sql 至 mysql 或 mariadb 数据库

  • 进入 nginx/conf 目录,根据自己的实际情况修改 (合并配置,修改 server_name …)

  • 启动 openresty (service openresty start)

详细编译安装以及配置说明请参考 说明

最后参照下面的配置,与你的 nginx 配置合并。

    root html/ourl;
    index index.html;

    location / {
        try_files $uri $uri/ @app;
    }
    location @app {
        internal;
        default_type  text/html;
        content_by_lua_block {
            local t = require 'ourl'
            t.run()
        }

本文地址:https://codercto.com/soft/d/25304.html

Algorithms

Algorithms

Robert Sedgewick、Kevin Wayne / Addison-Wesley Professional / 2011-3-19 / USD 89.99

Essential Information about Algorithms and Data Structures A Classic Reference The latest version of Sedgewick,s best-selling series, reflecting an indispensable body of knowledge developed over the ......一起来看看 《Algorithms》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

SHA 加密
SHA 加密

SHA 加密工具