Nginx compiles and installs Lua module

不言
Release: 2023-03-25 13:22:01
Original
2078 people have browsed it

This article mainly introduces Nginx compilation and installation of Lua modules, which has certain reference value. Now I share it with everyone. Friends in need can refer to it

Nginx compilation and installation of Lua modules

1. Install Lua environment and related libraries

1. LuaJIT

wget http://luajit.org/download/LuaJIT-2.0.2.tar.gz
tar -zxvf LuaJIT-2.0.2.tar.gz
cd LuaJIT-2.0.2
make install PREFIX=/usr/local/LuaJIT

export LUAJIT_LIB=/usr/local/LuaJIT/lib
export LUAJIT_INC=/usr/local/LuaJIT/include/luajit-2.0
Copy after login

2. ngx_devel_kit and lua-nginx-module

cd /opt/download

wget https://github.com/simpl/ngx_devel_kit/archive/v0.3.0.tar.gz

wget https://github.com/openresty/lua-nginx-module/archive/v0.10.9rc7.tar.gz

# 分别解压
Copy after login

3. Recompile Nginx

cd /opt/download

wget http://nginx.org/download/nginx-1.14.0.tar.gz
tar -zxvf nginx-1.14.0.tar.gz
cd nginx-1.14.0

./configure --add-module=/opt/download/ngx_devel_kit-0.3.0 --add-module=/opt/download/lua-nginx-module-0.10.9rc7

# 如若出现:
# error: the HTTP gzip module requires the zlib library.
# yum install zlib zlib-devel 一下即可

make -j 4 && make install
Copy after login

4. Load the lua library and add it to the ld.so.conf file

echo "/usr/local/LuaJIT/lib" >> /etc/ld.so.conf
# 然后执行如下命令:
ldconfig
Copy after login

                                                              

Related recommendations:

NGINX compilation, installation and configuration


The above is the detailed content of Nginx compiles and installs Lua module. For more information, please follow other related articles on the PHP Chinese website!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!