mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-15 09:46:11 +01:00
redis: delete vhost
This commit is contained in:
@@ -368,7 +368,8 @@ class vhost:
|
|||||||
|
|
||||||
DNS.deleteDNSZone(virtualHostName)
|
DNS.deleteDNSZone(virtualHostName)
|
||||||
|
|
||||||
installUtilities.installUtilities.reStartLiteSpeed()
|
if not os.path.exists(vhost.redisConf):
|
||||||
|
installUtilities.installUtilities.reStartLiteSpeed()
|
||||||
|
|
||||||
## Delete mail accounts
|
## Delete mail accounts
|
||||||
|
|
||||||
@@ -482,31 +483,35 @@ class vhost:
|
|||||||
logging.CyberCPLogFileWriter.writeToFile(
|
logging.CyberCPLogFileWriter.writeToFile(
|
||||||
str(msg) + " [Not able to remove virtual host directory from /home continuing..]")
|
str(msg) + " [Not able to remove virtual host directory from /home continuing..]")
|
||||||
|
|
||||||
try:
|
if not os.path.exists(vhost.redisConf):
|
||||||
confPath = vhost.Server_root + "/conf/vhosts/" + virtualHostName
|
try:
|
||||||
shutil.rmtree(confPath)
|
confPath = vhost.Server_root + "/conf/vhosts/" + virtualHostName
|
||||||
except BaseException as msg:
|
shutil.rmtree(confPath)
|
||||||
logging.CyberCPLogFileWriter.writeToFile(
|
except BaseException as msg:
|
||||||
str(msg) + " [Not able to remove virtual host configuration directory from /conf ]")
|
logging.CyberCPLogFileWriter.writeToFile(
|
||||||
|
str(msg) + " [Not able to remove virtual host configuration directory from /conf ]")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data = open("/usr/local/lsws/conf/httpd.conf").readlines()
|
data = open("/usr/local/lsws/conf/httpd.conf").readlines()
|
||||||
|
|
||||||
writeDataToFile = open("/usr/local/lsws/conf/httpd.conf", 'w')
|
writeDataToFile = open("/usr/local/lsws/conf/httpd.conf", 'w')
|
||||||
|
|
||||||
for items in data:
|
for items in data:
|
||||||
if items.find('/' + virtualHostName + '/') > -1:
|
if items.find('/' + virtualHostName + '/') > -1:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
writeDataToFile.writelines(items)
|
writeDataToFile.writelines(items)
|
||||||
|
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
logging.CyberCPLogFileWriter.writeToFile(
|
logging.CyberCPLogFileWriter.writeToFile(
|
||||||
str(msg) + " [Not able to remove virtual host configuration from main configuration file.]")
|
str(msg) + " [Not able to remove virtual host configuration from main configuration file.]")
|
||||||
return 0
|
return 0
|
||||||
return 1
|
return 1
|
||||||
|
else:
|
||||||
|
command = 'redis-cli delete "vhost:%s"' % (virtualHostName)
|
||||||
|
ProcessUtilities.executioner(command)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def checkIfVirtualHostExists(virtualHostName):
|
def checkIfVirtualHostExists(virtualHostName):
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ pm.max_spare_servers = {pmMaxSpareServers}
|
|||||||
ServerAdmin {administratorEmail}
|
ServerAdmin {administratorEmail}
|
||||||
CustomLog /home/{masterDomain}/logs/{masterDomain}.access_log combined
|
CustomLog /home/{masterDomain}/logs/{masterDomain}.access_log combined
|
||||||
<IfModule LiteSpeed>
|
<IfModule LiteSpeed>
|
||||||
CacheRoot lscache
|
CacheRoot /home/{masterDomain}/lscache
|
||||||
</IfModule>
|
</IfModule>
|
||||||
}
|
}
|
||||||
}'"""
|
}'"""
|
||||||
Reference in New Issue
Block a user