Tengine 安装http_lua_module
特别鸣谢github.com/chaoslawful ,感谢您提供的模块,我自己在网上下载了很多次都安装失败了(有时候AI也不是万能的)!
大神的意见就是人狠话不多直接上技术
以centos8为例,安装依赖
dnf install -y gcc gcc-c++ make pcre pcre-devel zlib-devel openssl-devel下载lua模块
git clone https://github.com/chaoslawful/lua-nginx-module.git lua-nginx-module-master重新编译nginx,添加模块
cd /opt/tengine-x.x.0
./configure --user=nginx --prefix=/data/nginx/apptest --with-ld-opt="-Wl,-rpath,$LUAJIT_LIB" --add-module=/data/tengine-3.1.0/lua-nginx-module-master
make -j2
make install把Tengine做成服务并设置变量
vim /etc/profile
#添加一行
export PATH=/usr/local/nginx/sbin:$PATH
source /etc/profile
##验证###
nginx -V vim /usr/lib/systemd/system/nginx.service
#################################################
[Unit]
Description=Tengine Server
After=network.target remote-fs.target nss-lookup.target
[Service]
Environment="CONFFILE=/usr/local/nginx/conf/nginx.conf"
Type=forking
ExecStart=/usr/local/nginx/sbin/nginx -c $CONFFILE
ExecReload=/usr/local/nginx/sbin/nginx -s reload
ExecStop=/usr/local/nginx/sbin/nginx -s stop
[Install]
WantedBy=multi-user.target
####################################################设置服务器自动启动并查看状态
systemctl enable nginx.service
systemctl start nginx.service
systemctl status nginx.service
ps aux |grep nginx
nginx -V
评论区