zoukankan      html  css  js  c++  java
  • nginx install lua module

    #install luajit
    #http://luajit.org/download.html
    
    tar xzvf LuaJIT-2.0.4.tar.gz
    cd LuaJIT-2.0.4
    make install PREFIX=/home/allen.mh/local/luajit
    sudo echo "/home/allen.mh/local/luajit/lib" > /etc/ld.so.conf.d/usr_local_luajit_lib.conf
    
    #update bash_profile
    export LUAJIT_LIB=/home/allen.mh/local/luajit/lib
    export LUAJIT_INC=/home/allen.mh/local/luajit/include/luajit-2.0 
    
    #download nginx module
    #lua_nginx_module
    http://github.com/chaoslawful/lua-nginx-module/tags
    #ngx_devel_kit
    https://github.com/simpl/ngx_devel_kit/tags
    
    #install nginx 
    #如果已经安装了,在源码包里重新编译即可
    ./configure --prefix=/home/allen.mh/local/nginx --with-http_ssl_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_rea
    lip_module --with-pcre=/home/allen.mh/soft/pcre-8.36 --add-module=/home/allen.mh/soft/lua/ngx_devel_kit-0.2.19 --add-module=/home/allen.mh/soft/lua/lua-nginx-module-0.9.17r
    c1 --add-module=/home/allen.mh/soft/lua/rds-json-nginx-module-0.13 --add-module=/home/allen.mh/soft/lua/redis2-nginx-module-master --add-module=/home/allen.mh/soft/lua/echo
    -nginx-module-0.57 --with-debug
    
    #已经安装了nginx的
    sbin/nginx -s stop
    
    make
    
    make install
    
         location /hello {
                default_type 'text/plain'; 
                content_by_lua 'ngx.say("hello, lua")';                                                                                                                          
            }
    #127.0.0.1:8000/hello
    #如果输出: hello,lua
    #install success
  • 相关阅读:
    使用VS进入源码调试
    Nlog配置
    一个极简的爬虫
    简单的调用图灵机器人
    docker部署netcore项目 nginx负载均衡
    windows nginx负载均衡
    windows服务器环境配置redis sentinel部署
    ASP.NET资源大全-知识分享
    ABP动态生成WebAPI
    windows服务器环境下安装redis
  • 原文地址:https://www.cnblogs.com/allenhaozi/p/4897571.html
Copyright © 2011-2022 走看看