tengine-2.3.2源码编译加入lua支持---Centos

#源码编译依赖库

yum -y install gcc gcc-c+ pcre-devel openssl-devel libxslt libxslt-devel

#luajit依赖

wget https://github.com/openresty/luajit2/archive/v2.1-20200102.tar.gz

tar xf v2.1-20200102.tar.gz

cd luajit2-2.1-20200102

make install PREFIX=/usr/local/luajit

#写入环境变量

cat >> /etc/profile << EOF

export LUAJIT_LIB=/usr/local/luajit/lib

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

EOF

source /etc/profile

echo '/usr/local/luajit/lib'>>/etc/ld.so.conf.d/usr_local_luajit_lib.conf 

ldconfig

##lua-module-nginx

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

tar xf v0.10.13.tar.gz

#tengine2.3.2下载

wget http://tengine.taobao.org/download/tengine-2.3.2.tar.gz

tar xf tengine-2.3.2.tar.gz

cd tengine-2.3.2

./configure --prefix=/opt/nginx --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module  \

--with-http_xslt_module --with-http_sub_module --with-http_stub_status_module --with-http_dav_module --with-http_flv_module \

--with-http_mp4_module --with-http_gzip_static_module --with-http_secure_link_module --with-http_degradation_module --with-mail_ssl_module \

--with-http_lua_module  --with-stream    --add-module=modules/ngx_http_upstream_session_sticky_module  --add-dynamic-module=../lua-nginx-module-0.10.13 \

--add-module=modules/ngx_http_upstream_consistent_hash_module  --add-module=./modules/mod_dubbo --add-module=./modules/ngx_multi_upstream_module --add-module=./modules/mod_config

make -j4 && make install

 

##如无意外加入一段Lua测试配置

        location /hello {

          default_type 'text/plain';

          content_by_lua 'ngx.say("hello, lua")';

        }

192.168.0.100在浏览器访问试试。

 

PS:lua依赖的版本要用2.1同时编译参数加入--add-dynamic-module=../lua-nginx-module-0.10.13 ,本次编译加入session_sticky参数,默认是不带这个参数模块移到Modules目录下了,可以在编译前到这个目录看,添加自己需要的模板,如果是动态编译的模板则启用需要在配置中加入加载模板,比如

load_module modules/ngx_http_lua_module.so;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值