背景
最近在开发高铁CDN项目,由于我们的边缘节点的系统不是标准的centos(而是openwrt),所以在搭建lua-ngx开发环境中就遇到很多问题,最主要的问题是不能直接使用openresty这个平台。为了在nginx 中引入lua,我不得不考虑在ningx中把nginx-lua-module模块编译进来,此外,还需要在openwrt中编译出luajit。这里讲述在openwrt系统中编译nginx-lua-module。
本文只是粗略记录下,有不懂得可以私信我。
一、系统环境
二、编译步骤
1、参数选择和下载第三方模块
nginx 编译:
#修改 auto/cc/name 10行 yes 为 no
#修改 auto/cc/conf 186行 yes 为 no atomic
#修改 auto/cc/conf 207行 yes 为 no
#修改 auto/cc/conf 221行 yes 为 no
#修改 auto/os/linux 39行 yes 为 no epoll
#修改 auto/types/sizeof 36行 $CC 为 gcc
下载第三方模块:
#ngx_devel_kit-0.3.1.zip 解压至 /home/huxl/ngx_devel_kit-0.3.1
#lua-nginx-module-0.10.15.zip 解压至 /home/huxl/lua-nginx-module-0.10.15
2、编译ngx-lua-module
source /opt/fsl-qoriq/2.0/environment-setup-aarch64-fsl-linux
编译:
cd /home/huxl/nginx-1.16.1