Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/setting.py

41 lines
975 B

6 years ago
# coding:utf-8
6 years ago
7 years ago
import time
import sys
6 years ago
import os
chdir = os.getcwd()
sys.path.append(chdir + '/class/core')
6 years ago
sys.path.append("/usr/local/lib/python2.7/site-packages")
7 years ago
import public
7 years ago
import system_api
6 years ago
cpu_info = system_api.system_api().getCpuInfo()
workers = cpu_info[1] + 1
# workers = 2
6 years ago
7 years ago
7 years ago
if not os.path.exists(os.getcwd() + '/logs'):
os.mkdir(os.getcwd() + '/logs')
7 years ago
bt_port = public.readFile('data/port.pl')
bind = ['0.0.0.0:%s' % bt_port]
6 years ago
threads = 4
7 years ago
backlog = 512
6 years ago
reload = False
daemon = True
6 years ago
worker_class = 'geventwebsocket.gunicorn.workers.GeventWebSocketWorker'
7 years ago
timeout = 7200
6 years ago
keepalive = 60
preload_app = True
7 years ago
capture_output = True
access_log_format = '%(t)s %(p)s %(h)s "%(r)s" %(s)s %(L)s %(b)s %(f)s" "%(a)s"'
loglevel = 'info'
errorlog = chdir + '/logs/error.log'
accesslog = chdir + '/logs/access.log'
pidfile = chdir + '/logs/mw.pid'
6 years ago
if os.path.exists(os.getcwd() + '/data/ssl.pl'):
certfile = 'ssl/certificate.pem'
keyfile = 'ssl/privateKey.pem'