How to install Nginx Lua in linux

Source: Internet
Author: User
Tags curl lua

This is my summary of the installation for your reference:

The latest Nginx, LuaJIT, ngx_devel_kit, and lua-nginx-module installation files are required:

Nginx

LuaJIT Lua or LuaJIT can be used, but for performance consideration, it is recommended to install LuaJIT

Ngx_devel_kit

Lua-nginx-module

Download the following command:

$ Curl-O http://nginx.org/download/nginx-1.10.1.tar.gz$ curl-O route curl-L-O https://github.com/openresty/lua-nginx-module/archive/v0.10.5.tar.gz

Install LuaJIT

$ Wget http://luajit.org/download/LuaJIT-.tar.gz $ tar zxvf LuaJIT-.tar.gz $ cd LuaJIT-$ make $ sudo make install

Compile and install lua-nginx-module

Export LUAJIT_LIB =/usr/local/libexport LUAJIT_INC =/usr/local/include/luajit-2.1cd nginx-1.10.1. /configure -- prefix =/opt/nginx -- with-ld-opt = "-Wl,-rpath, /usr/local/lib "-- add-module =/path/to/ngx_devel_kit-0.3.0 -- add-module =/path/to/nginx/lua-nginx-module-0.10.5makemake install

Dynamic module mode

Nginx 1.9.11 can be used to compile a module as a dynamic module and run the./configure command? Add-dynamic-module = PATH replacement? Add-module = PATH. After compilation, you can use load_module in nginx. conf configuration to dynamically load this module:

Load_module/path/to/modules/ndk_http_module.so; load_module/path/to/modules/ngx_http_lua_module.so; lua cjson install

Eureka Zuul Gateway

To install and compile cjson, you need to modify the LUA_VERSION, LUA_INCLUDE_DIR, and LUA_CMODULE_DIR parameters in the MakeFile before lua is run. This allows the cjson module to know the lua library file and header file directory for normal compilation and installation.

Download and decompress:

Wget http://www.kyne.com.au /~ Mark/software/download/lua-cjson-2.1.0.tar.gztar-zxvf cjson-2.1.0.tar.gzcd cjson-2.1.0

Modify MakeFile:

LUA_VERSION = luajit-2.1LUA_INCLUDE_DIR = $ (PREFIX)/include/$ (LUA_VERSION) LUA_CMODULE_DIR = $ (PREFIX)/libmake & sudo make installsudo cp cjson. so/usr/local/lib/lua/5.1/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.