centos7环境
官网:http://openresty.org/cn/linux-packages.html
你可以在你的 CentOS 系统中添加 openresty 仓库,这样就可以便于未来安装或更新我们的软件包(通过 yum check-update 命令)。 运行下面的命令就可以添加我们的仓库(对于 CentOS 8 或以上版本,应将下面的 yum 都替换成 dnf):
# add the yum repo:
wget https://openresty.org/package/centos/openresty.repo
sudo mv openresty.repo /etc/yum.repos.d/
# update the yum index:
sudo yum check-update
然后就可以像下面这样安装软件包,比如 openresty:
sudo yum install -y openresty
如果你想安装命令行工具 resty,那么可以像下面这样安装 openresty-resty 包:
sudo yum install -y openresty-resty
执行完成上述命令在/usr/local目录下会生成openresty目录。
至此,openresty搭建完成。
openresty相关命令
systemctl start openresty
systemctl stop openresty
systemctl reload openresty
systemctl restart openresty