mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 01:39:25 +08:00
update
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
<IfModule !mpm_netware_module>
|
||||
PidFile "logs/httpd.pid"
|
||||
</IfModule>
|
||||
|
||||
<IfModule mpm_prefork_module>
|
||||
StartServers 5
|
||||
MinSpareServers 5
|
||||
MaxSpareServers 10
|
||||
MaxRequestWorkers 250
|
||||
MaxConnectionsPerChild 0
|
||||
</IfModule>
|
||||
|
||||
<IfModule mpm_worker_module>
|
||||
StartServers 3
|
||||
MinSpareThreads 75
|
||||
MaxSpareThreads 250
|
||||
ThreadsPerChild 25
|
||||
MaxRequestWorkers 400
|
||||
MaxConnectionsPerChild 0
|
||||
</IfModule>
|
||||
|
||||
<IfModule mpm_event_module>
|
||||
StartServers 3
|
||||
MinSpareThreads 75
|
||||
MaxSpareThreads 250
|
||||
ThreadsPerChild 25
|
||||
MaxRequestWorkers 400
|
||||
MaxConnectionsPerChild 0
|
||||
</IfModule>
|
||||
|
||||
<IfModule mpm_netware_module>
|
||||
ThreadStackSize 65536
|
||||
StartThreads 250
|
||||
MinSpareThreads 25
|
||||
MaxSpareThreads 250
|
||||
MaxThreads 1000
|
||||
MaxConnectionsPerChild 0
|
||||
</IfModule>
|
||||
|
||||
<IfModule mpm_mpmt_os2_module>
|
||||
StartServers 2
|
||||
MinSpareThreads 5
|
||||
MaxSpareThreads 10
|
||||
MaxConnectionsPerChild 0
|
||||
</IfModule>
|
||||
|
||||
<IfModule mpm_winnt_module>
|
||||
ThreadsPerChild 150
|
||||
MaxConnectionsPerChild 0
|
||||
</IfModule>
|
||||
|
||||
<IfModule !mpm_netware_module>
|
||||
MaxMemFree 2048
|
||||
</IfModule>
|
||||
<IfModule mpm_netware_module>
|
||||
MaxMemFree 100
|
||||
</IfModule>
|
||||
@@ -32,6 +32,7 @@ Group daemon
|
||||
</IfModule>
|
||||
|
||||
ServerAdmin you@example.com
|
||||
ServerName localhost:8280
|
||||
|
||||
<Directory />
|
||||
AllowOverride none
|
||||
|
||||
@@ -71,7 +71,6 @@ def checkArgs(data, ck=[]):
|
||||
|
||||
def clearTemp():
|
||||
path_bin = getServerDir() + "/httpd"
|
||||
mw.execShell('rm -rf ' + path_bin + '/client_body_temp')
|
||||
|
||||
|
||||
def getConf():
|
||||
@@ -481,8 +480,7 @@ def setCfg():
|
||||
args = getArgs()
|
||||
|
||||
# 检查参数,允许动态参数
|
||||
|
||||
cfg = getConf()
|
||||
cfg = getConfMpm()
|
||||
mw.backFile(cfg)
|
||||
content = mw.readFile(cfg)
|
||||
|
||||
@@ -512,7 +510,7 @@ def setCfg():
|
||||
content = re.sub(rep, newconf, content)
|
||||
|
||||
mw.writeFile(cfg, content)
|
||||
isError = mw.checkWebConfig()
|
||||
isError = mw.checkHttpdConfig()
|
||||
if (isError != True):
|
||||
mw.restoreFile(cfg)
|
||||
return mw.returnJson(False, 'ERROR: 配置出错<br><a style="color:red;">' + isError.replace("\n", '<br>') + '</a>')
|
||||
|
||||
+13
-1
@@ -1463,7 +1463,19 @@ def checkWebConfig():
|
||||
result = execShell(cmd)
|
||||
searchStr = 'test is successful'
|
||||
if result[1].find(searchStr) == -1:
|
||||
msg = getInfo('配置文件错误: {1}', (result[1],))
|
||||
msg = getInfo('配置文件错误[openresty]: {1}', (result[1],))
|
||||
writeLog("软件管理", msg)
|
||||
return result[1]
|
||||
return True
|
||||
|
||||
def checkHttpdConfig():
|
||||
op_dir = getServerDir() + '/apache/httpd'
|
||||
# "ulimit -n 10240 && " +
|
||||
cmd = op_dir + "/bin/httpd -t"
|
||||
result = execShell(cmd)
|
||||
searchStr = 'Syntax OK'
|
||||
if result[1].find(searchStr) == -1:
|
||||
msg = getInfo('配置文件错误[httpd]: {1}', (result[1],))
|
||||
writeLog("软件管理", msg)
|
||||
return result[1]
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user