Linux 系统在安装 openresty 时,无法直接用 yum, apt
等安装包工具,需要手动添加 openresty 的仓库。
Ubuntu
安装
1 | # 导入我们的 GPG 密钥: |
自启动
修改 /etc/rc.local
文件,在 exit 0
之前加入
1 | /usr/bin/supervisord |
保存退出,并修改权限
1 | chmod +x /etc/rc.local |
CentOS
安装
1 | # 添加仓库 |
自启动
适用 CentOS >= 7 的版本
新建 /usr/lib/systemd/system/openresty.service
文件
1 | [Unit] |
开启自启动
1 | systemctl enable openresty |
查看启动状态
1 | systemctl status openresty |
手动编译
如果服务器重度依赖 Nginx 来做请求判断,那最好还是用编译的方式,yum, apt
安装的方式模块依赖非常有限,并不方便更改。
安装依赖
1 | yum -y install pcre pcre-devel openssl openssl-devel |
从 download 页面找到最新版,或者你想要的版本
1 | $ wget https://openresty.org/download/openresty-1.13.6.1.tar.gz |
最近热读
扫码关注公众号,或搜索公众号“温欣爸比”
及时获取我的最新文章
