centos7.9 下安装 openResty 获得已开启 lua 模块的 nginx
OpenResty 实际上相当于 Nginx + 一些模块, 自带 Lua 支持,无需编译安装 Nginx 以开启 Lua 模块
1. 安装(以下命令可能已过期,建议查看[官方安装文档])
sudo yum install yum-utils
sudo yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
sudo yum install openresty2. 软链 openresty 中的 nginx 到 bin 目录, 平替 nginx
ln -s /usr/local/openresty/nginx/sbin/nginx /usr/local/bin/nginx3. 使用
查看 nginx 版本
nginx -v启动 nginx
nginx停止 nginx
nginx -s stop重启 nginx
nginx -s reload