美文网首页
OpenResty 在 ubuntu18 上的安装

OpenResty 在 ubuntu18 上的安装

作者: 田丰w | 来源:发表于2020-08-12 14:55 被阅读0次

    OpenResty 在 ubuntu18 上的安装

    # 关闭系统已经启动的 nginx 服务(如果有的话)
    sudo systemctl disable nginx.service    # 关闭自动启动 NG
    sudo systemctl stop nginx.service    # 关闭当前启动的 NG
    
    # 安装导入 GPG 公钥时所需的几个依赖包(整个安装过程完成后可以随时删除它们):
    sudo apt-get -y install --no-install-recommends wget gnupg ca-certificates
    
    # 导入我们的 GPG 密钥:
    wget -O - https://openresty.org/package/pubkey.gpg | sudo apt-key add -
    
    # 添加我们官方 APT 仓库:
    echo "deb http://openresty.org/package/ubuntu $(lsb_release -sc) main" \
        | sudo tee /etc/apt/sources.list.d/openresty.list
    
    # 更新 APT 索引:
    sudo apt-get update
    
    # 安装 openresty
    sudo apt-get  install openresty
    
    # 如果不想关联安装 openresty-opm 和 openresty-restydoc
    sudo apt-get install --no-install-recommends openresty
    
    

    安装完成后, openresty 已自动启动. 如需关闭,执行
    sudo systemctl stop openresty.service

    安装完成后, openresty 默认开机启动. 如需关闭,执行
    sudo systemctl disable openresty.service

    启动 openresty
    sudo systemctl start openresty.service

    这种方式 openresty 的默认安装位置
    /usr/local/openresty/nginx/sbin/nginx

    参考:
    openresty官网

    相关文章

      网友评论

          本文标题:OpenResty 在 ubuntu18 上的安装

          本文链接:https://www.haomeiwen.com/subject/gzapdktx.html