admin

nginx结合lua配置

admin WEB运维 2021-05-28 82浏览 0

yum install gcc-c++

yum install -y pcre pcre-devel

yum install -y zlib zlib-devel

yum install -y openssl openssl-devel


mkdir -p /usr/local/src


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

tar -xvf LuaJIT-2.0.5.tar.gz

make PREFIX=/usr/local/luajit

make install PREFIX=/usr/local/luajit


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

tar -xvf v0.3.0.tar.gz


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

tar -xvf v0.10.8.tar.gz 


环境变量/etc/profile文件中增加环境变量,并执行source /etc/profile

export LUAJIT_LIB=/usr/local/luajit/lib

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

export LD_LIBRARY_PATH=/usr/local/luajit/lib:$LD_LIBRARY_PATH


wget https://nginx.org/download/nginx-1.18.0.tar.gz


useradd nginx


./configure \

--user=nginx \

--group=nginx \

--prefix=/etc/nginx \

--sbin-path=/usr/sbin/nginx \

--conf-path=/etc/nginx/nginx.conf \

--pid-path=/var/run/nginx.pid \

--lock-path=/var/run/nginx.lock \

--error-log-path=/var/log/nginx/error.log \

--http-log-path=/var/log/nginx/access.log \

--with-http_gzip_static_module \

--with-http_stub_status_module \

--with-http_ssl_module \

--with-pcre \

--with-file-aio \

--with-http_realip_module \

--without-http_scgi_module \

--without-http_uwsgi_module \

--without-http_fastcgi_module \

--add-module=/usr/local/src/ngx_devel_kit-0.3.0 \

--add-module=/usr/local/src/lua-nginx-module-0.10.8



make -j2

make install


nginx -t -c /etc/nginx/nginx.conf


版权声明

本站《作品展示》类文章均为原创,转载必须注明出处,技术分享类文章部分来源于网络,版权归原作者所有,若侵权请留言。

发表评论
展开