一.基础依赖库安装
yum install pcre-devel openssl-devel gcc curl
二.openResty安装
1.安装yum-utils
yum install yum-utils
2.安装openresty仓库
yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo
3.安装openresty
yum install openresty
三.配置环境变量
1.将nginx的可执行程序目录添加至环境变量PATH中:
vim /etc/profile
在文章的末尾,添加一行:
export PATH=/usr/local/openresty/nginx/sbin:$PATH
2.使配置生效
source /etc/profile
四.开启自启动
chkconfig openresty on