一.无话可说
最近买了个罗马尼亚的大硬盘机器,所以准备把Online上的存储站搬过去,拿oneinstack装了一波环境,不过总觉得还是不够,毕竟下载站要是被人搞事了挺蛋疼的,所以准备装个VeryNginx来简单配点策略。我很早就折腾过VeryNginx了,也用了挺久,一直是拿来用它的过滤器和跳转,挺方便的,只是懒得写,今天重新搞的时候又把过去的坑给踩了一遍。。。还是做点记录吧
二.还得再说
其实如果使用自带的安装脚本,会很方便,不过我个人没用过OpenResty,所以还是在Nginx的基础上配置吧,熟悉点。
首先是依赖部分,按照官方的Use Own Nginx的说明,需要如下依赖
- lua-nginx-module
- http_stub_status_module
- http_ssl_module
而lua-nginx-module还需要lua以及nginx-dev-kit
首先装Lua,一般为了更好的性能,都选择安装LuaJit
1 2 3 4 5 6 |
wget http://luajit.org/download/LuaJIT-2.0.4.tar.gz tar xzf LuaJIT-2.0.4.tar.gz cd LuaJIT-2.0.4 make && make install echo "/usr/local/lib" > /etc/ld.so.conf.d/local.conf ldconfig |
然后下载lua-nginx-module以及nginx-dev-kit
1 2 3 |
cd /opt git clone https://github.com/openresty/lua-nginx-module/ git clone https://github.com/simpl/ngx_devel_kit/ |
之后就是编译Nginx了
1 2 3 |
export LUAJIT_LIB=/usr/local/lib export LUAJIT_INC=/usr/local/include/luajit-2.0 在./configure最后添加--add-module=/opt/ngx_devel_kit --add-module=/opt/lua-nginx-module |
然后一波编译,没错就OK了 阅读全文→
近期评论