Home > Backend Development > PHP Tutorial > nginx + ngx_lua installation test

nginx + ngx_lua installation test

WBOY
Release: 2016-07-29 09:15:34
Original
1073 people have browsed it

http://www.ttlsa.com/nginx/nginx-modules-ngx_lua/

nginx lua module is a third-party nginx module developed by Taobao. It can embed the lua language into the nginx configuration, making it extremely convenient to use lua. Enhanced the capabilities of nginx. nginx is famous for its high concurrency, and lua scripts are lightweight. The combination of the two is perfect. Next, please see how to install nginx + ngx_lua module. And finally a simple test. If you are an ubuntu system, please see nginx+lua+redis to build high-concurrency applicationsSystem environment: centos/redhatPrepare the following software packages before installation
· nginx address: http://www.nginx.org
· luajit address: http://luajit.org/download.html
· HttpLuaModule address: http://wiki.nginx.org/HttpLuaModule1. Download Install LuaJIT

# cd /usr/local/src

# wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz

​​​

Successfully

built LuaJIT

make[1]:Leaving directory`/usr/ local/src/ LuaJIT 2.0.2= ===

# make installThe following content appears, indicating that the installation is successful====Successfully installed LuaJIT 2.0.2

to

/usr/local==== 2. Download and prepare nginx lua module # cd /usr/local/src# wget https://github.com/chaoslawful/lua-nginx-module/archive/v0.8.6.tar.gz# tar -xzvf v0.8.6

1
2
3
4
5
6
7
8
9
10
11
12
13
14
3. Install nginx3.1 Install

# cd /usr/local/src/

# wget http://nginx.org/download/nginx-1.4.2.tar.gz

# tar -xzvf nginx-1.4.2.tar.gz

# cd nginx-1.4.2

//First import the environment variables and tell nginx where to find luajit

# export LUAJIT_LIB= /usr/local/lib

# export LUAJIT_INC=/usr/local/include/luajit-2.0

# ./configure --prefix=/usr/local/nginx-1.4.2 --add- module=../lua-nginx-module-0.8.6

# make -j2

# make install

1
2
3
4
5
6
7
8
9
10
3.1 Common errors
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template