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