#!/bin/bash
echo "安装openresty,按任意键继续"
read -n1

#安装依赖
yum -y install gcc-c++
yum -y install pcre pcre-devel
yum -y install zlib zlib-devel
yum -y install openssl openssl-devel
yum -y install perl

cd /data/software
curl -O http://down.yadeaiot.net:8000/openresty-1.19.9.1.tar.gz 
tar -zxvf openresty-1.19.9.1.tar.gz

cd openresty-1.19.9.1
./configure --with-http_stub_status_module --with-stream
gmake
gmake install

mkdir /data/nginxlogs
mkdir /usr/local/openresty/nginx/conf/conf.d

cd /usr/local/openresty/nginx/conf
mv nginx.conf  nginx.conf.bak

wget http://down.yadeaiot.net:8000/install/nginx.conf

# 启动
cd /usr/local/openresty/nginx/sbin
./nginx
ps -ef |grep nginx
