参考安装地址:
http://openresty.org/cn/installation.html
1. 下载 openresty 源码包
如需请先安装依赖:yum install readline-devel pcre-devel openssl-devel gcc
wget https://openresty.org/download/openresty-1.13.6.2.tar.gz
2. 解压缩安装(将其安装到 --prefix 指定的 /opt/openresty 文件夹下,不指定则会默认到 /usr/local/openresty )
tar -zxvf https://openresty.org/download/openresty-1.13.6.2.tar.gz
cd openresty-1.13.6.2
./configure --with-cc-opt="-I/usr/local/include" --with-ld-opt="-L/usr/local/lib" --prefix=/opt/openresty
make
make install
3. 启动 nginx 并测试 lua
cd /opt/openresty
ls
可以查看到相关文件夹: