OpenResty入门

117 阅读1分钟

安装

apt install gcc libpcre3-dev libssl-dev perl make build-essential
wget https://openresty.org/download/openresty-1.19.9.1.tar.gz
tar -zxvf openresty-1.19.9.1.tar.gz
cd openresty-1.19.9.1/
./configure
make && make install

配置环境变量

vim /etc/profile
export PATH=$PATH:/usr/local/openresty/bin:/usr/local/openresty/luajit/bin
source /etc/profile

安装lor

opm install sumory/lor
cd /opt && git clone https://github.com/sumory/lor
cd lor/
make install

部署OpenResty China

github

下载代码, 更改配置
启动服务
如出错:
# 安装upload库
opm install openresty/lua-resty-upload
# 安装uuid库
apt-get install uuid-dev
# 启动服务
openresty -p `pwd`  -c conf/nginx-dev.conf
# 重新加载服务
openresty -s reload -p `pwd` -c conf/nginx-dev.conf