mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
update
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
user {$OS_USER} {$OS_USER_GROUP};
|
user {$OS_USER} {$OS_USER_GROUP};
|
||||||
worker_processes auto;
|
worker_processes auto;
|
||||||
error_log {$SERVER_PATH}/server/openresty/nginx/logs/nginx_error.log crit;
|
error_log {$SERVER_PATH}/openresty/nginx/logs/error.log crit;
|
||||||
pid {$SERVER_PATH}/server/openresty/nginx/logs/nginx.pid;
|
pid {$SERVER_PATH}/openresty/nginx/logs/nginx.pid;
|
||||||
|
|
||||||
worker_rlimit_nofile 51200;
|
worker_rlimit_nofile 51200;
|
||||||
|
|
||||||
events
|
events
|
||||||
{
|
{
|
||||||
#use epoll;
|
use {$EVENT_MODEL};
|
||||||
worker_connections 51200;
|
worker_connections 51200;
|
||||||
multi_accept on;
|
multi_accept on;
|
||||||
}
|
}
|
||||||
|
|
||||||
http
|
http
|
||||||
@@ -60,7 +60,7 @@ http
|
|||||||
|
|
||||||
server
|
server
|
||||||
{
|
{
|
||||||
listen 888;
|
listen 8088;
|
||||||
server_name www.bt.cn;
|
server_name www.bt.cn;
|
||||||
index index.html index.htm index.php;
|
index index.html index.htm index.php;
|
||||||
root /www/server/phpmyadmin;
|
root /www/server/phpmyadmin;
|
||||||
@@ -83,8 +83,8 @@ http
|
|||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
access_log /www/wwwlogs/access.log;
|
access_log {$SERVER_PATH}/openresty/nginx/logs/access.log;
|
||||||
}
|
}
|
||||||
include /www/server/panel/vhost/nginx/*.conf;
|
include {$SERVER_PATH}/mdserver-web/vhost/nginx/*.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,15 @@ def getInitDFile():
|
|||||||
return '/etc/init.d/' + getPluginName()
|
return '/etc/init.d/' + getPluginName()
|
||||||
|
|
||||||
|
|
||||||
|
def clearTemp():
|
||||||
|
path_bin = getServerDir() + "/nginx"
|
||||||
|
public.execShell('rm -rf ' + path_bin + '/client_body_temp')
|
||||||
|
public.execShell('rm -rf ' + path_bin + '/fastcgi_temp')
|
||||||
|
public.execShell('rm -rf ' + path_bin + '/proxy_temp')
|
||||||
|
public.execShell('rm -rf ' + path_bin + '/scgi_temp')
|
||||||
|
public.execShell('rm -rf ' + path_bin + '/uwsgi_temp')
|
||||||
|
|
||||||
|
|
||||||
def getConf():
|
def getConf():
|
||||||
path = getPluginDir() + "/conf/nginx.conf"
|
path = getPluginDir() + "/conf/nginx.conf"
|
||||||
return path
|
return path
|
||||||
@@ -51,12 +60,21 @@ def confReplace():
|
|||||||
if public.getOs() == 'darwin':
|
if public.getOs() == 'darwin':
|
||||||
user = public.execShell(
|
user = public.execShell(
|
||||||
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
"who | sed -n '2, 1p' |awk '{print $1}'")[0].strip()
|
||||||
user_group = 'staff'
|
user_group = 'root'
|
||||||
content = content.replace('{$OS_USER}', user)
|
content = content.replace('{$OS_USER}', user)
|
||||||
content = content.replace('{$OS_USER_GROUP}', user_group)
|
content = content.replace('{$OS_USER_GROUP}', user_group)
|
||||||
|
|
||||||
|
content = content.replace('{$EVENT_MODEL}', 'kqueue')
|
||||||
else:
|
else:
|
||||||
content = content.replace('{$OS_USER}', 'www')
|
content = content.replace('{$OS_USER}', 'www')
|
||||||
content = content.replace('{$OS_USER_GROUP}', 'www')
|
content = content.replace('{$OS_USER_GROUP}', 'www')
|
||||||
|
content = content.replace('{$EVENT_MODEL}', 'epoll')
|
||||||
|
|
||||||
|
exe_bin = getServerDir() + "/bin/openresty"
|
||||||
|
# exe_bin = getServerDir() + "/nginx/sbin/nginx"
|
||||||
|
public.execShell('chown midoks:root ' + exe_bin)
|
||||||
|
public.execShell('chmod 755 ' + exe_bin)
|
||||||
|
public.execShell('chmod u+s ' + exe_bin)
|
||||||
|
|
||||||
public.writeFile(getServerDir() + '/nginx/conf/nginx.conf', content)
|
public.writeFile(getServerDir() + '/nginx/conf/nginx.conf', content)
|
||||||
|
|
||||||
@@ -103,6 +121,8 @@ def start():
|
|||||||
def stop():
|
def stop():
|
||||||
file = initDreplace()
|
file = initDreplace()
|
||||||
data = public.execShell(file + ' stop')
|
data = public.execShell(file + ' stop')
|
||||||
|
print data
|
||||||
|
clearTemp()
|
||||||
if data[1] == '':
|
if data[1] == '':
|
||||||
return 'ok'
|
return 'ok'
|
||||||
return 'fail'
|
return 'fail'
|
||||||
@@ -167,6 +187,8 @@ if __name__ == "__main__":
|
|||||||
print start()
|
print start()
|
||||||
elif func == 'stop':
|
elif func == 'stop':
|
||||||
print stop()
|
print stop()
|
||||||
|
elif func == 'restart':
|
||||||
|
print restart()
|
||||||
elif func == 'reload':
|
elif func == 'reload':
|
||||||
print reload()
|
print reload()
|
||||||
elif func == 'initd_status':
|
elif func == 'initd_status':
|
||||||
|
|||||||
@@ -1,49 +1 @@
|
|||||||
server {
|
|
||||||
listen 80;
|
|
||||||
server_name 127.0.0.1;
|
|
||||||
allow 127.0.0.1;
|
|
||||||
location /nginx_status {
|
|
||||||
stub_status on;
|
|
||||||
access_log off;
|
|
||||||
}
|
|
||||||
location /phpfpm_52_status {
|
|
||||||
fastcgi_pass unix:/tmp/php-cgi-52.sock;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
|
||||||
}
|
|
||||||
location /phpfpm_53_status {
|
|
||||||
fastcgi_pass unix:/tmp/php-cgi-53.sock;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
|
||||||
}
|
|
||||||
location /phpfpm_54_status {
|
|
||||||
fastcgi_pass unix:/tmp/php-cgi-54.sock;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
|
||||||
}
|
|
||||||
location /phpfpm_55_status {
|
|
||||||
fastcgi_pass unix:/tmp/php-cgi-55.sock;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
|
||||||
}
|
|
||||||
location /phpfpm_56_status {
|
|
||||||
fastcgi_pass unix:/tmp/php-cgi-56.sock;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
|
||||||
}
|
|
||||||
location /phpfpm_70_status {
|
|
||||||
fastcgi_pass unix:/tmp/php-cgi-70.sock;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
|
||||||
}
|
|
||||||
location /phpfpm_71_status {
|
|
||||||
fastcgi_pass unix:/tmp/php-cgi-71.sock;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
|
||||||
}
|
|
||||||
location /phpfpm_72_status {
|
|
||||||
fastcgi_pass unix:/tmp/php-cgi-72.sock;
|
|
||||||
include fastcgi_params;
|
|
||||||
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user