mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-06 07:19:29 +02:00
redis: for child domain
This commit is contained in:
@@ -846,6 +846,21 @@ class vhost:
|
||||
|
||||
confFile.close()
|
||||
|
||||
else:
|
||||
currentConf = vhostConfs.lswsRediConfChild
|
||||
|
||||
currentConf = currentConf.replace('{virtualHostName}', domain)
|
||||
currentConf = currentConf.replace('{masterDomain}', masterDomain)
|
||||
currentConf = currentConf.replace('{administratorEmail}', administratorEmail)
|
||||
currentConf = currentConf.replace('{path}', path)
|
||||
currentConf = currentConf.replace('{externalApp}', virtualHostUser)
|
||||
currentConf = currentConf.replace('{php}', phpVersion.lstrip('PHP '))
|
||||
currentConf = currentConf.replace('{uid}', str(pwd.getpwnam(virtualHostUser).pw_uid))
|
||||
currentConf = currentConf.replace('{gid}', str(grp.getgrnam(virtualHostUser).gr_gid))
|
||||
|
||||
command = 'redis-cli set %s' % (currentConf)
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
str(msg) + " [IO Error with per host config file [perHostDomainConf]]")
|
||||
|
||||
@@ -381,4 +381,21 @@ pm.max_spare_servers = {pmMaxSpareServers}
|
||||
CacheRoot lscache
|
||||
</IfModule>
|
||||
}
|
||||
}'"""
|
||||
|
||||
lswsRediConfChild = """"vhost:{virtualHostName}" '{
|
||||
"username": "{externalApp}",
|
||||
"documentRoot": "{path}",
|
||||
"vh_root": "{path}",
|
||||
"uid": {uid},
|
||||
"gid": {gid},
|
||||
"phpVersion": {php},
|
||||
"custom_conf": {
|
||||
ServerAlias www.{virtualHostName}
|
||||
ServerAdmin {administratorEmail}
|
||||
CustomLog /home/{masterDomain}/logs/{masterDomain}.access_log combined
|
||||
<IfModule LiteSpeed>
|
||||
CacheRoot lscache
|
||||
</IfModule>
|
||||
}
|
||||
}'"""
|
||||
Reference in New Issue
Block a user