1.安装依赖
yum install pcre-devel openssl-devel gcc curl postgresql-devel
2.官网下载源码包
http://openresty.org/cn/download.html
wget -c https://openresty.org/download/openresty-1.15.8.1rc2.tar.gz
解压文件:
tar -zxvf openresty-1.15.8.1rc2.tar.gz
4.源码编译
//切换目录
cd openresty-1.15.8.1rc2
//开始安装
./configure --prefix=/usr/local/openresty/ --with-http_stub_status_module --with-luajit --without-http_redis2_module --with-http_iconv_module --with-http_postgres_module --with-stream
gmake && gmake install
5.添加环境变量
vim /etc/profile
PATH=/usr/local/openresty/nginx/sbin:$PATH
export PATH
保存退出
执行生效命令:source /etc/profile
查看是否生效:echo $PATH