pull/109/head
midoks 7 years ago
parent ca50c6591f
commit 0ad6947a31
  1. 2
      plugins/openresty/conf/nginx.conf
  2. 9
      plugins/openresty/conf/nginx_status.conf
  3. 19
      plugins/openresty/index.py
  4. 3
      plugins/openresty/versions/1.11.2/install.sh
  5. 3
      plugins/openresty/versions/1.13.6/install.sh

@ -85,6 +85,6 @@ http
access_log {$SERVER_PATH}/openresty/nginx/logs/access.log;
}
include {$SERVER_PATH}/mdserver-web/vhost/nginx/*.conf;
include {$SERVER_PATH}/openresty/nginx/conf/vhost/*.conf;
}

@ -0,0 +1,9 @@
server {
listen 80;
server_name 127.0.0.1;
allow 127.0.0.1;
location /nginx_status {
stub_status on;
access_log off;
}
}

@ -51,6 +51,18 @@ def getInitDTpl():
return path
def makeConf():
import shutil
vhost = getServerDir() + '/nginx/conf/vhost'
if not os.path.exists(vhost):
os.mkdir(vhost)
source_vhost = getPluginDir() + '/conf/nginx_status.conf'
dest_vhost = vhost + '/nginx_status.conf'
# if not os.path.exists(dest_vhost):
shutil.copyfile(source_vhost, dest_vhost)
def confReplace():
service_path = os.path.dirname(os.getcwd())
content = public.readFile(getConf())
@ -61,7 +73,7 @@ def confReplace():
user = public.execShell(
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
user_group = 'root'
content = content.replace('{$OS_USER}', user)
content = content.replace('{$OS_USER}', 'root')
content = content.replace('{$OS_USER_GROUP}', user_group)
content = content.replace('{$EVENT_MODEL}', 'kqueue')
@ -72,7 +84,7 @@ def confReplace():
exe_bin = getServerDir() + "/bin/openresty"
# exe_bin = getServerDir() + "/nginx/sbin/nginx"
public.execShell('chown midoks:root ' + exe_bin)
public.execShell('chown root:root ' + exe_bin)
public.execShell('chmod 755 ' + exe_bin)
public.execShell('chmod u+s ' + exe_bin)
@ -98,6 +110,9 @@ def initDreplace():
# config replace
confReplace()
# make nginx vhost or other
makeConf()
return file_bin

@ -24,7 +24,8 @@ Install_openresty()
cd ${openrestyDir} && tar -zxvf openresty-1.11.2.5.tar.gz
cd ${openrestyDir}/openresty-1.11.2.5 && ./configure --prefix=$serverPath/openresty \
--with-openssl=$serverPath/source/lib/openssl-1.0.2q && make && make install && \
--with-openssl=$serverPath/source/lib/openssl-1.0.2q \
--with-http_stub_status_module && make && make install && \
echo '1.11.2' > $serverPath/openresty/version.pl

@ -23,7 +23,8 @@ Install_openresty()
cd ${openrestyDir} && tar -zxvf openresty-1.13.6.2.tar.gz
cd ${openrestyDir}/openresty-1.13.6.2 && ./configure --prefix=$serverPath/openresty \
--with-openssl=$serverPath/source/lib/openssl-1.0.2q && make && make install && \
--with-openssl=$serverPath/source/lib/openssl-1.0.2q \
--with-http_stub_status_module && make && make install && \
echo '1.13.6' > $serverPath/openresty/version.pl
echo '安装完成' > $install_tmp

Loading…
Cancel
Save