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 openresty

2. 软链 openresty 中的 nginxbin 目录, 平替 nginx

    ln -s /usr/local/openresty/nginx/sbin/nginx /usr/local/bin/nginx

3. 使用

  • 查看 nginx 版本

        nginx -v
  • 启动 nginx

        nginx
  • 停止 nginx

        nginx -s stop
  • 重启 nginx

        nginx -s reload

标签: nginx, openresty, lua

添加新评论