|
|
@ -976,17 +976,15 @@ class sites(object): |
|
|
|
site_path = info['path'] |
|
|
|
site_path = info['path'] |
|
|
|
|
|
|
|
|
|
|
|
new_path = site_path + run_path |
|
|
|
new_path = site_path + run_path |
|
|
|
|
|
|
|
|
|
|
|
# 处理Nginx |
|
|
|
# 处理Nginx |
|
|
|
site_host = self.getHostConf(site_name) |
|
|
|
site_host = self.getHostConf(site_name) |
|
|
|
if os.path.exists(site_host): |
|
|
|
if os.path.exists(site_host): |
|
|
|
content = mw.readFile(site_host) |
|
|
|
content = mw.readFile(site_host) |
|
|
|
rep = r'\s*root\s*(.+);' |
|
|
|
rep = r'\s*root\s*(.+);' |
|
|
|
path = re.search(rep, content).groups()[0] |
|
|
|
path = re.search(rep, content).groups()[0] |
|
|
|
content = conf.replace(path, new_path) |
|
|
|
content = content.replace(path, new_path) |
|
|
|
mw.writeFile(site_host, content) |
|
|
|
mw.writeFile(site_host, content) |
|
|
|
|
|
|
|
|
|
|
|
self.setSitePath(site_id, run_path) |
|
|
|
|
|
|
|
mw.restartWeb() |
|
|
|
mw.restartWeb() |
|
|
|
return mw.returnData(True, '设置成功!') |
|
|
|
return mw.returnData(True, '设置成功!') |
|
|
|
|
|
|
|
|
|
|
|