+
-
-
+
+
- {% if modSecInstalled == 0 %}
+ {% if modSecInstalled == 0 %}
-
-
{% trans "ModSecurity is not installed " %}
-
-
-
-
-
-
+
+
-
+
+ {% else %}
+
+
+
+
+
{% trans "On this page you can configure ModSecurity settings." %}
+
+
+
+
+
+
+
+
+
+ {% if modSecInstalled == 0 %}
+
+
+
{% trans "ModSecurity is not installed " %}
+
+
+
+
+
+
+
-
+
+
+
+
+ {% else %}
+
+
+
+
+
+ {% endif %}
+
+
+
+
+
+
+
+
+
+
+ {% endif %}
{% endblock %}
\ No newline at end of file
diff --git a/ftp/ftpManager.py b/ftp/ftpManager.py
index e7ce81ef5..8dc4b85f4 100644
--- a/ftp/ftpManager.py
+++ b/ftp/ftpManager.py
@@ -79,12 +79,9 @@ class FTPManager:
path = 'None'
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/ftpUtilities.py"
-
execPath = execPath + " submitFTPCreation --domainName " + domainName + " --userName " + userName \
+ " --password " + password + " --path " + path + " --owner " + admin.userName + ' --api ' + api
-
output = subprocess.check_output(shlex.split(execPath))
-
if output.find("1,None") > -1:
data_ret = {'status': 1, 'creatFTPStatus': 1, 'error_message': 'None'}
json_data = json.dumps(data_ret)
diff --git a/install/install.py b/install/install.py
index 923701a88..48d37e65a 100644
--- a/install/install.py
+++ b/install/install.py
@@ -296,24 +296,26 @@ class preFlightsChecks:
preFlightsChecks.stdOut("Exception during CyberPanel install")
os._exit(os.EX_SOFTWARE)
- else:
- while(1):
- cmd.append("rpm")
- cmd.append("-ivh")
- cmd.append("http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm")
- res = subprocess.call(cmd)
+ else:
+ while (1):
+ cmd.append("rpm")
+ cmd.append("-ivh")
+ cmd.append("http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm")
+ res = subprocess.call(cmd)
- if res == 1:
- count = count + 1
- preFlightsChecks.stdOut("Unable to add CyberPanel official repository, trying again, try number: " + str(count) + "\n")
- if count == 3:
- logging.InstallLog.writeToFile("Unable to add CyberPanel official repository, exiting installer! [installCyberPanelRepo]")
- preFlightsChecks.stdOut("Installation failed, consult: /var/log/installLogs.txt")
- os._exit(0)
- else:
- logging.InstallLog.writeToFile("CyberPanel Repo added!")
- preFlightsChecks.stdOut("CyberPanel Repo added!")
- break
+ if res == 1:
+ count = count + 1
+ preFlightsChecks.stdOut(
+ "Unable to add CyberPanel official repository, trying again, try number: " + str(count) + "\n")
+ if count == 3:
+ logging.InstallLog.writeToFile(
+ "Unable to add CyberPanel official repository, exiting installer! [installCyberPanelRepo]")
+ preFlightsChecks.stdOut("Installation failed, consult: /var/log/installLogs.txt")
+ os._exit(0)
+ else:
+ logging.InstallLog.writeToFile("CyberPanel Repo added!")
+ preFlightsChecks.stdOut("CyberPanel Repo added!")
+ break
def enableEPELRepo(self):
try:
diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py
index 4942079ef..d591262cd 100644
--- a/install/installCyberPanel.py
+++ b/install/installCyberPanel.py
@@ -234,7 +234,6 @@ class InstallCyberPanel:
'lsphp7?-ldap lsphp7?-mysql lsphp7?-opcache lsphp7?-pspell lsphp7?-recode ' \
'lsphp7?-sqlite3 lsphp7?-tidy'
res = os.system(command)
-
else:
command = 'yum -y groupinstall lsphp-all'
cmd = shlex.split(command)
diff --git a/plogical/CyberCPLogFileWriter.py b/plogical/CyberCPLogFileWriter.py
index dc2d11890..2ff68a41d 100644
--- a/plogical/CyberCPLogFileWriter.py
+++ b/plogical/CyberCPLogFileWriter.py
@@ -41,7 +41,7 @@ class CyberCPLogFileWriter:
@staticmethod
def statusWriter(tempStatusPath, mesg):
try:
- statusFile = open(tempStatusPath, 'w')
+ statusFile = open(tempStatusPath, 'a')
statusFile.writelines(mesg)
statusFile.close()
except BaseException, msg:
diff --git a/plogical/filemanager.py b/plogical/filemanager.py
index 2c95c8ca8..69faec37a 100644
--- a/plogical/filemanager.py
+++ b/plogical/filemanager.py
@@ -1,12 +1,7 @@
-import os.path
-import shutil
import CyberCPLogFileWriter as logging
-import subprocess
import argparse
-import shlex
from random import randint
-
class filemanager:
@staticmethod
@@ -25,7 +20,7 @@ class filemanager:
except BaseException,msg:
logging.CyberCPLogFileWriter.writeToFile(
- str(msg) + " [createEmailAccount]")
+ str(msg) + " [createTemporaryFile]")
print "0," + str(msg)
diff --git a/plogical/installUtilities.py b/plogical/installUtilities.py
index 7b697e50d..dfbf42fd1 100644
--- a/plogical/installUtilities.py
+++ b/plogical/installUtilities.py
@@ -4,8 +4,8 @@ import CyberCPLogFileWriter as logging
import shutil
import pexpect
import os
-import thread
import shlex
+from processUtilities import ProcessUtilities
class installUtilities:
@@ -136,15 +136,15 @@ class installUtilities:
@staticmethod
def reStartLiteSpeed():
try:
-
FNULL = open(os.devnull, 'w')
- command = "sudo systemctl restart lsws"
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ command = "sudo systemctl restart lsws"
+ else:
+ command = "sudo /usr/local/lsws/bin/lswsctrl restart"
cmd = shlex.split(command)
-
- res = subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
-
+ subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
except OSError, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [reStartLiteSpeed]")
@@ -159,12 +159,12 @@ class installUtilities:
def reStartOpenLiteSpeed(restart,orestart):
try:
- FNULL = open(os.devnull, 'w')
-
- command = "sudo systemctl restart lsws"
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ command = "sudo systemctl restart lsws"
+ else:
+ command = "sudo /usr/local/lsws/bin/lswsctrl restart"
cmd = shlex.split(command)
-
res = subprocess.call(cmd)
if res == 1:
@@ -177,7 +177,6 @@ class installUtilities:
print(" Litespeed Re-Started ")
print("###############################################")
-
except OSError, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [reStartOpenLiteSpeed]")
return 0
@@ -279,8 +278,6 @@ class installUtilities:
return 1
-
-
@staticmethod
def installMainWebServer():
if installUtilities.enableEPELRepo() == 1:
@@ -370,7 +367,6 @@ class installUtilities:
return 1
-
@staticmethod
def startMariaDB():
@@ -406,7 +402,6 @@ class installUtilities:
return 1
-
@staticmethod
def installMySQL(password):
diff --git a/plogical/modSec.py b/plogical/modSec.py
index efcfae27b..60ec1f8bf 100644
--- a/plogical/modSec.py
+++ b/plogical/modSec.py
@@ -7,6 +7,7 @@ import os
import tarfile
import shutil
from mailUtilities import mailUtilities
+from processUtilities import ProcessUtilities
class modSec:
installLogPath = "/home/cyberpanel/modSecInstallLog"
@@ -111,42 +112,74 @@ modsecurity_rules_file /usr/local/lsws/conf/modsec/rules.conf
data = open(tempConfigPath).readlines()
os.remove(tempConfigPath)
- confFile = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
- confData = open(confFile).readlines()
+ confFile = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
+ confData = open(confFile).readlines()
+ conf = open(confFile, 'w')
- conf = open(confFile, 'w')
+ for items in confData:
- for items in confData:
+ if items.find('modsecurity ') > -1:
+ conf.writelines(data[0])
+ continue
+ elif items.find('SecAuditEngine ') > -1:
+ conf.writelines(data[1])
+ continue
+ elif items.find('SecRuleEngine ') > -1:
+ conf.writelines(data[2])
+ continue
+ elif items.find('SecDebugLogLevel') > -1:
+ conf.writelines(data[3])
+ continue
+ elif items.find('SecAuditLogRelevantStatus ') > -1:
+ conf.writelines(data[5])
+ continue
+ elif items.find('SecAuditLogParts ') > -1:
+ conf.writelines(data[4])
+ continue
+ elif items.find('SecAuditLogType ') > -1:
+ conf.writelines(data[6])
+ continue
+ else:
+ conf.writelines(items)
- if items.find('modsecurity ') > -1:
- conf.writelines(data[0])
- continue
- elif items.find('SecAuditEngine ') > -1:
- conf.writelines(data[1])
- continue
- elif items.find('SecRuleEngine ') > -1:
- conf.writelines(data[2])
- continue
- elif items.find('SecDebugLogLevel') > -1:
- conf.writelines(data[3])
- continue
- elif items.find('SecAuditLogRelevantStatus ') > -1:
- conf.writelines(data[5])
- continue
- elif items.find('SecAuditLogParts ') > -1:
- conf.writelines(data[4])
- continue
- elif items.find('SecAuditLogType ') > -1:
- conf.writelines(data[6])
- continue
- else:
- conf.writelines(items)
+ conf.close()
- conf.close()
+ print "1,None"
+ return
+ else:
+ confFile = os.path.join(virtualHostUtilities.Server_root, "conf/modsec.conf")
+ confData = open(confFile).readlines()
+ conf = open(confFile, 'w')
- print "1,None"
- return
+ for items in confData:
+
+ if items.find('SecAuditEngine ') > -1:
+ conf.writelines(data[0])
+ continue
+ elif items.find('SecRuleEngine ') > -1:
+ conf.writelines(data[1])
+ continue
+ elif items.find('SecDebugLogLevel') > -1:
+ conf.writelines(data[2])
+ continue
+ elif items.find('SecAuditLogRelevantStatus ') > -1:
+ conf.writelines(data[4])
+ continue
+ elif items.find('SecAuditLogParts ') > -1:
+ conf.writelines(data[3])
+ continue
+ elif items.find('SecAuditLogType ') > -1:
+ conf.writelines(data[5])
+ continue
+ else:
+ conf.writelines(items)
+
+ conf.close()
+
+ print "1,None"
+ return
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(
@@ -160,7 +193,10 @@ modsecurity_rules_file /usr/local/lsws/conf/modsec/rules.conf
data = rulesFile.read()
rulesFile.close()
- rulesFilePath = os.path.join(virtualHostUtilities.Server_root, "conf/modsec/rules.conf")
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ rulesFilePath = os.path.join(virtualHostUtilities.Server_root, "conf/modsec/rules.conf")
+ else:
+ rulesFilePath = os.path.join(virtualHostUtilities.Server_root, "conf/rules.conf")
rulesFile = open(rulesFilePath,'w')
rulesFile.write(data)
@@ -180,26 +216,47 @@ modsecurity_rules_file /usr/local/lsws/conf/modsec/rules.conf
@staticmethod
def setupComodoRules():
try:
- pathTOOWASPFolder = os.path.join(virtualHostUtilities.Server_root, "conf/modsec/comodo")
- extractLocation = os.path.join(virtualHostUtilities.Server_root, "conf/modsec")
- if os.path.exists(pathTOOWASPFolder):
- shutil.rmtree(pathTOOWASPFolder)
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ pathTOOWASPFolder = os.path.join(virtualHostUtilities.Server_root, "conf/modsec/comodo")
+ extractLocation = os.path.join(virtualHostUtilities.Server_root, "conf/modsec")
- if os.path.exists('comodo.tar.gz'):
- os.remove('comodo.tar.gz')
+ if os.path.exists(pathTOOWASPFolder):
+ shutil.rmtree(pathTOOWASPFolder)
- command = "wget https://" + modSec.mirrorPath + "/modsec/comodo.tar.gz"
- result = subprocess.call(shlex.split(command))
+ if os.path.exists('comodo.tar.gz'):
+ os.remove('comodo.tar.gz')
- if result == 1:
- return 0
+ command = "wget https://" + modSec.mirrorPath + "/modsec/comodo.tar.gz"
+ result = subprocess.call(shlex.split(command))
- tar = tarfile.open('comodo.tar.gz')
- tar.extractall(extractLocation)
- tar.close()
+ if result == 1:
+ return 0
- return 1
+ tar = tarfile.open('comodo.tar.gz')
+ tar.extractall(extractLocation)
+ tar.close()
+
+ return 1
+ else:
+ if os.path.exists('/usr/local/lsws/conf/comodo_litespeed'):
+ shutil.rmtree('/usr/local/lsws/conf/comodo_litespeed')
+
+ extractLocation = os.path.join(virtualHostUtilities.Server_root, "conf")
+
+ if os.path.exists('cpanel_litespeed_vendor'):
+ os.remove('cpanel_litespeed_vendor')
+
+ command = "wget https://waf.comodo.com/api/cpanel_litespeed_vendor"
+ result = subprocess.call(shlex.split(command))
+
+ if result == 1:
+ return 0
+
+ command = "unzip cpanel_litespeed_vendor -d " + extractLocation
+ subprocess.call(shlex.split(command))
+
+ return 1
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(
@@ -209,60 +266,85 @@ modsecurity_rules_file /usr/local/lsws/conf/modsec/rules.conf
@staticmethod
def installComodo():
try:
- if modSec.setupComodoRules() == 0:
- print '0, Unable to download Comodo Rules.'
+
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ if modSec.setupComodoRules() == 0:
+ print '0, Unable to download Comodo Rules.'
+ return
+
+ owaspRulesConf = """modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/modsecurity.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/00_Init_Initialization.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/01_Init_AppsInitialization.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/02_Global_Generic.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/03_Global_Agents.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/04_Global_Domains.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/05_Global_Backdoor.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/06_XSS_XSS.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/07_Global_Other.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/08_Bruteforce_Bruteforce.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/09_HTTP_HTTP.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/10_HTTP_HTTPDoS.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/11_HTTP_Protocol.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/12_HTTP_Request.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/13_Outgoing_FilterGen.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/14_Outgoing_FilterASP.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/15_Outgoing_FilterPHP.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/16_Outgoing_FilterSQL.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/17_Outgoing_FilterOther.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/18_Outgoing_FilterInFrame.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/19_Outgoing_FiltersEnd.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/20_PHP_PHPGen.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/21_SQL_SQLi.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/22_Apps_Joomla.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/23_Apps_JComponent.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/24_Apps_WordPress.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/25_Apps_WPPlugin.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/26_Apps_WHMCS.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/27_Apps_Drupal.conf
+ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/28_Apps_OtherApps.conf
+ """
+
+ confFile = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
+
+ confData = open(confFile).readlines()
+
+ conf = open(confFile, 'w')
+
+ for items in confData:
+ if items.find('/usr/local/lsws/conf/modsec/rules.conf') > -1:
+ conf.writelines(items)
+ conf.write(owaspRulesConf)
+ continue
+ else:
+ conf.writelines(items)
+
+ conf.close()
+
+ print "1,None"
return
+ else:
+ if os.path.exists('/usr/local/lsws/conf/comodo_litespeed'):
+ shutil.rmtree('/usr/local/lsws/conf/comodo_litespeed')
- owaspRulesConf = """modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/modsecurity.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/00_Init_Initialization.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/01_Init_AppsInitialization.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/02_Global_Generic.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/03_Global_Agents.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/04_Global_Domains.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/05_Global_Backdoor.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/06_XSS_XSS.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/07_Global_Other.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/08_Bruteforce_Bruteforce.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/09_HTTP_HTTP.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/10_HTTP_HTTPDoS.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/11_HTTP_Protocol.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/12_HTTP_Request.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/13_Outgoing_FilterGen.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/14_Outgoing_FilterASP.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/15_Outgoing_FilterPHP.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/16_Outgoing_FilterSQL.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/17_Outgoing_FilterOther.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/18_Outgoing_FilterInFrame.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/19_Outgoing_FiltersEnd.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/20_PHP_PHPGen.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/21_SQL_SQLi.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/22_Apps_Joomla.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/23_Apps_JComponent.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/24_Apps_WordPress.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/25_Apps_WPPlugin.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/26_Apps_WHMCS.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/27_Apps_Drupal.conf
-modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/28_Apps_OtherApps.conf
-"""
+ extractLocation = os.path.join(virtualHostUtilities.Server_root, "conf")
- confFile = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
+ if os.path.exists('cpanel_litespeed_vendor'):
+ os.remove('cpanel_litespeed_vendor')
- confData = open(confFile).readlines()
+ command = "wget https://waf.comodo.com/api/cpanel_litespeed_vendor"
+ result = subprocess.call(shlex.split(command))
- conf = open(confFile, 'w')
+ if result == 1:
+ return 0
- for items in confData:
- if items.find('/usr/local/lsws/conf/modsec/rules.conf') > -1:
- conf.writelines(items)
- conf.write(owaspRulesConf)
- continue
- else:
- conf.writelines(items)
+ command = "unzip cpanel_litespeed_vendor -d " + extractLocation
+ result = subprocess.call(shlex.split(command))
- conf.close()
+ command = 'sudo chown -R lsadm:lsadm /usr/local/lsws/conf'
+ subprocess.call(shlex.split(command))
- print "1,None"
- return
+ print "1,None"
+ return
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(
@@ -273,19 +355,28 @@ modsecurity_rules_file /usr/local/lsws/conf/modsec/comodo/28_Apps_OtherApps.conf
def disableComodo():
try:
- confFile = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
- confData = open(confFile).readlines()
- conf = open(confFile, 'w')
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ confFile = os.path.join(virtualHostUtilities.Server_root, "conf/httpd_config.conf")
+ confData = open(confFile).readlines()
+ conf = open(confFile, 'w')
- for items in confData:
- if items.find('modsec/comodo') > -1:
- continue
- else:
- conf.writelines(items)
+ for items in confData:
+ if items.find('modsec/comodo') > -1:
+ continue
+ else:
+ conf.writelines(items)
- conf.close()
+ conf.close()
+
+ print "1,None"
+
+ else:
+ try:
+ shutil.rmtree('/usr/local/lsws/conf/comodo_litespeed')
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(str(msg) + ' [disableComodo]')
+ print "1,None"
- print "1,None"
except BaseException, msg:
logging.CyberCPLogFileWriter.writeToFile(
diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py
index a87264190..e86a1b081 100644
--- a/plogical/processUtilities.py
+++ b/plogical/processUtilities.py
@@ -1,11 +1,15 @@
from CyberCPLogFileWriter import CyberCPLogFileWriter as logging
import subprocess
import shlex
-
-
+import os
+from plogical.CyberCPLogFileWriter import CyberCPLogFileWriter as logging
class ProcessUtilities:
litespeedProcess = "litespeed"
+ ent = 1
+ OLS = 0
+ centos = 1
+ ubuntu = 0
@staticmethod
def getLitespeedProcessNumber():
@@ -14,7 +18,7 @@ class ProcessUtilities:
try:
import psutil
for proc in psutil.process_iter():
- if proc.name() == ProcessUtilities.litespeedProcess:
+ if proc.name().find(ProcessUtilities.litespeedProcess) > -1:
finalListOfProcesses.append(proc.pid)
except BaseException,msg:
@@ -30,7 +34,11 @@ class ProcessUtilities:
@staticmethod
def restartLitespeed():
try:
- command = "sudo systemctl restart lsws"
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ command = "sudo systemctl restart lsws"
+ else:
+ command = "sudo /usr/local/lsws/bin/lswsctrl restart"
+
cmd = shlex.split(command)
res = subprocess.call(cmd)
@@ -45,7 +53,11 @@ class ProcessUtilities:
@staticmethod
def stopLitespeed():
try:
- command = "sudo systemctl stop lsws"
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ command = "sudo systemctl stop lsws"
+ else:
+ command = "sudo /usr/local/lsws/bin/lswsctrl stop"
+
cmd = shlex.split(command)
res = subprocess.call(cmd)
@@ -57,4 +69,58 @@ class ProcessUtilities:
except subprocess.CalledProcessError, msg:
logging.writeToFile(str(msg) + "[stopLitespeed]")
+ @staticmethod
+ def executioner(command):
+ try:
+ res = subprocess.call(shlex.split(command))
+ if res == 1:
+ raise 0
+ else:
+ return 1
+ except BaseException, msg:
+ return 0
+
+ @staticmethod
+ def killLiteSpeed():
+ pids = ProcessUtilities.getLitespeedProcessNumber()
+ if pids !=0:
+ for items in pids:
+ try:
+ command = 'sudo kill -9 ' + str(items)
+ ProcessUtilities.executioner(command)
+ except:
+ pass
+
+ @staticmethod
+ def decideServer():
+ entPath = '/usr/local/lsws/bin/lshttpd'
+
+ if os.readlink(entPath) == '/usr/local/lsws/bin/lshttpd/openlitespeed':
+ return ProcessUtilities.OLS
+ else:
+ return ProcessUtilities.ent
+
+ @staticmethod
+ def decideDistro():
+ distroPath = '/etc/lsb-release'
+
+ if os.path.exists(distroPath):
+ return ProcessUtilities.ubuntu
+ else:
+ return ProcessUtilities.centos
+
+ @staticmethod
+ def executioner(command, statusFile):
+ try:
+ res = subprocess.call(shlex.split(command), stdout=statusFile, stderr=statusFile)
+ if res == 1:
+ raise 0
+ else:
+ return 1
+
+ except BaseException, msg:
+ logging.writeToFile(str(msg))
+ return 0
+
+
diff --git a/plogical/sslUtilities.py b/plogical/sslUtilities.py
index 13b66b51f..687a3432c 100644
--- a/plogical/sslUtilities.py
+++ b/plogical/sslUtilities.py
@@ -1,9 +1,10 @@
import CyberCPLogFileWriter as logging
-import shutil
import os
import shlex
import subprocess
import socket
+from plogical.processUtilities import ProcessUtilities
+from websiteFunctions.models import ChildDomains, Websites
class sslUtilities:
@@ -58,109 +59,189 @@ class sslUtilities:
return [0, "347 " + str(msg) + " [issueSSLForDomain]"]
@staticmethod
- def installSSLForDomain(virtualHostName):
+ def installSSLForDomain(virtualHostName, adminEmail='usman@cyberpersons.com'):
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ confPath = sslUtilities.Server_root + "/conf/vhosts/" + virtualHostName
+ completePathToConfigFile = confPath + "/vhost.conf"
- confPath = sslUtilities.Server_root + "/conf/vhosts/" + virtualHostName
- completePathToConfigFile = confPath + "/vhost.conf"
-
- try:
- map = " map " + virtualHostName + " " + virtualHostName + "\n"
-
- if sslUtilities.checkSSLListener() != 1:
-
- writeDataToFile = open("/usr/local/lsws/conf/httpd_config.conf", 'a')
-
- listener = "listener SSL {" + "\n"
- address = " address *:443" + "\n"
- secure = " secure 1" + "\n"
- keyFile = " keyFile /etc/letsencrypt/live/" + virtualHostName + "/privkey.pem\n"
- certFile = " certFile /etc/letsencrypt/live/" + virtualHostName + "/fullchain.pem\n"
- certChain = " certChain 1" + "\n"
- sslProtocol = " sslProtocol 30" + "\n"
+ try:
map = " map " + virtualHostName + " " + virtualHostName + "\n"
- final = "}" + "\n" + "\n"
- writeDataToFile.writelines("\n")
- writeDataToFile.writelines(listener)
- writeDataToFile.writelines(address)
- writeDataToFile.writelines(secure)
- writeDataToFile.writelines(keyFile)
- writeDataToFile.writelines(certFile)
- writeDataToFile.writelines(certChain)
- writeDataToFile.writelines(sslProtocol)
- writeDataToFile.writelines(map)
- writeDataToFile.writelines(final)
- writeDataToFile.writelines("\n")
- writeDataToFile.close()
+ if sslUtilities.checkSSLListener() != 1:
+ writeDataToFile = open("/usr/local/lsws/conf/httpd_config.conf", 'a')
- else:
-
- if sslUtilities.checkIfSSLMap(virtualHostName) == 0:
-
- data = open("/usr/local/lsws/conf/httpd_config.conf").readlines()
- writeDataToFile = open("/usr/local/lsws/conf/httpd_config.conf", 'w')
- sslCheck = 0
-
- for items in data:
- if items.find("listener") > -1 and items.find("SSL") > -1:
- sslCheck = 1
-
- if (sslCheck == 1):
- writeDataToFile.writelines(items)
- writeDataToFile.writelines(map)
- sslCheck = 0
- else:
- writeDataToFile.writelines(items)
- writeDataToFile.close()
-
- ###################### Write per host Configs for SSL ###################
-
- data = open(completePathToConfigFile, "r").readlines()
-
- ## check if vhssl is already in vhconf file
-
- vhsslPresense = 0
-
- for items in data:
- if items.find("vhssl") > -1:
- vhsslPresense = 1
-
- if vhsslPresense == 0:
- writeSSLConfig = open(completePathToConfigFile, "a")
-
- vhssl = "vhssl {" + "\n"
- keyFile = " keyFile /etc/letsencrypt/live/" + virtualHostName + "/privkey.pem\n"
- certFile = " certFile /etc/letsencrypt/live/" + virtualHostName + "/fullchain.pem\n"
+ listener = "listener SSL {" + "\n"
+ address = " address *:443" + "\n"
+ secure = " secure 1" + "\n"
+ keyFile = " keyFile /etc/letsencrypt/live/" + virtualHostName + "/privkey.pem\n"
+ certFile = " certFile /etc/letsencrypt/live/" + virtualHostName + "/fullchain.pem\n"
certChain = " certChain 1" + "\n"
sslProtocol = " sslProtocol 30" + "\n"
- final = "}"
+ map = " map " + virtualHostName + " " + virtualHostName + "\n"
+ final = "}" + "\n" + "\n"
- writeSSLConfig.writelines("\n")
+ writeDataToFile.writelines("\n")
+ writeDataToFile.writelines(listener)
+ writeDataToFile.writelines(address)
+ writeDataToFile.writelines(secure)
+ writeDataToFile.writelines(keyFile)
+ writeDataToFile.writelines(certFile)
+ writeDataToFile.writelines(certChain)
+ writeDataToFile.writelines(sslProtocol)
+ writeDataToFile.writelines(map)
+ writeDataToFile.writelines(final)
+ writeDataToFile.writelines("\n")
+ writeDataToFile.close()
- writeSSLConfig.writelines(vhssl)
- writeSSLConfig.writelines(keyFile)
- writeSSLConfig.writelines(certFile)
- writeSSLConfig.writelines(certChain)
- writeSSLConfig.writelines(sslProtocol)
- writeSSLConfig.writelines(final)
- writeSSLConfig.writelines("\n")
+ else:
- writeSSLConfig.close()
+ if sslUtilities.checkIfSSLMap(virtualHostName) == 0:
- return 1
+ data = open("/usr/local/lsws/conf/httpd_config.conf").readlines()
+ writeDataToFile = open("/usr/local/lsws/conf/httpd_config.conf", 'w')
+ sslCheck = 0
+
+ for items in data:
+ if items.find("listener") > -1 and items.find("SSL") > -1:
+ sslCheck = 1
+
+ if (sslCheck == 1):
+ writeDataToFile.writelines(items)
+ writeDataToFile.writelines(map)
+ sslCheck = 0
+ else:
+ writeDataToFile.writelines(items)
+ writeDataToFile.close()
+
+ ###################### Write per host Configs for SSL ###################
+
+ data = open(completePathToConfigFile, "r").readlines()
+
+ ## check if vhssl is already in vhconf file
+
+ vhsslPresense = 0
+
+ for items in data:
+ if items.find("vhssl") > -1:
+ vhsslPresense = 1
+
+ if vhsslPresense == 0:
+ writeSSLConfig = open(completePathToConfigFile, "a")
+
+ vhssl = "vhssl {" + "\n"
+ keyFile = " keyFile /etc/letsencrypt/live/" + virtualHostName + "/privkey.pem\n"
+ certFile = " certFile /etc/letsencrypt/live/" + virtualHostName + "/fullchain.pem\n"
+ certChain = " certChain 1" + "\n"
+ sslProtocol = " sslProtocol 30" + "\n"
+ final = "}"
+
+ writeSSLConfig.writelines("\n")
+
+ writeSSLConfig.writelines(vhssl)
+ writeSSLConfig.writelines(keyFile)
+ writeSSLConfig.writelines(certFile)
+ writeSSLConfig.writelines(certChain)
+ writeSSLConfig.writelines(sslProtocol)
+ writeSSLConfig.writelines(final)
+
+ writeSSLConfig.writelines("\n")
+
+ writeSSLConfig.close()
+
+ return 1
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [installSSLForDomain]]")
+ return 0
+ else:
+ confPath = sslUtilities.Server_root + "/conf/vhosts/" + virtualHostName
+ completePathToConfigFile = confPath + "/vhost.conf"
+
+ ## Check if SSL VirtualHost already exists
+
+ data = open(completePathToConfigFile, 'r').readlines()
+
+ for items in data:
+ if items.find('*:443') > -1:
+ return 1
+
+ try:
+
+ try:
+ chilDomain = ChildDomains.objects.get(domain=virtualHostName)
+ externalApp = chilDomain.master.externalApp
+ DocumentRoot = ' DocumentRoot ' + chilDomain.path + '\n'
+ except BaseException, msg:
+ website = Websites.objects.get(domain=virtualHostName)
+ externalApp = website.externalApp
+ DocumentRoot = ' DocumentRoot /home/' + virtualHostName + '/public_html\n'
+
+ data = open(completePathToConfigFile, 'r').readlines()
+ phpHandler = ''
+
+ for items in data:
+ if items.find('AddHandler') > -1 and items.find('php') > -1:
+ phpHandler = items
+ break
+
+ confFile = open(completePathToConfigFile, 'a')
+
+ doNotModify = '\n\n# Do not modify this file, this is auto-generated file.\n\n'
+
+ VirtualHost = '
\n\n'
+ ServerName = ' ServerName ' + virtualHostName + '\n'
+ ServerAlias = ' ServerAlias www.' + virtualHostName + '\n'
+ ScriptAlias = ' Alias /.filemanager/ /usr/local/lsws/FileManager\n'
+ ServerAdmin = ' ServerAdmin ' + adminEmail + '\n'
+ SeexecUserGroup = ' SuexecUserGroup ' + externalApp + ' ' + externalApp + '\n'
+ CustomLogCombined = ' CustomLog /home/' + virtualHostName + '/logs/' + virtualHostName + '.access_log combined\n'
+
+ confFile.writelines(doNotModify)
+ confFile.writelines(VirtualHost)
+ confFile.writelines(ServerName)
+ confFile.writelines(ServerAlias)
+ confFile.writelines(ScriptAlias)
+ confFile.writelines(ServerAdmin)
+ confFile.writelines(SeexecUserGroup)
+ confFile.writelines(DocumentRoot)
+ confFile.writelines(CustomLogCombined)
+ DirectoryFileManager = """\n
+ AllowOverride All
+ Options +Includes -Indexes +ExecCGI
+ php_value display_errors "Off"
+ php_value upload_max_filesize "200M"
+ php_value post_max_size "250M"
+ \n"""
+ confFile.writelines(DirectoryFileManager)
+
+ SSLEngine = ' SSLEngine on\n'
+ SSLVerifyClient = ' SSLVerifyClient none\n'
+ SSLCertificateFile = ' SSLCertificateFile /etc/letsencrypt/live/' + virtualHostName + '/fullchain.pem\n'
+ SSLCertificateKeyFile = ' SSLCertificateKeyFile /etc/letsencrypt/live/' + virtualHostName + '/privkey.pem\n'
+
+ confFile.writelines(SSLEngine)
+ confFile.writelines(SSLVerifyClient)
+ confFile.writelines(SSLCertificateFile)
+ confFile.writelines(SSLCertificateKeyFile)
+ confFile.writelines(phpHandler)
+
+ VirtualHostEnd = '\n'
+ confFile.writelines(VirtualHostEnd)
+ confFile.close()
+ return 1
+
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [installSSLForDomain]")
+ return 0
- except BaseException, msg:
- logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [installSSLForDomain]]")
- return 0
@staticmethod
def obtainSSLForADomain(virtualHostName,adminEmail,sslpath, aliasDomain = None):
try:
acmePath = '/root/.acme.sh/acme.sh'
- if os.path.exists('/etc/lsb-release'):
+ if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu:
acmePath = '/home/cyberpanel/.acme.sh/acme.sh'
if not os.path.exists(acmePath):
@@ -239,30 +320,13 @@ class sslUtilities:
def issueSSLForDomain(domain, adminEmail, sslpath, aliasDomain = None):
try:
-
if sslUtilities.obtainSSLForADomain(domain, adminEmail, sslpath, aliasDomain) == 1:
-
- if sslUtilities.installSSLForDomain(domain) == 1:
+ if sslUtilities.installSSLForDomain(domain, adminEmail) == 1:
return [1, "None"]
else:
return [0, "210 Failed to install SSL for domain. [issueSSLForDomain]"]
else:
- pathToStoreSSL = "/etc/letsencrypt/live/" + domain
- command = 'mkdir -p ' + pathToStoreSSL
- subprocess.call(shlex.split(command))
-
- pathToStoreSSLPrivKey = "/etc/letsencrypt/live/" + domain + "/privkey.pem"
- pathToStoreSSLFullChain = "/etc/letsencrypt/live/" + domain + "/fullchain.pem"
-
- command = 'openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=www.example.com" -keyout ' + pathToStoreSSLPrivKey + ' -out ' + pathToStoreSSLFullChain
- cmd = shlex.split(command)
- subprocess.call(cmd)
-
- if sslUtilities.installSSLForDomain(domain) == 1:
- logging.CyberCPLogFileWriter.writeToFile("Self signed SSL issued for " + domain + ".")
- return [1, "None"]
- else:
- return [0, "220 Failed to install SSL for domain. [issueSSLForDomain]"]
+ return [0, "283 Failed to obtain SSL for domain. [issueSSLForDomain]"]
except BaseException,msg:
return [0, "347 "+ str(msg)+ " [issueSSLForDomain]"]
\ No newline at end of file
diff --git a/plogical/vhost.py b/plogical/vhost.py
index a8aa849ce..e9932c80e 100644
--- a/plogical/vhost.py
+++ b/plogical/vhost.py
@@ -16,6 +16,7 @@ from databases.models import Databases
from mysqlUtilities import mysqlUtilities
from dnsUtilities import DNS
from random import randint
+from processUtilities import ProcessUtilities
## If you want justice, you have come to the wrong place.
@@ -87,7 +88,12 @@ class vhost:
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
- command = "chmod -R 666 " + pathLogs
+
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ command = "chmod -R 666 " + pathLogs
+ else:
+ command = "chmod -R 755 " + pathLogs
+
cmd = shlex.split(command)
subprocess.call(cmd, stdout=FNULL, stderr=subprocess.STDOUT)
@@ -176,215 +182,279 @@ class vhost:
@staticmethod
def perHostVirtualConf(vhFile, administratorEmail,virtualHostUser, phpVersion, virtualHostName, openBasedir):
# General Configurations tab
- try:
- confFile = open(vhFile, "w+")
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ try:
+ confFile = open(vhFile, "w+")
- docRoot = "docRoot $VH_ROOT/public_html" + "\n"
- vhDomain = "vhDomain $VH_NAME" + "\n"
- vhAliases = "vhAliases www.$VH_NAME"+ "\n"
- adminEmails = "adminEmails " + administratorEmail + "\n"
- enableGzip = "enableGzip 1" + "\n"
- enableIpGeo = "enableIpGeo 1" + "\n" + "\n"
+ docRoot = "docRoot $VH_ROOT/public_html" + "\n"
+ vhDomain = "vhDomain $VH_NAME" + "\n"
+ vhAliases = "vhAliases www.$VH_NAME"+ "\n"
+ adminEmails = "adminEmails " + administratorEmail + "\n"
+ enableGzip = "enableGzip 1" + "\n"
+ enableIpGeo = "enableIpGeo 1" + "\n" + "\n"
- confFile.writelines(docRoot)
- confFile.writelines(vhDomain)
- confFile.writelines(vhAliases)
- confFile.writelines(adminEmails)
- confFile.writelines(enableGzip)
- confFile.writelines(enableIpGeo)
+ confFile.writelines(docRoot)
+ confFile.writelines(vhDomain)
+ confFile.writelines(vhAliases)
+ confFile.writelines(adminEmails)
+ confFile.writelines(enableGzip)
+ confFile.writelines(enableIpGeo)
- # Index file settings
+ # Index file settings
- index = "index {" + "\n"
- userServer = " useServer 0" + "\n"
- indexFiles = " indexFiles index.php, index.html" + "\n"
- index_end = "}" + "\n" + "\n"
+ index = "index {" + "\n"
+ userServer = " useServer 0" + "\n"
+ indexFiles = " indexFiles index.php, index.html" + "\n"
+ index_end = "}" + "\n" + "\n"
- confFile.writelines(index)
- confFile.writelines(userServer)
- confFile.writelines(indexFiles)
- confFile.writelines(index_end)
+ confFile.writelines(index)
+ confFile.writelines(userServer)
+ confFile.writelines(indexFiles)
+ confFile.writelines(index_end)
- # Error Log Settings
+ # Error Log Settings
- error_log = "errorlog $VH_ROOT/logs/$VH_NAME.error_log {" + "\n"
- useServer = " useServer 0" + "\n"
- logLevel = " logLevel ERROR" + "\n"
- rollingSize = " rollingSize 10M" + "\n"
- error_log_end = "}" + "\n" + "\n"
+ error_log = "errorlog $VH_ROOT/logs/$VH_NAME.error_log {" + "\n"
+ useServer = " useServer 0" + "\n"
+ logLevel = " logLevel ERROR" + "\n"
+ rollingSize = " rollingSize 10M" + "\n"
+ error_log_end = "}" + "\n" + "\n"
- confFile.writelines(error_log)
- confFile.writelines(useServer)
- confFile.writelines(logLevel)
- confFile.writelines(rollingSize)
- confFile.writelines(error_log_end)
+ confFile.writelines(error_log)
+ confFile.writelines(useServer)
+ confFile.writelines(logLevel)
+ confFile.writelines(rollingSize)
+ confFile.writelines(error_log_end)
- # Access Log Settings
+ # Access Log Settings
- access_Log = "accesslog $VH_ROOT/logs/$VH_NAME.access_log {" + "\n"
- useServer = " useServer 0" + "\n"
- logFormat = ' logFormat "%v %h %l %u %t \"%r\" %>s %b"' + "\n"
- logHeaders = " logHeaders 5" + "\n"
- rollingSize = " rollingSize 10M" + "\n"
- keepDays = " keepDays 10"
- compressArchive = " compressArchive 1" + "\n"
- access_Log_end = "}" + "\n" + "\n"
+ access_Log = "accesslog $VH_ROOT/logs/$VH_NAME.access_log {" + "\n"
+ useServer = " useServer 0" + "\n"
+ logFormat = ' logFormat "%v %h %l %u %t \"%r\" %>s %b"' + "\n"
+ logHeaders = " logHeaders 5" + "\n"
+ rollingSize = " rollingSize 10M" + "\n"
+ keepDays = " keepDays 10"
+ compressArchive = " compressArchive 1" + "\n"
+ access_Log_end = "}" + "\n" + "\n"
- confFile.writelines(access_Log)
- confFile.writelines(useServer)
- confFile.writelines(logFormat)
- confFile.writelines(logHeaders)
- confFile.writelines(rollingSize)
- confFile.writelines(keepDays)
- confFile.writelines(compressArchive)
- confFile.writelines(access_Log_end)
+ confFile.writelines(access_Log)
+ confFile.writelines(useServer)
+ confFile.writelines(logFormat)
+ confFile.writelines(logHeaders)
+ confFile.writelines(rollingSize)
+ confFile.writelines(keepDays)
+ confFile.writelines(compressArchive)
+ confFile.writelines(access_Log_end)
- # php settings
+ # php settings
- scripthandler = "scripthandler {" + "\n"
- add = " add lsapi:"+virtualHostUser+" php" + "\n"
- php_end = "}" + "\n" + "\n"
+ scripthandler = "scripthandler {" + "\n"
+ add = " add lsapi:"+virtualHostUser+" php" + "\n"
+ php_end = "}" + "\n" + "\n"
- confFile.writelines(scripthandler)
- confFile.writelines(add)
- confFile.writelines(php_end)
+ confFile.writelines(scripthandler)
+ confFile.writelines(add)
+ confFile.writelines(php_end)
- ## external app
+ ## external app
- if phpVersion == "PHP 5.3":
- php = "53"
- elif phpVersion == "PHP 5.4":
- php = "55"
- elif phpVersion == "PHP 5.5":
- php = "55"
- elif phpVersion == "PHP 5.6":
- php = "56"
- elif phpVersion == "PHP 7.0":
- php = "70"
- elif phpVersion == "PHP 7.1":
- php = "71"
- elif phpVersion == "PHP 7.2":
- php = "72"
+ if phpVersion == "PHP 5.3":
+ php = "53"
+ elif phpVersion == "PHP 5.4":
+ php = "55"
+ elif phpVersion == "PHP 5.5":
+ php = "55"
+ elif phpVersion == "PHP 5.6":
+ php = "56"
+ elif phpVersion == "PHP 7.0":
+ php = "70"
+ elif phpVersion == "PHP 7.1":
+ php = "71"
+ elif phpVersion == "PHP 7.2":
+ php = "72"
- extprocessor = "extprocessor "+virtualHostUser+" {\n"
- type = " type lsapi\n"
- address = " address UDS://tmp/lshttpd/"+virtualHostUser+".sock\n"
- maxConns = " maxConns 10\n"
- env = " env LSAPI_CHILDREN=10\n"
- initTimeout = " initTimeout 600\n"
- retryTimeout = " retryTimeout 0\n"
- persistConn = " persistConn 1\n"
- persistConnTimeout = " pcKeepAliveTimeout 1\n"
- respBuffer = " respBuffer 0\n"
- autoStart = " autoStart 1\n"
- path = " path /usr/local/lsws/lsphp"+php+"/bin/lsphp\n"
- extUser = " extUser " + virtualHostUser + "\n"
- extGroup = " extGroup " + virtualHostUser + "\n"
- memSoftLimit = " memSoftLimit 2047M\n"
- memHardLimit = " memHardLimit 2047M\n"
- procSoftLimit = " procSoftLimit 400\n"
- procHardLimit = " procHardLimit 500\n"
- extprocessorEnd = "}\n"
+ extprocessor = "extprocessor "+virtualHostUser+" {\n"
+ type = " type lsapi\n"
+ address = " address UDS://tmp/lshttpd/"+virtualHostUser+".sock\n"
+ maxConns = " maxConns 10\n"
+ env = " env LSAPI_CHILDREN=10\n"
+ initTimeout = " initTimeout 600\n"
+ retryTimeout = " retryTimeout 0\n"
+ persistConn = " persistConn 1\n"
+ persistConnTimeout = " pcKeepAliveTimeout 1\n"
+ respBuffer = " respBuffer 0\n"
+ autoStart = " autoStart 1\n"
+ path = " path /usr/local/lsws/lsphp"+php+"/bin/lsphp\n"
+ extUser = " extUser " + virtualHostUser + "\n"
+ extGroup = " extGroup " + virtualHostUser + "\n"
+ memSoftLimit = " memSoftLimit 2047M\n"
+ memHardLimit = " memHardLimit 2047M\n"
+ procSoftLimit = " procSoftLimit 400\n"
+ procHardLimit = " procHardLimit 500\n"
+ extprocessorEnd = "}\n"
- confFile.writelines(extprocessor)
- confFile.writelines(type)
- confFile.writelines(address)
- confFile.writelines(maxConns)
- confFile.writelines(env)
- confFile.writelines(initTimeout)
- confFile.writelines(retryTimeout)
- confFile.writelines(persistConn)
- confFile.writelines(persistConnTimeout)
- confFile.writelines(respBuffer)
- confFile.writelines(autoStart)
- confFile.writelines(path)
- confFile.writelines(extUser)
- confFile.writelines(extGroup)
- confFile.writelines(memSoftLimit)
- confFile.writelines(memHardLimit)
- confFile.writelines(procSoftLimit)
- confFile.writelines(procHardLimit)
- confFile.writelines(extprocessorEnd)
+ confFile.writelines(extprocessor)
+ confFile.writelines(type)
+ confFile.writelines(address)
+ confFile.writelines(maxConns)
+ confFile.writelines(env)
+ confFile.writelines(initTimeout)
+ confFile.writelines(retryTimeout)
+ confFile.writelines(persistConn)
+ confFile.writelines(persistConnTimeout)
+ confFile.writelines(respBuffer)
+ confFile.writelines(autoStart)
+ confFile.writelines(path)
+ confFile.writelines(extUser)
+ confFile.writelines(extGroup)
+ confFile.writelines(memSoftLimit)
+ confFile.writelines(memHardLimit)
+ confFile.writelines(procSoftLimit)
+ confFile.writelines(procHardLimit)
+ confFile.writelines(extprocessorEnd)
- ## File Manager defination
+ ## File Manager defination
- context = "context /.filemanager {\n"
- location = " location /usr/local/lsws/Example/html/FileManager\n"
- allowBrowse = " allowBrowse 1\n"
- autoIndex = " autoIndex 1\n\n"
+ context = "context /.filemanager {\n"
+ location = " location /usr/local/lsws/Example/html/FileManager\n"
+ allowBrowse = " allowBrowse 1\n"
+ autoIndex = " autoIndex 1\n\n"
- accessControl = " accessControl {\n"
- allow = " allow 127.0.0.1, localhost\n"
- deny = " deny 0.0.0.0/0\n"
- accessControlEnds = " }\n"
+ accessControl = " accessControl {\n"
+ allow = " allow 127.0.0.1, localhost\n"
+ deny = " deny 0.0.0.0/0\n"
+ accessControlEnds = " }\n"
- rewriteInherit = """ rewrite {
- inherit 0
+ rewriteInherit = """ rewrite {
+ inherit 0
+
+ }
+ """
- }
- """
-
- phpIniOverride = "phpIniOverride {\n"
- php_admin_value = 'php_admin_value open_basedir "/tmp:/usr/local/lsws/Example/html/FileManager:$VH_ROOT"\n'
- php_value = 'php_value display_errors "Off"\n'
- php_value_upload_max_size = 'php_value upload_max_filesize "200M"\n'
- php_value_post_max_size = 'php_value post_max_size "250M"\n'
- endPHPIniOverride = "}\n"
+ phpIniOverride = "phpIniOverride {\n"
+ php_admin_value = 'php_admin_value open_basedir "/tmp:/usr/local/lsws/Example/html/FileManager:$VH_ROOT"\n'
+ php_value = 'php_value display_errors "Off"\n'
+ php_value_upload_max_size = 'php_value upload_max_filesize "200M"\n'
+ php_value_post_max_size = 'php_value post_max_size "250M"\n'
+ endPHPIniOverride = "}\n"
- defaultCharSet = " addDefaultCharset off\n"
- contextEnds = "}\n"
+ defaultCharSet = " addDefaultCharset off\n"
+ contextEnds = "}\n"
- confFile.writelines(context)
- confFile.writelines(location)
- confFile.writelines(allowBrowse)
- confFile.writelines(autoIndex)
- confFile.writelines(accessControl)
- confFile.writelines(allow)
- confFile.writelines(deny)
- confFile.writelines(accessControlEnds)
- confFile.write(rewriteInherit)
+ confFile.writelines(context)
+ confFile.writelines(location)
+ confFile.writelines(allowBrowse)
+ confFile.writelines(autoIndex)
+ confFile.writelines(accessControl)
+ confFile.writelines(allow)
+ confFile.writelines(deny)
+ confFile.writelines(accessControlEnds)
+ confFile.write(rewriteInherit)
- confFile.writelines(phpIniOverride)
- if openBasedir == 1:
- confFile.writelines(php_admin_value)
- confFile.write(php_value)
- confFile.write(php_value_upload_max_size)
- confFile.write(php_value_post_max_size)
- confFile.writelines(endPHPIniOverride)
+ confFile.writelines(phpIniOverride)
+ if openBasedir == 1:
+ confFile.writelines(php_admin_value)
+ confFile.write(php_value)
+ confFile.write(php_value_upload_max_size)
+ confFile.write(php_value_post_max_size)
+ confFile.writelines(endPHPIniOverride)
- confFile.writelines(defaultCharSet)
- confFile.writelines(contextEnds)
+ confFile.writelines(defaultCharSet)
+ confFile.writelines(contextEnds)
- ## OpenBase Dir Protection
+ ## OpenBase Dir Protection
- phpIniOverride = "phpIniOverride {\n"
- php_admin_value = 'php_admin_value open_basedir "/tmp:$VH_ROOT"\n'
- endPHPIniOverride = "}\n"
+ phpIniOverride = "phpIniOverride {\n"
+ php_admin_value = 'php_admin_value open_basedir "/tmp:$VH_ROOT"\n'
+ endPHPIniOverride = "}\n"
- confFile.writelines(phpIniOverride)
- if openBasedir == 1:
- confFile.writelines(php_admin_value)
- confFile.writelines(endPHPIniOverride)
+ confFile.writelines(phpIniOverride)
+ if openBasedir == 1:
+ confFile.writelines(php_admin_value)
+ confFile.writelines(endPHPIniOverride)
- htaccessAutoLoad = """
-rewrite {
- enable 1
- autoLoadHtaccess 1
-}
-"""
- confFile.write(htaccessAutoLoad)
+ htaccessAutoLoad = """
+ rewrite {
+ enable 1
+ autoLoadHtaccess 1
+ }
+ """
+ confFile.write(htaccessAutoLoad)
- confFile.close()
+ confFile.close()
+
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [IO Error with per host config file [perHostVirtualConf]]")
+ return 0
+ return 1
+ else:
+ try:
+ confFile = open(vhFile, "w+")
+
+ doNotModify = '# Do not modify this file, this is auto-generated file.\n\n'
+
+ VirtualHost = '
\n\n'
+ ServerName = ' ServerName ' + virtualHostName + '\n'
+ ServerAlias = ' ServerAlias www.' + virtualHostName + '\n'
+ ScriptAlias = ' Alias /.filemanager/ /usr/local/lsws/FileManager\n'
+ ServerAdmin = ' ServerAdmin ' + administratorEmail + '\n'
+ SeexecUserGroup = ' SuexecUserGroup ' + virtualHostUser + ' ' + virtualHostUser + '\n'
+ DocumentRoot = ' DocumentRoot /home/' + virtualHostName + '/public_html\n'
+ CustomLogCombined = ' CustomLog /home/' + virtualHostName + '/logs/' + virtualHostName + '.access_log combined\n'
+
+ confFile.writelines(doNotModify)
+ confFile.writelines(VirtualHost)
+ confFile.writelines(ServerName)
+ confFile.writelines(ServerAlias)
+ confFile.writelines(ScriptAlias)
+ confFile.writelines(ServerAdmin)
+ confFile.writelines(SeexecUserGroup)
+ confFile.writelines(DocumentRoot)
+ confFile.writelines(CustomLogCombined)
+
+ DirectoryFileManager = """\n
+ Options +Includes -Indexes +ExecCGI
+ php_value display_errors "Off"
+ php_value upload_max_filesize "200M"
+ php_value post_max_size "250M"
+ \n"""
+ confFile.writelines(DirectoryFileManager)
+
+ ## external app
+
+ if phpVersion == "PHP 5.3":
+ php = "53"
+ elif phpVersion == "PHP 5.4":
+ php = "55"
+ elif phpVersion == "PHP 5.5":
+ php = "55"
+ elif phpVersion == "PHP 5.6":
+ php = "56"
+ elif phpVersion == "PHP 7.0":
+ php = "70"
+ elif phpVersion == "PHP 7.1":
+ php = "71"
+ elif phpVersion == "PHP 7.2":
+ php = "72"
+
+ AddType = ' AddHandler application/x-httpd-php' + php + ' .php .php7 .phtml\n\n'
+ VirtualHostEnd = '\n'
+
+ confFile.writelines(AddType)
+ confFile.writelines(VirtualHostEnd)
+
+ confFile.close()
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [IO Error with per host config file [perHostVirtualConf]]")
+ return 0
+ return 1
- except BaseException, msg:
- logging.CyberCPLogFileWriter.writeToFile(
- str(msg) + " [IO Error with per host config file [perHostVirtualConf]]")
- return 0
- return 1
@staticmethod
def createNONSSLMapEntry(virtualHostName):
@@ -420,121 +490,203 @@ rewrite {
#restrained 1
#}
- try:
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ try:
- if vhost.createNONSSLMapEntry(virtualHostName) == 0:
- return [0, "Failed to create NON SSL Map Entry [createConfigInMainVirtualHostFile]"]
+ if vhost.createNONSSLMapEntry(virtualHostName) == 0:
+ return [0, "Failed to create NON SSL Map Entry [createConfigInMainVirtualHostFile]"]
- writeDataToFile = open("/usr/local/lsws/conf/httpd_config.conf", 'a')
+ writeDataToFile = open("/usr/local/lsws/conf/httpd_config.conf", 'a')
- writeDataToFile.writelines("virtualHost " + virtualHostName + " {\n")
- writeDataToFile.writelines(" vhRoot /home/$VH_NAME\n")
- writeDataToFile.writelines(" configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhost.conf\n")
- writeDataToFile.writelines(" allowSymbolLink 1\n")
- writeDataToFile.writelines(" enableScript 1\n")
- writeDataToFile.writelines(" restrained 1\n")
- writeDataToFile.writelines("}\n")
- writeDataToFile.writelines("\n")
+ writeDataToFile.writelines("virtualHost " + virtualHostName + " {\n")
+ writeDataToFile.writelines(" vhRoot /home/$VH_NAME\n")
+ writeDataToFile.writelines(" configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhost.conf\n")
+ writeDataToFile.writelines(" allowSymbolLink 1\n")
+ writeDataToFile.writelines(" enableScript 1\n")
+ writeDataToFile.writelines(" restrained 1\n")
+ writeDataToFile.writelines("}\n")
+ writeDataToFile.writelines("\n")
- writeDataToFile.close()
+ writeDataToFile.close()
- writeDataToFile.close()
- return [1,"None"]
+ writeDataToFile.close()
+ return [1,"None"]
+ except BaseException,msg:
+ logging.CyberCPLogFileWriter.writeToFile(str(msg) + "223 [IO Error with main config file [createConfigInMainVirtualHostFile]]")
+ return [0,"223 [IO Error with main config file [createConfigInMainVirtualHostFile]]"]
+ else:
+ try:
+ writeDataToFile = open("/usr/local/lsws/conf/httpd.conf", 'a')
+ configFile = 'Include /usr/local/lsws/conf/vhosts/' + virtualHostName + '/vhost.conf\n'
+ writeDataToFile.writelines(configFile)
+ writeDataToFile.close()
- except BaseException,msg:
- logging.CyberCPLogFileWriter.writeToFile(str(msg) + "223 [IO Error with main config file [createConfigInMainVirtualHostFile]]")
- return [0,"223 [IO Error with main config file [createConfigInMainVirtualHostFile]]"]
+ writeDataToFile.close()
+ return [1, "None"]
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + "223 [IO Error with main config file [createConfigInMainVirtualHostFile]]")
+ return [0, "223 [IO Error with main config file [createConfigInMainVirtualHostFile]]"]
@staticmethod
def deleteVirtualHostConfigurations(virtualHostName):
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ try:
- try:
+ ## Deleting master conf
+ numberOfSites = str(Websites.objects.count() + ChildDomains.objects.count())
+ vhost.deleteCoreConf(virtualHostName, numberOfSites)
- ## Deleting master conf
- numberOfSites = str(Websites.objects.count() + ChildDomains.objects.count())
- vhost.deleteCoreConf(virtualHostName, numberOfSites)
+ delWebsite = Websites.objects.get(domain=virtualHostName)
+ databases = Databases.objects.filter(website=delWebsite)
- delWebsite = Websites.objects.get(domain=virtualHostName)
- databases = Databases.objects.filter(website=delWebsite)
+ childDomains = delWebsite.childdomains_set.all()
- childDomains = delWebsite.childdomains_set.all()
+ ## Deleting child domains
- ## Deleting child domains
+ for items in childDomains:
+ numberOfSites = Websites.objects.count() + ChildDomains.objects.count()
+ vhost.deleteCoreConf(items.domain, numberOfSites)
- for items in childDomains:
- numberOfSites = Websites.objects.count() + ChildDomains.objects.count()
- vhost.deleteCoreConf(items.domain, numberOfSites)
+ for items in databases:
+ mysqlUtilities.deleteDatabase(items.dbName, items.dbUser)
- for items in databases:
- mysqlUtilities.deleteDatabase(items.dbName, items.dbUser)
+ delWebsite.delete()
- delWebsite.delete()
+ ## Deleting DNS Zone if there is any.
- ## Deleting DNS Zone if there is any.
+ DNS.deleteDNSZone(virtualHostName)
- DNS.deleteDNSZone(virtualHostName)
+ installUtilities.installUtilities.reStartLiteSpeed()
- installUtilities.installUtilities.reStartLiteSpeed()
+ ## Delete mail accounts
- ## Delete mail accounts
+ command = "sudo rm -rf /home/vmail/" + virtualHostName
+ subprocess.call(shlex.split(command))
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [Not able to remove virtual host configuration from main configuration file.]")
+ return 0
+ return 1
+ else:
+ try:
+ ## Deleting master conf
+ numberOfSites = str(Websites.objects.count() + ChildDomains.objects.count())
+ vhost.deleteCoreConf(virtualHostName, numberOfSites)
- command = "sudo rm -rf /home/vmail/" + virtualHostName
- subprocess.call(shlex.split(command))
+ delWebsite = Websites.objects.get(domain=virtualHostName)
+ databases = Databases.objects.filter(website=delWebsite)
- except BaseException, msg:
- logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [Not able to remove virtual host configuration from main configuration file.]")
- return 0
+ childDomains = delWebsite.childdomains_set.all()
+
+ ## Deleting child domains
+
+ for items in childDomains:
+ numberOfSites = Websites.objects.count() + ChildDomains.objects.count()
+ vhost.deleteCoreConf(items.domain, numberOfSites)
+
+ for items in databases:
+ mysqlUtilities.deleteDatabase(items.dbName, items.dbUser)
+
+ delWebsite.delete()
+
+ ## Deleting DNS Zone if there is any.
+
+ DNS.deleteDNSZone(virtualHostName)
+
+ installUtilities.installUtilities.reStartLiteSpeed()
+
+ ## Delete mail accounts
+
+ command = "sudo rm -rf /home/vmail/" + virtualHostName
+ subprocess.call(shlex.split(command))
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [Not able to remove virtual host configuration from main configuration file.]")
+ return 0
+ return 1
- return 1
@staticmethod
def deleteCoreConf(virtualHostName, numberOfSites):
- try:
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ try:
+ virtualHostPath = "/home/" + virtualHostName
+ if os.path.exists(virtualHostPath):
+ shutil.rmtree(virtualHostPath)
+
+ confPath = vhost.Server_root + "/conf/vhosts/" + virtualHostName
+ if os.path.exists(confPath):
+ shutil.rmtree(confPath)
+
+ data = open("/usr/local/lsws/conf/httpd_config.conf").readlines()
+
+ writeDataToFile = open("/usr/local/lsws/conf/httpd_config.conf", 'w')
+
+ check = 1
+ sslCheck = 1
+
+ for items in data:
+ if numberOfSites == 1:
+ if (items.find(' ' + virtualHostName) > -1 and items.find(" map " + virtualHostName) > -1):
+ continue
+ if (items.find(' ' + virtualHostName) > -1 and (items.find("virtualHost") > -1 or items.find("virtualhost") > -1)):
+ check = 0
+ if items.find("listener") > -1 and items.find("SSL") > -1:
+ sslCheck = 0
+ if (check == 1 and sslCheck == 1):
+ writeDataToFile.writelines(items)
+ if (items.find("}") > -1 and (check == 0 or sslCheck == 0)):
+ check = 1
+ sslCheck = 1
+ else:
+ if (items.find(' ' + virtualHostName) > -1 and items.find(" map " + virtualHostName) > -1):
+ continue
+ if (items.find(' ' + virtualHostName) > -1 and (items.find("virtualHost") > -1 or items.find("virtualhost") > -1)):
+ check = 0
+ if (check == 1):
+ writeDataToFile.writelines(items)
+ if (items.find("}") > -1 and check == 0):
+ check = 1
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [Not able to remove virtual host configuration from main configuration file.]")
+ return 0
+ return 1
+ else:
virtualHostPath = "/home/" + virtualHostName
- if os.path.exists(virtualHostPath):
+ try:
shutil.rmtree(virtualHostPath)
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [Not able to remove virtual host directory from /home continuing..]")
- confPath = vhost.Server_root + "/conf/vhosts/" + virtualHostName
- if os.path.exists(confPath):
+ try:
+ confPath = vhost.Server_root + "/conf/vhosts/" + virtualHostName
shutil.rmtree(confPath)
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [Not able to remove virtual host configuration directory from /conf ]")
- data = open("/usr/local/lsws/conf/httpd_config.conf").readlines()
+ try:
+ data = open("/usr/local/lsws/conf/httpd.conf").readlines()
- writeDataToFile = open("/usr/local/lsws/conf/httpd_config.conf", 'w')
+ writeDataToFile = open("/usr/local/lsws/conf/httpd.conf", 'w')
- check = 1
- sslCheck = 1
-
- for items in data:
- if numberOfSites == 1:
- if (items.find(' ' + virtualHostName) > -1 and items.find(" map " + virtualHostName) > -1):
- continue
- if (items.find(' ' + virtualHostName) > -1 and (items.find("virtualHost") > -1 or items.find("virtualhost") > -1)):
- check = 0
- if items.find("listener") > -1 and items.find("SSL") > -1:
- sslCheck = 0
- if (check == 1 and sslCheck == 1):
+ for items in data:
+ if items.find('/' + virtualHostName + '/') > -1:
+ pass
+ else:
writeDataToFile.writelines(items)
- if (items.find("}") > -1 and (check == 0 or sslCheck == 0)):
- check = 1
- sslCheck = 1
- else:
- if (items.find(' ' + virtualHostName) > -1 and items.find(" map " + virtualHostName) > -1):
- continue
- if (items.find(' ' + virtualHostName) > -1 and (items.find("virtualHost") > -1 or items.find("virtualhost") > -1)):
- check = 0
- if (check == 1):
- writeDataToFile.writelines(items)
- if (items.find("}") > -1 and check == 0):
- check = 1
- except BaseException, msg:
- logging.CyberCPLogFileWriter.writeToFile(
- str(msg) + " [Not able to remove virtual host configuration from main configuration file.]")
- return 0
- return 1
+ writeDataToFile.close()
+
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [Not able to remove virtual host configuration from main configuration file.]")
+ return 0
+ return 1
@staticmethod
def checkIfVirtualHostExists(virtualHostName):
@@ -544,51 +696,88 @@ rewrite {
@staticmethod
def changePHP(vhFile, phpVersion):
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ finalphp = 0
+ try:
+ data = open(vhFile, "r").readlines()
- # General Configurations tab
+ if phpVersion == "PHP 5.3":
+ finalphp = 53
+ elif phpVersion == "PHP 5.4":
+ finalphp = 54
+ elif phpVersion == "PHP 5.5":
+ finalphp = 55
+ elif phpVersion == "PHP 5.6":
+ finalphp = 56
+ elif phpVersion == "PHP 7.0":
+ finalphp = 70
+ elif phpVersion == "PHP 7.1":
+ finalphp = 71
+ elif phpVersion == "PHP 7.2":
+ finalphp = 72
- finalphp = 0
+ writeDataToFile = open(vhFile, "w")
- try:
- data = open(vhFile, "r").readlines()
+ path = " path /usr/local/lsws/lsphp" + str(finalphp) + "/bin/lsphp\n"
- if phpVersion == "PHP 5.3":
- finalphp = 53
- elif phpVersion == "PHP 5.4":
- finalphp = 54
- elif phpVersion == "PHP 5.5":
- finalphp = 55
- elif phpVersion == "PHP 5.6":
- finalphp = 56
- elif phpVersion == "PHP 7.0":
- finalphp = 70
- elif phpVersion == "PHP 7.1":
- finalphp = 71
- elif phpVersion == "PHP 7.2":
- finalphp = 72
+ for items in data:
+ if items.find("/usr/local/lsws/lsphp") > -1 and items.find("path") > -1:
+ writeDataToFile.writelines(path)
+ else:
+ writeDataToFile.writelines(items)
- writeDataToFile = open(vhFile, "w")
+ writeDataToFile.close()
- path = " path /usr/local/lsws/lsphp" + str(finalphp) + "/bin/lsphp\n"
+ installUtilities.installUtilities.reStartLiteSpeed()
- for items in data:
- if items.find("/usr/local/lsws/lsphp") > -1 and items.find("path") > -1:
- writeDataToFile.writelines(path)
- else:
- writeDataToFile.writelines(items)
+ print "1,None"
+ return 1,'None'
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [IO Error with per host config file [changePHP]]")
+ print 0,str(msg)
+ return [0, str(msg) + " [IO Error with per host config file [changePHP]]"]
+ else:
+ try:
+ data = open(vhFile, "r").readlines()
+ if phpVersion == "PHP 5.3":
+ finalphp = 53
- writeDataToFile.close()
+ elif phpVersion == "PHP 5.4":
+ finalphp = 54
+ elif phpVersion == "PHP 5.5":
+ finalphp = 55
+ elif phpVersion == "PHP 5.6":
+ finalphp = 56
+ elif phpVersion == "PHP 7.0":
+ finalphp = 70
+ elif phpVersion == "PHP 7.1":
+ finalphp = 71
+ elif phpVersion == "PHP 7.2":
+ finalphp = 72
- installUtilities.installUtilities.reStartLiteSpeed()
+ writeDataToFile = open(vhFile, "w")
- print "1,None"
- return 1,'None'
+ finalString = ' AddHandler application/x-httpd-php' + str(finalphp) + ' .php\n'
+
+ for items in data:
+ if items.find("AddHandler application/x-httpd") > -1:
+ writeDataToFile.writelines(finalString)
+ else:
+ writeDataToFile.writelines(items)
+
+ writeDataToFile.close()
+
+ installUtilities.installUtilities.reStartLiteSpeed()
+
+ print "1,None"
+ return 1, 'None'
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [IO Error with per host config file [changePHP]]")
+ print 0, str(msg)
+ return [0, str(msg) + " [IO Error with per host config file [changePHP]]"]
- except BaseException, msg:
- logging.CyberCPLogFileWriter.writeToFile(
- str(msg) + " [IO Error with per host config file [changePHP]]")
- print 0,str(msg)
- return [0, str(msg) + " [IO Error with per host config file [changePHP]]"]
@staticmethod
def addRewriteRules(virtualHostName, fileName=None):
@@ -648,8 +837,6 @@ rewrite {
print str(inMB) + "," + str(percentage)
else:
print "0,0"
-
-
except OSError, msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [findDomainBW]")
print "0,0"
@@ -782,176 +969,227 @@ rewrite {
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [createDirectoryForDomain]]")
return [0, "[351 Not able to directories for virtual host [createDirectoryForDomain]]"]
- if vhost.perHostDomainConf(path, masterDomain, completePathToConfigFile,
- administratorEmail, phpVersion, virtualHostUser, openBasedir) == 1:
+ if vhost.perHostDomainConf(path, masterDomain, domain, completePathToConfigFile,
+ administratorEmail, phpVersion, virtualHostUser, openBasedir) == 1:
return [1, "None"]
else:
return [0, "[359 Not able to create per host virtual configurations [perHostVirtualConf]"]
@staticmethod
- def perHostDomainConf(path, masterDomain, vhFile, administratorEmail, phpVersion, virtualHostUser, openBasedir):
+ def perHostDomainConf(path, masterDomain, domain, vhFile, administratorEmail, phpVersion, virtualHostUser, openBasedir):
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ try:
+ confFile = open(vhFile, "w+")
- # General Configurations tab
+ docRoot = "docRoot " + path + "\n"
+ vhDomain = "vhDomain $VH_NAME" + "\n"
+ vhAliases = "vhAliases www.$VH_NAME" + "\n"
+ adminEmails = "adminEmails " + administratorEmail + "\n"
+ enableGzip = "enableGzip 1" + "\n"
+ enableIpGeo = "enableIpGeo 1" + "\n" + "\n"
- try:
- confFile = open(vhFile, "w+")
+ confFile.writelines(docRoot)
+ confFile.writelines(vhDomain)
+ confFile.writelines(vhAliases)
+ confFile.writelines(adminEmails)
+ confFile.writelines(enableGzip)
+ confFile.writelines(enableIpGeo)
- docRoot = "docRoot " + path + "\n"
- vhDomain = "vhDomain $VH_NAME" + "\n"
- vhAliases = "vhAliases www.$VH_NAME" + "\n"
- adminEmails = "adminEmails " + administratorEmail + "\n"
- enableGzip = "enableGzip 1" + "\n"
- enableIpGeo = "enableIpGeo 1" + "\n" + "\n"
+ # Index file settings
- confFile.writelines(docRoot)
- confFile.writelines(vhDomain)
- confFile.writelines(vhAliases)
- confFile.writelines(adminEmails)
- confFile.writelines(enableGzip)
- confFile.writelines(enableIpGeo)
+ index = "index {" + "\n"
+ userServer = " useServer 0" + "\n"
+ indexFiles = " indexFiles index.php, index.html" + "\n"
+ index_end = "}" + "\n" + "\n"
- # Index file settings
+ confFile.writelines(index)
+ confFile.writelines(userServer)
+ confFile.writelines(indexFiles)
+ confFile.writelines(index_end)
- index = "index {" + "\n"
- userServer = " useServer 0" + "\n"
- indexFiles = " indexFiles index.php, index.html" + "\n"
- index_end = "}" + "\n" + "\n"
-
- confFile.writelines(index)
- confFile.writelines(userServer)
- confFile.writelines(indexFiles)
- confFile.writelines(index_end)
-
- # Error Log Settings
+ # Error Log Settings
- error_log = "errorlog $VH_ROOT/logs/" + masterDomain + ".error_log {" + "\n"
- useServer = " useServer 0" + "\n"
- logLevel = " logLevel ERROR" + "\n"
- rollingSize = " rollingSize 10M" + "\n"
- error_log_end = "}" + "\n" + "\n"
+ error_log = "errorlog $VH_ROOT/logs/" + masterDomain + ".error_log {" + "\n"
+ useServer = " useServer 0" + "\n"
+ logLevel = " logLevel ERROR" + "\n"
+ rollingSize = " rollingSize 10M" + "\n"
+ error_log_end = "}" + "\n" + "\n"
- confFile.writelines(error_log)
- confFile.writelines(useServer)
- confFile.writelines(logLevel)
- confFile.writelines(rollingSize)
- confFile.writelines(error_log_end)
+ confFile.writelines(error_log)
+ confFile.writelines(useServer)
+ confFile.writelines(logLevel)
+ confFile.writelines(rollingSize)
+ confFile.writelines(error_log_end)
- # Access Log Settings
+ # Access Log Settings
- access_Log = "accesslog $VH_ROOT/logs/" + masterDomain + ".access_log {" + "\n"
- useServer = " useServer 0" + "\n"
- logFormat = ' logFormat "%v %h %l %u %t \"%r\" %>s %b"' + "\n"
- logHeaders = " logHeaders 5" + "\n"
- rollingSize = " rollingSize 10M" + "\n"
- keepDays = " keepDays 10"
- compressArchive = " compressArchive 1" + "\n"
- access_Log_end = "}" + "\n" + "\n"
+ access_Log = "accesslog $VH_ROOT/logs/" + masterDomain + ".access_log {" + "\n"
+ useServer = " useServer 0" + "\n"
+ logFormat = ' logFormat "%v %h %l %u %t \"%r\" %>s %b"' + "\n"
+ logHeaders = " logHeaders 5" + "\n"
+ rollingSize = " rollingSize 10M" + "\n"
+ keepDays = " keepDays 10"
+ compressArchive = " compressArchive 1" + "\n"
+ access_Log_end = "}" + "\n" + "\n"
- confFile.writelines(access_Log)
- confFile.writelines(useServer)
- confFile.writelines(logFormat)
- confFile.writelines(logHeaders)
- confFile.writelines(rollingSize)
- confFile.writelines(keepDays)
- confFile.writelines(compressArchive)
- confFile.writelines(access_Log_end)
+ confFile.writelines(access_Log)
+ confFile.writelines(useServer)
+ confFile.writelines(logFormat)
+ confFile.writelines(logHeaders)
+ confFile.writelines(rollingSize)
+ confFile.writelines(keepDays)
+ confFile.writelines(compressArchive)
+ confFile.writelines(access_Log_end)
- ## OpenBase Dir Protection
+ ## OpenBase Dir Protection
- phpIniOverride = "phpIniOverride {\n"
- php_admin_value = 'php_admin_value open_basedir "/tmp:/usr/local/lsws/Example/html/FileManager:$VH_ROOT"\n'
- endPHPIniOverride = "}\n"
+ phpIniOverride = "phpIniOverride {\n"
+ php_admin_value = 'php_admin_value open_basedir "/tmp:/usr/local/lsws/Example/html/FileManager:$VH_ROOT"\n'
+ endPHPIniOverride = "}\n"
- confFile.writelines(phpIniOverride)
- if openBasedir == 1:
- confFile.writelines(php_admin_value)
- confFile.writelines(endPHPIniOverride)
+ confFile.writelines(phpIniOverride)
+ if openBasedir == 1:
+ confFile.writelines(php_admin_value)
+ confFile.writelines(endPHPIniOverride)
- # php settings
+ # php settings
- sockRandomPath = str(randint(1000, 9999))
+ sockRandomPath = str(randint(1000, 9999))
- scripthandler = "scripthandler {" + "\n"
- add = " add lsapi:" + virtualHostUser + sockRandomPath + " php" + "\n"
- php_end = "}" + "\n" + "\n"
+ scripthandler = "scripthandler {" + "\n"
+ add = " add lsapi:" + virtualHostUser + sockRandomPath + " php" + "\n"
+ php_end = "}" + "\n" + "\n"
- confFile.writelines(scripthandler)
- confFile.writelines(add)
- confFile.writelines(php_end)
+ confFile.writelines(scripthandler)
+ confFile.writelines(add)
+ confFile.writelines(php_end)
- ## external app
+ ## external app
- if phpVersion == "PHP 5.3":
- php = "53"
- elif phpVersion == "PHP 5.4":
- php = "55"
- elif phpVersion == "PHP 5.5":
- php = "55"
- elif phpVersion == "PHP 5.6":
- php = "56"
- elif phpVersion == "PHP 7.0":
- php = "70"
- elif phpVersion == "PHP 7.1":
- php = "71"
- elif phpVersion == "PHP 7.2":
- php = "72"
+ if phpVersion == "PHP 5.3":
+ php = "53"
+ elif phpVersion == "PHP 5.4":
+ php = "55"
+ elif phpVersion == "PHP 5.5":
+ php = "55"
+ elif phpVersion == "PHP 5.6":
+ php = "56"
+ elif phpVersion == "PHP 7.0":
+ php = "70"
+ elif phpVersion == "PHP 7.1":
+ php = "71"
+ elif phpVersion == "PHP 7.2":
+ php = "72"
- extprocessor = "extprocessor " + virtualHostUser + sockRandomPath + " {\n"
- type = " type lsapi\n"
- address = " address UDS://tmp/lshttpd/" + virtualHostUser + sockRandomPath + ".sock\n"
- maxConns = " maxConns 10\n"
- env = " env LSAPI_CHILDREN=10\n"
- initTimeout = " initTimeout 60\n"
- retryTimeout = " retryTimeout 0\n"
- persistConn = " persistConn 1\n"
- persistConnTimeout = " pcKeepAliveTimeout 1\n"
- respBuffer = " respBuffer 0\n"
- autoStart = " autoStart 1\n"
- path = " path /usr/local/lsws/lsphp" + php + "/bin/lsphp\n"
- extUser = " extUser " + virtualHostUser + "\n"
- extGroup = " extGroup " + virtualHostUser + "\n"
- memSoftLimit = " memSoftLimit 2047M\n"
- memHardLimit = " memHardLimit 2047M\n"
- procSoftLimit = " procSoftLimit 400\n"
- procHardLimit = " procHardLimit 500\n"
- extprocessorEnd = "}\n"
+ extprocessor = "extprocessor " + virtualHostUser + sockRandomPath + " {\n"
+ type = " type lsapi\n"
+ address = " address UDS://tmp/lshttpd/" + virtualHostUser + sockRandomPath + ".sock\n"
+ maxConns = " maxConns 10\n"
+ env = " env LSAPI_CHILDREN=10\n"
+ initTimeout = " initTimeout 60\n"
+ retryTimeout = " retryTimeout 0\n"
+ persistConn = " persistConn 1\n"
+ persistConnTimeout = " pcKeepAliveTimeout 1\n"
+ respBuffer = " respBuffer 0\n"
+ autoStart = " autoStart 1\n"
+ path = " path /usr/local/lsws/lsphp" + php + "/bin/lsphp\n"
+ extUser = " extUser " + virtualHostUser + "\n"
+ extGroup = " extGroup " + virtualHostUser + "\n"
+ memSoftLimit = " memSoftLimit 2047M\n"
+ memHardLimit = " memHardLimit 2047M\n"
+ procSoftLimit = " procSoftLimit 400\n"
+ procHardLimit = " procHardLimit 500\n"
+ extprocessorEnd = "}\n"
- confFile.writelines(extprocessor)
- confFile.writelines(type)
- confFile.writelines(address)
- confFile.writelines(maxConns)
- confFile.writelines(env)
- confFile.writelines(initTimeout)
- confFile.writelines(retryTimeout)
- confFile.writelines(persistConn)
- confFile.writelines(persistConnTimeout)
- confFile.writelines(respBuffer)
- confFile.writelines(autoStart)
- confFile.writelines(path)
- confFile.writelines(extUser)
- confFile.writelines(extGroup)
- confFile.writelines(memSoftLimit)
- confFile.writelines(memHardLimit)
- confFile.writelines(procSoftLimit)
- confFile.writelines(procHardLimit)
- confFile.writelines(extprocessorEnd)
+ confFile.writelines(extprocessor)
+ confFile.writelines(type)
+ confFile.writelines(address)
+ confFile.writelines(maxConns)
+ confFile.writelines(env)
+ confFile.writelines(initTimeout)
+ confFile.writelines(retryTimeout)
+ confFile.writelines(persistConn)
+ confFile.writelines(persistConnTimeout)
+ confFile.writelines(respBuffer)
+ confFile.writelines(autoStart)
+ confFile.writelines(path)
+ confFile.writelines(extUser)
+ confFile.writelines(extGroup)
+ confFile.writelines(memSoftLimit)
+ confFile.writelines(memHardLimit)
+ confFile.writelines(procSoftLimit)
+ confFile.writelines(procHardLimit)
+ confFile.writelines(extprocessorEnd)
- htaccessAutoLoad = """
-rewrite {
- enable 1
- autoLoadHtaccess 1
-}
-"""
- confFile.write(htaccessAutoLoad)
+ htaccessAutoLoad = """
+ rewrite {
+ enable 1
+ autoLoadHtaccess 1
+ }
+ """
+ confFile.write(htaccessAutoLoad)
- confFile.close()
+ confFile.close()
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [IO Error with per host config file [perHostDomainConf]]")
+ return 0
+ return 1
+ else:
+ try:
+
+ confFile = open(vhFile, "w+")
+
+ doNotModify = '# Do not modify this file, this is auto-generated file.\n\n'
+
+ VirtualHost = '
\n\n'
+ ServerName = ' ServerName ' + domain + '\n'
+ ServerAlias = ' ServerAlias www.' + domain + '\n'
+ ServerAdmin = ' ServerAdmin ' + administratorEmail + '\n'
+ SeexecUserGroup = ' SuexecUserGroup ' + virtualHostUser + ' ' + virtualHostUser + '\n'
+ DocumentRoot = ' DocumentRoot ' + path + '\n'
+ CustomLogCombined = ' CustomLog /home/' + masterDomain + '/logs/' + masterDomain + '.access_log combined\n'
+
+ confFile.writelines(doNotModify)
+ confFile.writelines(VirtualHost)
+ confFile.writelines(ServerName)
+ confFile.writelines(ServerAlias)
+ confFile.writelines(ServerAdmin)
+ confFile.writelines(SeexecUserGroup)
+ confFile.writelines(DocumentRoot)
+ confFile.writelines(CustomLogCombined)
+
+ ## external app
+
+ if phpVersion == "PHP 5.3":
+ php = "53"
+ elif phpVersion == "PHP 5.4":
+ php = "55"
+ elif phpVersion == "PHP 5.5":
+ php = "55"
+ elif phpVersion == "PHP 5.6":
+ php = "56"
+ elif phpVersion == "PHP 7.0":
+ php = "70"
+ elif phpVersion == "PHP 7.1":
+ php = "71"
+ elif phpVersion == "PHP 7.2":
+ php = "72"
+
+ AddType = ' AddHandler application/x-httpd-php' + php + ' .php .php7 .phtml\n\n'
+ VirtualHostEnd = '\n'
+
+ confFile.writelines(AddType)
+ confFile.writelines(VirtualHostEnd)
+
+ confFile.close()
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + " [IO Error with per host config file [perHostDomainConf]]")
+ return 0
+ return 1
- except BaseException, msg:
- logging.CyberCPLogFileWriter.writeToFile(
- str(msg) + " [IO Error with per host config file [perHostDomainConf]]")
- return 0
- return 1
@staticmethod
def createConfigInMainDomainHostFile(domain, masterDomain):
@@ -963,28 +1201,40 @@ rewrite {
# restrained 1
# }
- try:
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ try:
- if vhost.createNONSSLMapEntry(domain) == 0:
- return [0, "Failed to create NON SSL Map Entry [createConfigInMainVirtualHostFile]"]
+ if vhost.createNONSSLMapEntry(domain) == 0:
+ return [0, "Failed to create NON SSL Map Entry [createConfigInMainVirtualHostFile]"]
- writeDataToFile = open("/usr/local/lsws/conf/httpd_config.conf", 'a')
+ writeDataToFile = open("/usr/local/lsws/conf/httpd_config.conf", 'a')
- writeDataToFile.writelines("\n")
- writeDataToFile.writelines("virtualHost " + domain + " {\n")
- writeDataToFile.writelines(" vhRoot /home/" + masterDomain + "\n")
- writeDataToFile.writelines(" configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhost.conf\n")
- writeDataToFile.writelines(" allowSymbolLink 1\n")
- writeDataToFile.writelines(" enableScript 1\n")
- writeDataToFile.writelines(" restrained 1\n")
- writeDataToFile.writelines("}\n")
- writeDataToFile.writelines("\n")
+ writeDataToFile.writelines("\n")
+ writeDataToFile.writelines("virtualHost " + domain + " {\n")
+ writeDataToFile.writelines(" vhRoot /home/" + masterDomain + "\n")
+ writeDataToFile.writelines(" configFile $SERVER_ROOT/conf/vhosts/$VH_NAME/vhost.conf\n")
+ writeDataToFile.writelines(" allowSymbolLink 1\n")
+ writeDataToFile.writelines(" enableScript 1\n")
+ writeDataToFile.writelines(" restrained 1\n")
+ writeDataToFile.writelines("}\n")
+ writeDataToFile.writelines("\n")
- writeDataToFile.close()
+ writeDataToFile.close()
- return [1, "None"]
+ return [1, "None"]
- except BaseException, msg:
- logging.CyberCPLogFileWriter.writeToFile(
- str(msg) + "223 [IO Error with main config file [createConfigInMainDomainHostFile]]")
- return [0, "223 [IO Error with main config file [createConfigInMainDomainHostFile]]"]
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + "223 [IO Error with main config file [createConfigInMainDomainHostFile]]")
+ return [0, "223 [IO Error with main config file [createConfigInMainDomainHostFile]]"]
+ else:
+ try:
+ writeDataToFile = open("/usr/local/lsws/conf/httpd.conf", 'a')
+ configFile = 'Include /usr/local/lsws/conf/vhosts/' + domain + '/vhost.conf\n'
+ writeDataToFile.writelines(configFile)
+ writeDataToFile.close()
+ return [1, "None"]
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(
+ str(msg) + "223 [IO Error with main config file [createConfigInMainDomainHostFile]]")
+ return [0, "223 [IO Error with main config file [createConfigInMainDomainHostFile]]"]
diff --git a/plogical/website.py b/plogical/website.py
index eca026cf5..e35f3c6d3 100644
--- a/plogical/website.py
+++ b/plogical/website.py
@@ -150,7 +150,6 @@ class WebsiteManager:
## Create Configurations
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
-
execPath = execPath + " createVirtualHost --virtualHostName " + domain + \
" --administratorEmail " + adminEmail + " --phpVersion '" + phpSelection + \
"' --virtualHostUser " + externalApp + " --ssl " + str(data['ssl']) + " --dkimCheck " \
diff --git a/serverStatus/litespeed/FileManager/.idea/FIleManager.iml b/serverStatus/litespeed/FileManager/.idea/FIleManager.iml
new file mode 100644
index 000000000..c956989b2
--- /dev/null
+++ b/serverStatus/litespeed/FileManager/.idea/FIleManager.iml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/serverStatus/litespeed/FileManager/.idea/modules.xml b/serverStatus/litespeed/FileManager/.idea/modules.xml
new file mode 100644
index 000000000..34abd3fc4
--- /dev/null
+++ b/serverStatus/litespeed/FileManager/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/serverStatus/litespeed/FileManager/.idea/workspace.xml b/serverStatus/litespeed/FileManager/.idea/workspace.xml
new file mode 100644
index 000000000..026ca8720
--- /dev/null
+++ b/serverStatus/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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/serverStatus/litespeed/FileManager/php/caller.php b/serverStatus/litespeed/FileManager/php/caller.php
new file mode 100755
index 000000000..6a5d4cf17
--- /dev/null
+++ b/serverStatus/litespeed/FileManager/php/caller.php
@@ -0,0 +1,127 @@
+basePath = $basePath ?: dirname(__DIR__);
+ }
+
+ public function requestHandler()
+ {
+ if ($_SERVER['REQUEST_METHOD'] === 'POST' and isset($_POST['method'])) {
+
+ $pathToSeed = '/home/' . $_POST['domainName'] . '/..filemanagerkey';
+ $receivedSeed = $_POST['domainRandomSeed'];
+
+ $myfile = fopen($pathToSeed, "r") or die("Unable to open file!");
+ $seed = fread($myfile,filesize($pathToSeed));
+ fclose($myfile);
+
+ if ($seed != $receivedSeed){
+ $answer = array(
+ 'uploadStatus' => 0,
+ 'answer' => 'Not allowed to upload in this path.',
+ 'error_message' => "None",
+ 'fileName' => $_FILES['file']['name']
+ );
+ $json = json_encode($answer);
+ echo $json;
+ return;
+ }
+
+ switch ($_POST['method']) {
+ case 'upload':
+ $this->uploadFile();
+ break;
+ }
+ }
+ }
+
+ private function uploadFile(){
+ try {
+ if (!empty($_FILES)) {
+
+ if($this->return_bytes(ini_get('upload_max_filesize')) < $_SERVER['CONTENT_LENGTH']){
+ throw new Exception("Size of uploaded file is greater than upload limit!");
+ }
+
+ $completePath = $this->cleanInput($_POST['completePath']);
+ $fileName = $this->cleanInput($_FILES['file']['name']);
+ $homePath = $this->cleanInput($_POST['home']);
+
+ $tempPath = $_FILES['file']['tmp_name'];
+ $uploadPath = $completePath . DIRECTORY_SEPARATOR . $fileName;
+
+ $pos = strpos($uploadPath, $homePath);
+
+ if ($pos === false) {
+ throw new Exception("Not allowed to upload in this path!");
+ }
+
+
+ if(move_uploaded_file($tempPath, $uploadPath)==true){
+ $answer = array(
+ 'uploadStatus' => 1,
+ 'answer' => 'File transfer completed',
+ 'error_message' => "None",
+ 'fileName' => $_FILES['file']['name']
+ );
+ $json = json_encode($answer);
+ echo $json;
+ }
+ else{
+ throw new Exception("Can not move uploaded file to destination location!");
+ }
+
+ }
+ else {
+ throw new Exception("No Files to upload!");
+ }
+ }
+ catch(Exception $e) {
+ $answer = array(
+ 'uploadStatus' => 0,
+ 'answer' => 'No files',
+ 'error_message' => $e->getMessage(),
+ 'fileName' => $_FILES['file']['name'],
+ );
+ $json = json_encode($answer);
+ echo $json;
+ }
+
+ }
+
+ private function return_bytes($val) {
+ $val = trim($val);
+ $last = strtolower($val[strlen($val)-1]);
+ switch($last) {
+ // The 'G' modifier is available since PHP 5.1.0
+ case 'g':
+ $val *= 1024;
+ case 'm':
+ $val *= 1024;
+ case 'k':
+ $val *= 1024;
+ }
+
+ return $val;
+ }
+
+ private function cleanInput($input) {
+ $search = array(
+ '@@si',
+ '@<[\/\!]*?[^<>]*?>@si',
+ '@@siU',
+ '@@'
+ );
+ $output = preg_replace($search, '', $input);
+ return $output;
+ }
+
+}
+
+$caller = new Caller("/");
+$caller->requestHandler();
\ No newline at end of file
diff --git a/serverStatus/litespeed/FileManager/php/fileManager.php b/serverStatus/litespeed/FileManager/php/fileManager.php
new file mode 100755
index 000000000..d57668452
--- /dev/null
+++ b/serverStatus/litespeed/FileManager/php/fileManager.php
@@ -0,0 +1,748 @@
+domainName . '/..filemanagerkey';
+ $receivedSeed = $request->domainRandomSeed;
+
+ $myfile = fopen($pathToSeed, "r") or die("Unable to open file!");
+ $seed = fread($myfile,filesize($pathToSeed));
+ fclose($myfile);
+
+ if ($seed != $receivedSeed){
+
+ $json_data = array(
+ "error_message" => "You can not open filemanager for this domain.",
+ "copied" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ return;
+ }
+
+
+ if (isset($request->method)) {
+
+ switch ($request->method) {
+ case 'list':
+ $this->listDir($request->completeStartingPath);
+ break;
+ case 'listForTable':
+ $home = $this->cleanInput($request->home);
+ $completeStartingPath = $this->cleanInput($request->completeStartingPath);
+ $this->listForTable($home,$completeStartingPath);
+ break;
+ case 'readFileContents':
+ $this->readFileContents($request->fileName);
+ break;
+ case 'writeFileContents':
+ $this->writeFileContents($request->fileName, $request->fileContent);
+ break;
+ case 'createNewFolder':
+ $folderName = $this->cleanInput($request->folderName);
+ $this->createNewFolder($folderName);
+ break;
+ case 'createNewFile':
+ $fileName = $this->cleanInput($request->fileName);
+ $this->createNewFile($fileName);
+ break;
+ case 'deleteFolderOrFile':
+ $this->deleteFolderOrFile($request->path, $request->fileAndFolders);
+ break;
+ case 'compress':
+ $compressedFileName = $this->cleanInput($request->compressedFileName);
+ $this->compress($request->basePath, $request->listOfFiles, $compressedFileName, $request->compressionType);
+ break;
+ case 'extract':
+ $extractionLocation = $this->cleanInput($request->extractionLocation);
+ $this->extract($request->home,$request->basePath,$request->fileToExtract,$request->extractionType,$extractionLocation);
+ break;
+ case 'move':
+ $this->moveFileAndFolders($request->home,$request->basePath,$request->newPath,$request->fileAndFolders);
+ break;
+ case 'copy':
+ $this->copyFileAndFolders($request->home,$request->basePath,$request->newPath,$request->fileAndFolders);
+ break;
+ case 'rename':
+ $newFileName = $this->cleanInput($request->newFileName);
+ $this->renameFileOrFolder($request->basePath,$request->existingName,$newFileName);
+ break;
+ case 'changePermissions':
+ $this->changePermissions($request->basePath, $request->permissionsPath, $request->newPermissions, $request->recursive);
+ break;
+ }
+ }
+ }
+
+ private function changePermissions($basePath, $permissionsPath, $newPermissions, $recursive)
+ {
+ try {
+
+ $completePath = $basePath . DIRECTORY_SEPARATOR . $permissionsPath;
+
+ if($recursive == 1){
+
+ $commandToExecute = 'chmod -R ' . $newPermissions . " '". $completePath . "'";
+ $programOutput = fopen('temp.txt', 'a');
+
+ }else{
+ $commandToExecute = 'chmod ' . $newPermissions . " '". $completePath . "'";
+ $programOutput = fopen('temp.txt', 'a');
+ }
+
+
+ exec($commandToExecute, $programOutput);
+
+ $json_data = array(
+ "error_message" => "None",
+ "permissionsChanged" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+
+ } catch (Exception $e) {
+ $json_data = array(
+ "error_message" => $e->getMessage(),
+ "permissionsChanged" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+
+ }
+
+ private function listDir($basePath)
+ {
+ try {
+ $path = "";
+ $listPath = $basePath . $path;
+ $files = scandir($listPath);
+ $json_data = array(
+ "error_message" => "None",
+ "fetchStatus" => 1
+ );
+ $counter = 0;
+
+ $tempDir = array();
+ $tempFiles = array();
+
+ // sorting files at end
+
+ foreach ($files as $dirFile) {
+
+ $completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
+ if (is_dir($completePath) == true) {
+ array_push($tempDir, $dirFile);
+ } else {
+ array_push($tempFiles, $dirFile);
+
+ }
+ }
+
+ $result = array_merge($tempDir, $tempFiles);
+
+ foreach ($result as $dirFile) {
+ if ($dirFile == "." or $dirFile == "..") {
+ continue;
+ }
+ $arrayCounter = 0;
+ $tempArray = array($dirFile);
+ $arrayCounter += 1;
+ $completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
+ $tempArray[$arrayCounter] = $completePath;
+ $arrayCounter += 1;
+
+ if (is_dir($completePath) == true) {
+ $list = true;
+ $tempArray[$arrayCounter] = $list;
+ } else {
+ $list = false;
+ $tempArray[$arrayCounter] = $list;
+ }
+
+ $json_data[(string)$counter] = $tempArray;
+ $counter += 1;
+
+ }
+
+ $json = json_encode($json_data);
+ echo $json;
+ } catch (Exception $e) {
+ $answer = array(
+ 'uploadStatus' => 0,
+ 'answer' => [1, 2, 3],
+ 'error_message' => $e->getMessage(),
+ );
+ $json = json_encode($answer);
+ echo $json;
+ }
+
+ }
+
+ private function getPermissions($fileName){
+
+ $perms = fileperms($fileName);
+
+ switch ($perms & 0xF000) {
+ case 0xC000: // socket
+ $info = 's';
+ break;
+ case 0xA000: // symbolic link
+ $info = 'l';
+ break;
+ case 0x8000: // regular
+ $info = 'r';
+ break;
+ case 0x6000: // block special
+ $info = 'b';
+ break;
+ case 0x4000: // directory
+ $info = 'd';
+ break;
+ case 0x2000: // character special
+ $info = 'c';
+ break;
+ case 0x1000: // FIFO pipe
+ $info = 'p';
+ break;
+ default: // unknown
+ $info = 'u';
+ }
+
+ // Owner
+ $info .= (($perms & 0x0100) ? 'r' : '-');
+ $info .= (($perms & 0x0080) ? 'w' : '-');
+ $info .= (($perms & 0x0040) ?
+ (($perms & 0x0800) ? 's' : 'x' ) :
+ (($perms & 0x0800) ? 'S' : '-'));
+
+ // Group
+ $info .= (($perms & 0x0020) ? 'r' : '-');
+ $info .= (($perms & 0x0010) ? 'w' : '-');
+ $info .= (($perms & 0x0008) ?
+ (($perms & 0x0400) ? 's' : 'x' ) :
+ (($perms & 0x0400) ? 'S' : '-'));
+
+ // World
+ $info .= (($perms & 0x0004) ? 'r' : '-');
+ $info .= (($perms & 0x0002) ? 'w' : '-');
+ $info .= (($perms & 0x0001) ?
+ (($perms & 0x0200) ? 't' : 'x' ) :
+ (($perms & 0x0200) ? 'T' : '-'));
+
+ return $info;
+
+ }
+
+ private function listForTable($home,$basePath)
+ {
+ try {
+
+ $pos = strpos($basePath, $home);
+
+ if ($pos === false) {
+ throw new Exception("Not allowed to browse this path, going back home!");
+ }
+
+ $path = "";
+ $listPath = $basePath . $path;
+ $files = scandir($listPath);
+ $json_data = array("error_message" => "None",
+ "fetchStatus" => 1
+ );
+ $counter = 0;
+
+ $tempDir = array();
+ $tempFiles = array();
+
+ // sorting files at end
+
+ foreach ($files as $dirFile) {
+
+ $completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
+ if (is_dir($completePath) == true) {
+ array_push($tempDir, $dirFile);
+ } else {
+ array_push($tempFiles, $dirFile);
+ }
+ }
+
+ $result = array_merge($tempDir, $tempFiles);
+
+ foreach ($result as $dirFile) {
+ if ($dirFile == "." or $dirFile == "..") {
+ continue;
+ }
+ $arrayCounter = 0;
+ $tempArray = array($dirFile);
+ $arrayCounter += 1;
+ $completePath = $basePath . $path . DIRECTORY_SEPARATOR . $dirFile;
+ $tempArray[$arrayCounter] = $completePath;
+ $arrayCounter += 1;
+
+ // find last modified
+
+ $lastModified = date("F d Y H:i:s.", filemtime($completePath));
+ $tempArray[$arrayCounter] = $lastModified;
+ $arrayCounter += 1;
+
+ // find size of file
+
+ $fileSize = (int)(filesize($completePath) / 1024);
+ $tempArray[$arrayCounter] = $fileSize;
+ $arrayCounter += 1;
+
+ // find permissions of file
+
+
+ $tempArray[$arrayCounter] = substr(sprintf('%o', fileperms($completePath)), -4);;
+ $arrayCounter += 1;
+
+
+ // Deciding if the current path is file or dir.
+
+ if (is_dir($completePath) == true) {
+ $list = true;
+ $tempArray[$arrayCounter] = $list;
+ } else {
+ $list = false;
+ $tempArray[$arrayCounter] = $list;
+ }
+
+ $json_data[(string)$counter] = $tempArray;
+ $counter += 1;
+
+ }
+
+ $json = json_encode($json_data);
+ echo $json;
+ } catch (Exception $e) {
+ $answer = array(
+ 'fetchStatus' => 0,
+ 'error_message' => $e->getMessage(),
+ );
+ $json = json_encode($answer);
+ echo $json;
+ }
+
+ }
+
+ private function readFileContents($pathToFile)
+ {
+
+ try {
+ $listPath = $pathToFile;
+ $contentsofFile = file_get_contents($pathToFile);
+
+ if ($contentsofFile !== false) {
+ $json_data = array(
+ "error_message" => "None",
+ "fetchStatus" => 1,
+ "fileContents" => $contentsofFile
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ } else {
+ throw new Exception("Can not read the file Contents");
+ }
+
+
+ } catch (Exception $e) {
+ $json_data = array(
+ "error_message" => $e->getMessage(),
+ "fetchStatus" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+
+ }
+
+ private function writeFileContents($pathToFile, $fileContent)
+ {
+
+ try {
+
+
+ $contentsofFile = file_put_contents($pathToFile, $fileContent);
+
+ if ($contentsofFile !== false) {
+ $json_data = array(
+ "error_message" => "None",
+ "saveStatus" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ } else {
+ throw new Exception("Can not write the file Contents.");
+ }
+
+
+ } catch (Exception $e) {
+ $json_data = array(
+ "error_message" => $e->getMessage(),
+ "saveStatus" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+
+ }
+
+ private function createNewFolder($folderName)
+ {
+
+ try {
+
+
+ $returnVal = mkdir($folderName);
+
+ if ($returnVal !== false) {
+ $json_data = array(
+ "error_message" => "None",
+ "createStatus" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ } else {
+ throw new Exception("Can not create Folder");
+ }
+
+
+ } catch (Exception $e) {
+ $json_data = array(
+ "error_message" => $e->getMessage(),
+ "createStatus" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+
+ }
+
+ private function createNewFile($fileName)
+ {
+
+ try {
+
+
+ if (touch($fileName)) {
+ $json_data = array(
+ "error_message" => "None",
+ "createStatus" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ } else {
+ throw new Exception("Can not create file!");
+ }
+
+
+ } catch (Exception $e) {
+ $json_data = array(
+ "error_message" => $e->getMessage(),
+ "createStatus" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+
+ }
+
+ private function deleteFolderOrFile($basePath, $fileAndFolders)
+ {
+ try {
+
+ foreach ($fileAndFolders as $path) {
+
+ $path = $basePath . DIRECTORY_SEPARATOR . $path;
+
+ if (is_dir($path) == true) {
+ $commandToExecute = 'rm -rf ' . "'".$path ."'";
+ $programOutput = fopen('temp.txt', 'a');
+ exec($commandToExecute, $programOutput);
+ } else {
+ if (unlink($path)) {
+ continue;
+ } else {
+ throw new Exception("Can not delete!");
+ }
+ }
+
+ }
+
+ $json_data = array(
+ "error_message" => "None",
+ "deleteStatus" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ } catch (Exception $e) {
+ $json_data = array(
+ "error_message" => $e->getMessage(),
+ "deleteStatus" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+
+ }
+
+ private function compress($basePath, $listOfFiles, $compressedFileName, $compressionType)
+ {
+ try {
+
+ chdir($basePath);
+
+ if ($compressionType == "zip") {
+
+ $compressedFileName = $basePath . DIRECTORY_SEPARATOR . $compressedFileName . ".zip";
+
+ $commandToExecute = 'zip -r ' . $compressedFileName . ' ';
+
+ foreach ($listOfFiles as $file) {
+ $completePathToFile = $file;
+ $commandToExecute = $commandToExecute ."'". $completePathToFile ."'". ' ';
+ }
+
+ $programOutput = fopen('temp.txt', 'a');
+
+ exec($commandToExecute, $programOutput);
+
+ $json_data = array(
+ "error_message" => $commandToExecute,
+ "compressed" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+ else {
+
+ $compressedFileName = $basePath . DIRECTORY_SEPARATOR . $compressedFileName . ".tar.gz";
+
+ $commandToExecute = 'tar -czvf ' . $compressedFileName . ' ';
+
+ foreach ($listOfFiles as $file) {
+ $completePathToFile = $file;
+ $commandToExecute = $commandToExecute ."'". $completePathToFile ."'". ' ';
+ }
+
+ $programOutput = fopen('temp.txt', 'a');
+
+ exec($commandToExecute, $programOutput);
+
+ $json_data = array(
+ "error_message" => "None",
+ "compressed" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+
+ } catch (Exception $e) {
+ $json_data = array(
+ "error_message" => $e->getMessage(),
+ "compressed" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+ }
+
+ private function extract($home,$basePath,$completeFileToExtract, $extractionType, $extractionLocation)
+ {
+ try {
+
+ $pos = strpos($extractionLocation, $home);
+
+ if ($pos === false) {
+ throw new Exception("Not allowed to extact in this path, please choose location inside home!");
+ }
+
+ if ($extractionType == "zip") {
+
+ $commandToExecute = "unzip -o '" . $completeFileToExtract . "' -d '" . $extractionLocation . "'";
+
+ $programOutput = fopen('temp.txt', 'a');
+
+ exec($commandToExecute, $programOutput);
+
+ $json_data = array(
+ "error_message" => $commandToExecute,
+ "extracted" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ } else {
+
+ $commandToExecute = "tar xf '" . $completeFileToExtract . "' -C '" . $extractionLocation . "'";
+
+ $programOutput = fopen('temp.txt', 'a');
+
+ exec($commandToExecute, $programOutput);
+
+ $json_data = array(
+ "error_message" => "None",
+ "extracted" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+
+
+ }
+ }catch (Exception $e) {
+ $json_data = array(
+ "error_message" => $e->getMessage(),
+ "extracted" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+ }
+
+ private function moveFileAndFolders($home,$basePath, $newPath, $fileAndFolders)
+ {
+ try {
+
+ $pos = strpos($newPath, $home);
+
+ if ($pos === false) {
+ throw new Exception("Not allowed to move in this path, please choose location inside home!");
+ }
+
+ if(!file_exists($newPath)){
+ if(!mkdir($newPath, 0777, true)){
+ $json_data = array(
+ "error_message" => "Can not create the new folder, it already exists!",
+ "moved" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ die();
+ }
+ }
+
+ foreach ($fileAndFolders as $path) {
+
+ $completePathToFile = $basePath . DIRECTORY_SEPARATOR . $path;
+ $completeNewPath = $newPath . DIRECTORY_SEPARATOR . $path;
+
+ $commandToExecute = 'mv ' ."'". $completePathToFile . "'" . ' ' . "'" . $completeNewPath . "'";
+ $programOutput = fopen('temp.txt', 'a');
+ exec($commandToExecute, $programOutput);
+ }
+
+ $json_data = array(
+ "error_message" => "None",
+ "moved" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+
+ } catch (Exception $e) {
+ $json_data = array(
+ "error_message" => $e->getMessage(),
+ "moved" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+
+ }
+
+ private function copyFileAndFolders($home,$basePath, $newPath, $fileAndFolders)
+ {
+ try {
+
+ $pos = strpos($newPath, $home);
+
+ if ($pos === false) {
+ throw new Exception("Not allowed to move in this path, please choose location inside home!");
+ }
+
+ if(!file_exists($newPath)){
+ if(!mkdir($newPath, 0777, true)){
+ throw new Exception("Can not create the new folder, it already exists!");
+ }
+ }
+
+ foreach ($fileAndFolders as $path) {
+
+ $completePathToFile = $basePath . DIRECTORY_SEPARATOR . $path;
+ $completeNewPath = $newPath . DIRECTORY_SEPARATOR . $path;
+
+ $commandToExecute = 'cp ' ."'". $completePathToFile . "'" . ' ' . "'" . $completeNewPath . "'";
+ $programOutput = fopen('temp.txt', 'a');
+ exec($commandToExecute, $programOutput);
+ }
+
+ $json_data = array(
+ "error_message" => "None",
+ "copied" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+
+ } catch (Exception $e) {
+ $json_data = array(
+ "error_message" => $e->getMessage(),
+ "copied" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+
+ }
+
+ private function renameFileOrFolder($basePath, $currentName, $newName)
+ {
+ try {
+
+ $completeOldPath = $basePath . DIRECTORY_SEPARATOR . $currentName;
+ $completeNewPath = $basePath . DIRECTORY_SEPARATOR . $newName;
+
+ $commandToExecute = 'mv ' ."'". $completeOldPath . "'" . ' ' . "'" . $completeNewPath . "'";
+ $programOutput = fopen('temp.txt', 'a');
+ exec($commandToExecute, $programOutput);
+
+ $json_data = array(
+ "error_message" => "None",
+ "renamed" => 1,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+
+ } catch (Exception $e) {
+ $json_data = array(
+ "error_message" => $e->getMessage(),
+ "renamed" => 0,
+ );
+ $json = json_encode($json_data);
+ echo $json;
+ }
+
+ }
+
+ private function cleanInput($input) {
+ $search = array(
+ '@@si', // Strip out javascript
+ '@<[\/\!]*?[^<>]*?>@si', // Strip out HTML tags
+ '@@siU', // Strip style tags properly
+ '@@' // Strip multi-line comments
+ );
+ $output = preg_replace($search, '', $input);
+ return $output;
+ }
+}
+
+$caller = new fileManager();
+$caller->requestHandler();
\ No newline at end of file
diff --git a/serverStatus/litespeed/FileManager/php/temp.txt b/serverStatus/litespeed/FileManager/php/temp.txt
new file mode 100644
index 000000000..e69de29bb
diff --git a/serverStatus/litespeed/FileManager/php/tests.php b/serverStatus/litespeed/FileManager/php/tests.php
new file mode 100644
index 000000000..e69de29bb
diff --git a/serverStatus/litespeed/conf/httpd_config.conf b/serverStatus/litespeed/conf/httpd_config.conf
new file mode 100644
index 000000000..31783e118
--- /dev/null
+++ b/serverStatus/litespeed/conf/httpd_config.conf
@@ -0,0 +1,202 @@
+#
+# PLAIN TEXT CONFIGURATION FILE
+#
+serverName lscp
+user nobody
+group nobody
+priority 0
+inMemBufSize 60M
+swappingDir /tmp/lshttpd/swap
+autoFix503 1
+gracefulRestartTimeout 300
+mime $SERVER_ROOT/conf/mime.properties
+showVersionNumber 0
+adminEmails root@localhost
+adminRoot $SERVER_ROOT/admin/
+
+errorlog $SERVER_ROOT/logs/error.log {
+ logLevel DEBUG
+ debugLevel 0
+ rollingSize 10M
+ enableStderrLog 1
+}
+
+accesslog $SERVER_ROOT/logs/access.log {
+ rollingSize 10M
+ keepDays 30
+ compressArchive 0
+}
+indexFiles index.html, index.php
+
+expires {
+ enableExpires 1
+ expiresByType image/*=A604800, text/css=A604800, application/x-javascript=A604800
+}
+
+tuning {
+ eventDispatcher best
+ maxConnections 2000
+ maxSSLConnections 1000
+ connTimeout 300
+ maxKeepAliveReq 1000
+ smartKeepAlive 0
+ keepAliveTimeout 5
+ sndBufSize 0
+ rcvBufSize 0
+ maxReqURLLen 8192
+ maxReqHeaderSize 16380
+ maxReqBodySize 2047M
+ maxDynRespHeaderSize 8192
+ maxDynRespSize 2047M
+ maxCachedFileSize 4096
+ totalInMemCacheSize 20M
+ maxMMapFileSize 256K
+ totalMMapCacheSize 40M
+ useSendfile 1
+ fileETag 28
+ enableGzipCompress 1
+ enableDynGzipCompress 1
+ gzipCompressLevel 6
+ compressibleTypes text/*,application/x-javascript,application/javascript,application/xml, image/svg+xml
+ gzipAutoUpdateStatic 1
+ gzipStaticCompressLevel 6
+ gzipMaxFileSize 1M
+ gzipMinFileSize 300
+ SSLCryptoDevice null
+}
+
+fileAccessControl {
+ followSymbolLink 1
+ checkSymbolLink 0
+ requiredPermissionMask 000
+ restrictedPermissionMask 000
+}
+
+perClientConnLimit {
+ staticReqPerSec 0
+ dynReqPerSec 0
+ outBandwidth 0
+ inBandwidth 0
+ softLimit 10000
+ hardLimit 10000
+ gracePeriod 15
+ banPeriod 300
+}
+
+CGIRLimit {
+ maxCGIInstances 20
+ minUID 11
+ minGID 10
+ priority 0
+ CPUSoftLimit 10
+ CPUHardLimit 50
+ memSoftLimit 460M
+ memHardLimit 470M
+ procSoftLimit 400
+ procHardLimit 450
+}
+
+accessDenyDir {
+ dir /
+ dir /etc/*
+ dir /dev/*
+ dir $SERVER_ROOT/conf/*
+ dir $SERVER_ROOT/admin/conf/*
+}
+
+accessControl {
+ allow ALL
+}
+
+scripthandler {
+ add lsapi:php70 php
+}
+
+railsDefaults {
+ maxConns 5
+ env LSAPI_MAX_REQS=1000
+ env LSAPI_MAX_IDLE=60
+ initTimeout 60
+ retryTimeout 0
+ pcKeepAliveTimeout 60
+ respBuffer 0
+ backlog 50
+ runOnStartUp 1
+ extMaxIdleTime 300
+ priority 3
+ memSoftLimit 2047M
+ memHardLimit 2047M
+ procSoftLimit 500
+ procHardLimit 600
+}
+
+
+module cache {
+ param <<
" "$LSWS_HOME/conf/httpd_config.xml"`
+ OLD_GROUP_CONF=`grep "" "$LSWS_HOME/conf/httpd_config.xml"`
+ OLD_USER=`expr "$OLD_USER_CONF" : '.*\(.*\).*'`
+ OLD_GROUP=`expr "$OLD_GROUP_CONF" : '.*\(.*\).*'`
+ if [ "x$OLD_USER" != "x" ]; then
+ WS_USER=$OLD_USER
+ fi
+ if [ "x$OLD_GROUP" != "x" ]; then
+ WS_GROUP=$OLD_GROUP
+ else
+ D_GROUP=`$ID_GROUPS $WS_USER`
+ WS_GROUP=`expr "$D_GROUP" : '.*gid=[0-9]*(\(.*\)) groups=.*'`
+ fi
+ DIR_OWN=$WS_USER:$WS_GROUP
+ CONF_OWN=$WS_USER:$WS_GROUP
+
+}
+
+
+
+
+# Get destination directory
+install_dir()
+{
+
+ SUCC=0
+ INSTALL_TYPE="reinstall"
+ SET_LOGIN=1
+
+ if [ $INST_USER = "root" ]; then
+ DEST_RECOM="/usr/local/lsws"
+ if [ -f "/opt/lsws/conf/httpd_config.xml" ]; then
+ DEST_RECOM="/opt/lsws"
+ fi
+ WS_USER="nobody"
+ else
+ cat < "$LSINSTALL_DIR/admin/conf/htpasswd"
+
+ fi
+
+}
+
+
+getUserGroup()
+{
+
+ if [ $INST_USER = "root" ]; then
+ cat </dev/null`
+ TST_USER=`expr "$USER_INFO" : 'uid=.*(\(.*\)) gid=.*'`
+ if [ "x$TST_USER" = "x$TMP_USER" ]; then
+ USER_ID=`expr "$USER_INFO" : 'uid=\(.*\)(.*) gid=.*'`
+ if [ $USER_ID -gt 10 ]; then
+ WS_USER=$TMP_USER
+ SUCC=1
+ else
+ cat <:/
+
+EOF
+
+ SUCC=0
+ DEFAULT_PORT=8088
+ while [ $SUCC -eq "0" ]; do
+ printf "%s" "HTTP port [$DEFAULT_PORT]: "
+ TMP_PORT=80
+ if [ "x$TMP_PORT" = "x" ]; then
+ TMP_PORT=$DEFAULT_PORT
+ fi
+ SUCC=1
+ if [ `expr "$TMP_PORT" : '.*[^0-9]'` -gt 0 ]; then
+ echo "[ERROR] Only digits is allowed, try again!"
+ SUCC=0
+ fi
+ if [ $SUCC -eq 1 ]; then
+ if [ $INST_USER != "root" ]; then
+ if [ $TMP_PORT -le 1024 ]; then
+ echo "[ERROR] Only 'root' can use port below 1024, try again!"
+ SUCC=0
+ fi
+ fi
+ fi
+ if [ $SUCC -eq 1 ]; then
+ if [ `netstat -an | grep -w $TMP_PORT | grep -w LISTEN | wc -l` -gt 0 ]; then
+ echo "[ERROR] Port $TMP_PORT is in use now, stop the server using this port first,"
+ echo " or choose another port."
+ SUCC=0
+ fi
+ fi
+ done
+
+ HTTP_PORT=$TMP_PORT
+}
+
+
+# get administration TCP port
+getAdminPort()
+{
+ cat <:/
+
+EOF
+
+ SUCC=0
+ DEFAULT_PORT=7080
+ while [ $SUCC -eq "0" ]; do
+ printf "%s" "Admin HTTP port [$DEFAULT_PORT]: "
+ TMP_PORT=7080
+ if [ "x$TMP_PORT" = "x" ]; then
+ TMP_PORT=$DEFAULT_PORT
+ fi
+ SUCC=1
+ if [ `expr "$TMP_PORT" : '.*[^0-9]'` -gt 0 ]; then
+ echo "[ERROR] Only digits is allowed, try again!"
+ SUCC=0
+ fi
+ if [ $SUCC -eq 1 ]; then
+ if [ $INST_USER != "root" ]; then
+ if [ $TMP_PORT -le 1024 ]; then
+ echo "[ERROR] Only 'root' can use port below 1024, try again!"
+ SUCC=0
+ fi
+ fi
+ fi
+ if [ $SUCC -eq 1 ]; then
+ if [ $TMP_PORT -eq $HTTP_PORT ]; then
+ echo "[ERROR] The admin HTTP port must be different from the normal HTTP port!"
+ SUCC=0
+ fi
+ fi
+
+ if [ $SUCC -eq 1 ]; then
+ if [ `netstat -an | grep -w $TMP_PORT | grep -w LISTEN | wc -l` -gt 0 ]; then
+ echo "[ERROR] Port $TMP_PORT is in use, stop the server that using this port first,"
+ echo " or choose another port."
+ SUCC=0
+ fi
+ fi
+ done
+
+ ADMIN_PORT=$TMP_PORT
+}
+
+configAdminEmail()
+{
+ cat < "$LSINSTALL_DIR/admin/conf/admin_config.xml"
+
+ sed -e "s/%ADMIN_PORT%/$ADMIN_PORT/" "$LSINSTALL_DIR/admin/conf/admin_config.xml.in" > "$LSINSTALL_DIR/admin/conf/admin_config.xml"
+
+ sed -e "s/%USER%/$WS_USER/" -e "s/%GROUP%/$WS_GROUP/" -e "s#%APACHE_PID_FILE%#$APACHE_PID_FILE#" -e "s/%ADMIN_EMAIL%/$ADMIN_EMAIL/" -e "s#%RUBY_BIN%#$RUBY_PATH#" -e "s/%SERVER_NAME%/$SERVER_NAME/" -e "s/%AP_PORT_OFFSET%/$AP_PORT_OFFSET/" -e "s/%PHP_SUEXEC%/$PHP_SUEXEC/" "$LSINSTALL_DIR/add-ons/$HOST_PANEL/httpd_config.xml${PANEL_VARY}" > "$LSINSTALL_DIR/conf/httpd_config.xml"
+
+}
+
+# pass $1 = "$LSWS_HOME/httpd_config.xml"
+updateCagefsConfig()
+{
+ if [ "x$1" = "x" ]; then
+ conf_file=/usr/local/lsws/conf/httpd_config.xml
+ else
+ conf_file="$1"
+ fi
+ if [ ! -f "$conf_file" ]; then
+ return 1
+ fi
+ cagefsctl --cagefs-status 2>/dev/null 1>&2
+ if [ $? = 0 ]; then
+ cp "$conf_file" "$conf_file.tmp"
+ grep enableLVE "$conf_file" | grep -v grep > /dev/null
+ if [ $? = 0 ]; then
+ grep -e "[23]" "$conf_file" | grep -v grep > /dev/null
+ if [ $? = 0 ]; then
+ return 0
+ fi
+ sed -e "s#.*#2#" "$conf_file.tmp" > "$conf_file"
+ else
+ sed -e "s##2#" "$conf_file.tmp" > "$conf_file"
+ fi
+ fi
+}
+
+buildAdminSslCert()
+{
+ if [ ! -f "$LSWS_HOME/admin/conf/cert/admin.crt" ]; then
+ HN=`hostname`
+ openssl req -subj "/CN=$HN/O=webadmin/C=US" -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout "$LSWS_HOME/admin/conf/cert/admin.key" -out "$LSWS_HOME/admin/conf/cert/admin.crt"
+ fi
+}
+
+
+cPanelSwitchPathsConf()
+{
+ mode=shift
+ if [ "x$mode" == 'xapache' ]; then
+ cp /etc/cpanel/ea4/paths.conf /etc/cpanel/ea4/paths.conf.tmp
+ sed -e 's#/usr/local/lsws/bin/lswsctrl#/usr/sbin/apachectl#' /etc/cpanel/ea4/paths.conf
+ else
+ cp /etc/cpanel/ea4/paths.conf /etc/cpanel/ea4/paths.conf.tmp
+ sed -e 's#/usr/sbin/apachectl#/usr/local/lsws/bin/lswsctrl#' /etc/cpanel/ea4/paths.conf
+ fi
+}
+
+
+# generate configuration from template
+
+buildConfigFiles()
+{
+
+#sed -e "s/%ADMIN_PORT%/$ADMIN_PORT/" -e "s/%PHP_FCGI_PORT%/$ADMIN_PHP_PORT/" "$LSINSTALL_DIR/admin/conf/admin_config.xml.in" > "$LSINSTALL_DIR/admin/conf/admin_config.xml"
+
+ sed -e "s/%ADMIN_PORT%/$ADMIN_PORT/" "$LSINSTALL_DIR/admin/conf/admin_config.xml.in" > "$LSINSTALL_DIR/admin/conf/admin_config.xml"
+
+ sed -e "s/%USER%/$WS_USER/" -e "s/%GROUP%/$WS_GROUP/" -e "s/%ADMIN_EMAIL%/$ADMIN_EMAIL/" -e "s/%HTTP_PORT%/$HTTP_PORT/" -e "s/%RUBY_BIN%/$RUBY_PATH/" -e "s/%SERVER_NAME%/$SERVER_NAME/" "$LSINSTALL_DIR/conf/httpd_config.xml.in" > "$LSINSTALL_DIR/conf/httpd_config.xml.tmp"
+
+ if [ $SETUP_PHP -eq 1 ]; then
+ sed -e "s/%PHP_BEGIN%//" -e "s/%PHP_END%//" -e "s/%PHP_SUFFIX%/$PHP_SUFFIX/" -e "s/%PHP_PORT%/$PHP_PORT/" "$LSINSTALL_DIR/conf/httpd_config.xml.tmp" > "$LSINSTALL_DIR/conf/httpd_config.xml"
+ else
+ sed -e "s/%PHP_BEGIN%//" -e "s/%PHP_SUFFIX%/php/" -e "s/%PHP_PORT%/5201/" "$LSINSTALL_DIR/conf/httpd_config.xml.tmp" > "$LSINSTALL_DIR/conf/httpd_config.xml"
+ fi
+
+}
+
+util_mkdir()
+{
+ OWNER=$1
+ PERM=$2
+ shift
+ shift
+ for arg
+ do
+ if [ ! -d "$LSWS_HOME/$arg" ]; then
+ mkdir "$LSWS_HOME/$arg"
+ fi
+ chown "$OWNER" "$LSWS_HOME/$arg"
+ chmod $PERM "$LSWS_HOME/$arg"
+ done
+
+}
+
+
+util_cpfile()
+{
+ OWNER=$1
+ PERM=$2
+ shift
+ shift
+ for arg
+ do
+ cp -f "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg"
+ chown "$OWNER" "$LSWS_HOME/$arg"
+ chmod $PERM "$LSWS_HOME/$arg"
+ done
+
+}
+
+util_ccpfile()
+{
+ OWNER=$1
+ PERM=$2
+ shift
+ shift
+ for arg
+ do
+ if [ ! -f "$LSWS_HOME/$arg" ]; then
+ cp "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg"
+ fi
+ chown "$OWNER" "$LSWS_HOME/$arg"
+ chmod $PERM "$LSWS_HOME/$arg"
+ done
+}
+
+
+util_cpdir()
+{
+ OWNER=$1
+ PERM=$2
+ shift
+ shift
+ for arg
+ do
+ cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg/"
+ chown -R "$OWNER" "$LSWS_HOME/$arg/"*
+ #chmod -R $PERM $LSWS_HOME/$arg/*
+ done
+}
+
+
+
+util_cpdirv()
+{
+ OWNER=$1
+ PERM=$2
+ shift
+ shift
+ VERSION=$1
+ shift
+ for arg
+ do
+ cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg.$VERSION/"
+ chown -R "$OWNER" "$LSWS_HOME/$arg.$VERSION"
+ $TEST_BIN -L "$LSWS_HOME/$arg"
+ if [ $? -eq 0 ]; then
+ rm -f "$LSWS_HOME/$arg"
+ fi
+ FILENAME=`basename $arg`
+ ln -sf "./$FILENAME.$VERSION/" "$LSWS_HOME/$arg"
+ #chmod -R $PERM $LSWS_HOME/$arg/*
+ done
+}
+
+util_cpfilev()
+{
+ OWNER=$1
+ PERM=$2
+ shift
+ shift
+ VERSION=$1
+ shift
+ for arg
+ do
+ cp -f "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg.$VERSION"
+ chown "$OWNER" "$LSWS_HOME/$arg.$VERSION"
+ chmod $PERM "$LSWS_HOME/$arg.$VERSION"
+ $TEST_BIN -L "$LSWS_HOME/$arg"
+ if [ $? -eq 0 ]; then
+ rm -f "$LSWS_HOME/$arg"
+ fi
+ FILENAME=`basename $arg`
+ ln -sf "./$FILENAME.$VERSION" "$LSWS_HOME/$arg"
+ done
+}
+
+
+installation1()
+{
+ umask 022
+ if [ $INST_USER = "root" ]; then
+ SDIR_OWN="root:$ROOTGROUP"
+ chown $SDIR_OWN $LSWS_HOME
+ else
+ SDIR_OWN=$DIR_OWN
+ fi
+ sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc"
+
+ OWNER=$1
+ PERM=$2
+ shift
+ shift
+ for arg
+ do
+ if [ ! -f "$LSWS_HOME/$arg" ]; then
+ cp "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg"
+ fi
+ chown "$OWNER" "$LSWS_HOME/$arg"
+ chmod $PERM "$LSWS_HOME/$arg"
+ done
+}
+
+
+util_cpdir()
+{
+ OWNER=$1
+ PERM=$2
+ shift
+ shift
+ for arg
+ do
+ cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg/"
+ chown -R "$OWNER" "$LSWS_HOME/$arg/"*
+ #chmod -R $PERM $LSWS_HOME/$arg/*
+ done
+}
+
+
+
+util_cpdirv()
+{
+ OWNER=$1
+ PERM=$2
+ shift
+ shift
+ VERSION=$1
+ shift
+ for arg
+ do
+ cp -R "$LSINSTALL_DIR/$arg/"* "$LSWS_HOME/$arg.$VERSION/"
+ chown -R "$OWNER" "$LSWS_HOME/$arg.$VERSION"
+ $TEST_BIN -L "$LSWS_HOME/$arg"
+ if [ $? -eq 0 ]; then
+ rm -f "$LSWS_HOME/$arg"
+ fi
+ FILENAME=`basename $arg`
+ ln -sf "./$FILENAME.$VERSION/" "$LSWS_HOME/$arg"
+ #chmod -R $PERM $LSWS_HOME/$arg/*
+ done
+}
+
+util_cpfilev()
+{
+ OWNER=$1
+ PERM=$2
+ shift
+ shift
+ VERSION=$1
+ shift
+ for arg
+ do
+ cp -f "$LSINSTALL_DIR/$arg" "$LSWS_HOME/$arg.$VERSION"
+ chown "$OWNER" "$LSWS_HOME/$arg.$VERSION"
+ chmod $PERM "$LSWS_HOME/$arg.$VERSION"
+ $TEST_BIN -L "$LSWS_HOME/$arg"
+ if [ $? -eq 0 ]; then
+ rm -f "$LSWS_HOME/$arg"
+ fi
+ FILENAME=`basename $arg`
+ ln -sf "./$FILENAME.$VERSION" "$LSWS_HOME/$arg"
+ done
+}
+
+compress_admin_file()
+{
+ TMP_DIR=`pwd`
+ cd $LSWS_HOME/admin/html
+ find . | grep -e '\.js$' | xargs -n 1 ../misc/gzipStatic.sh 9
+ find . | grep -e '\.css$' | xargs -n 1 ../misc/gzipStatic.sh 9
+ cd $TMP_DIR
+}
+
+
+install_whm_plugin()
+{
+
+ WHM_PLUGIN_SRCDIR="$LSINSTALL_DIR/add-ons/cpanel/lsws_whm_plugin"
+ $WHM_PLUGIN_SRCDIR/lsws_whm_plugin_install.sh $WHM_PLUGIN_SRCDIR $LSWS_HOME
+
+
+}
+
+create_lsadm_freebsd()
+{
+ pw group add lsadm
+ lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'`
+ pw user add -g $lsadm_gid -d / -s /usr/sbin/nologin -n lsadm
+ pw usermod lsadm -G $WS_GROUP
+}
+
+create_lsadm()
+{
+ groupadd lsadm
+ #1>/dev/null 2>&1
+ lsadm_gid=`grep "^lsadm:" /etc/group | awk -F : '{ print $3; }'`
+ useradd -g $lsadm_gid -d / -r -s /sbin/nologin lsadm
+ usermod -a -G $WS_GROUP lsadm
+ #1>/dev/null 2>&1
+
+}
+
+create_lsadm_solaris()
+{
+ groupadd lsadm
+ #1>/dev/null 2>&1
+ lsadm_gid=`grep "^lsadm:" /etc/group | awk -F: '{ print $3; }'`
+ useradd -g $lsadm_gid -d / -s /bin/false lsadm
+ usermod -G $WS_GROUP lsadm
+
+ #1>/dev/null 2>&1
+
+}
+
+
+create_self_signed_cert_for_admin()
+{
+#$1 = filename
+#$2 = domain_name
+ openssl req -x509 -sha256 -newkey rsa:2048 -keyout $1.key -out $1.crt -days 1024 -nodes -subj '/CN=$2'
+}
+
+
+fix_cloudlinux()
+{
+ if [ -d /proc/lve ]; then
+ lvectl set-user $WS_USER --unlimited
+ if [ "x$SYS_ARCH" != 'xi386' ]; then
+ lvectl set-user $WS_USER --pmem=2000G
+ else
+ lvectl set-user $WS_USER --pmem=2G
+ fi
+ lvectl set-user lsadm --unlimited
+ lvectl set-user lsadm --pmem=2G
+ $LSWS_HOME/admin/misc/fix_cagefs.sh
+ updateCagefsConfig $LSWS_HOME/conf/httpd_config.xml
+ fi
+}
+
+installation()
+{
+ umask 022
+ if [ $INST_USER = "root" ]; then
+ export PATH=/sbin:/usr/sbin:$PATH
+ if [ "x$SYS_NAME" = "xLinux" ]; then
+ create_lsadm
+ elif [ "x$SYS_NAME" = "xFreeBSD" ] || [ "x$SYS_NAME" = "xNetBSD" ]; then
+ create_lsadm_freebsd
+ elif [ "x$SYS_NAME" = "xSunOS" ]; then
+ create_lsadm_solaris
+ fi
+ grep "^lsadm:" /etc/passwd 1>/dev/null 2>&1
+ if [ $? -eq 0 ]; then
+ CONF_OWN="lsadm:lsadm"
+ fi
+ SDIR_OWN="root:$ROOTGROUP"
+ chown $SDIR_OWN $LSWS_HOME
+ else
+ SDIR_OWN=$DIR_OWN
+ fi
+ sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc"
+ sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo.in" > "$LSINSTALL_DIR/admin/misc/lsws.rc.gentoo"
+ sed "s:%LSWS_CTRL%:$LSWS_HOME/bin/lswsctrl:" "$LSINSTALL_DIR/admin/misc/lshttpd.service.in" > "$LSINSTALL_DIR/admin/misc/lshttpd.service"
+
+ if [ -d "$LSWS_HOME/admin/html.$VERSION" ]; then
+ rm -rf "$LSWS_HOME/admin/html.$VERSION"
+ fi
+
+
+ util_mkdir "$SDIR_OWN" $DIR_MOD admin bin docs fcgi-bin lib logs admin/logs add-ons share admin/fcgi-bin
+ util_mkdir "$SDIR_OWN" $DIR_MOD admin/html.$VERSION admin/misc
+ util_mkdir "$CONF_OWN" $SDIR_MOD conf conf/cert conf/templates admin/conf admin/conf/cert admin/tmp phpbuild autoupdate
+ util_mkdir "$SDIR_OWN" $SDIR_MOD admin/cgid admin/cgid/secret
+ util_mkdir "$CONF_OWN" $DIR_MOD admin/htpasswds
+ chgrp $WS_GROUP $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds
+ chmod g+x $LSWS_HOME/admin/tmp $LSWS_HOME/admin/cgid $LSWS_HOME/admin/htpasswds
+ chown $CONF_OWN $LSWS_HOME/admin/tmp/sess_* 1>/dev/null 2>&1
+ util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT
+
+ buildAdminSslCert
+
+ find "$LSWS_HOME/admin/tmp" -type s -atime +1 -delete 2>/dev/null
+ if [ $? -ne 0 ]; then
+ find "$LSWS_HOME/admin/tmp" -type s -atime +1 2>/dev/null | xargs rm -f
+ fi
+
+ find "/tmp/lshttpd" -type s -atime +1 -delete 2>/dev/null
+ if [ $? -ne 0 ]; then
+ find "/tmp/lshttpd" -type s -atime +1 2>/dev/null | xargs rm -f
+ fi
+
+ if [ "x$HOST_PANEL" = "xcpanel" ]; then
+ if [ ! -d "$BUILD_ROOT/usr/local/lib/php/autoindex/" ]; then
+ mkdir -p $BUILD_ROOT/usr/local/lib/php/autoindex
+ fi
+ if [ -f "$BUILD_ROOT/usr/local/lib/php/autoindex/default.php" ]; then
+ mv -f "$BUILD_ROOT/usr/local/lib/php/autoindex/default.php" "$BUILD_ROOT/usr/local/lib/php/autoindex/default.php.old"
+ fi
+ cp -R "$LSINSTALL_DIR/share/autoindex/"* $BUILD_ROOT/usr/local/lib/php/autoindex/
+ if [ -d "$LSWS_HOME/share/autoindex" ]; then
+ rm -rf "$LSWS_HOME/share/autoindex"
+ fi
+ ln -sf /usr/local/lib/php/autoindex "$LSWS_HOME/share/autoindex"
+ if [ -d "$WHM_CGIDIR" ]; then
+ install_whm_plugin
+ fi
+ else
+ util_mkdir "$SDIR_OWN" $DIR_MOD share/autoindex
+ if [ -f "$LSWS_HOME/share/autoindex/default.php" ]; then
+ mv -f "$LSWS_HOME/share/autoindex/default.php" "$LSWS_HOME/share/autoindex/default.php.old"
+ fi
+ util_cpdir "$SDIR_OWN" $DOC_MOD share/autoindex
+ util_cpfile "$SDIR_OWN" $DOC_MOD share/autoindex/default.php
+ fi
+ util_cpdir "$SDIR_OWN" $DOC_MOD add-ons
+ util_cpfile "$SDIR_OWN" $EXEC_MOD add-ons/modsec/inspectmulti.sh
+
+ util_ccpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/lsperld.fpl
+ util_cpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/RackRunner.rb fcgi-bin/RailsRunner.rb fcgi-bin/RailsRunner.rb.2.3
+ util_cpfile "$SDIR_OWN" $EXEC_MOD admin/fcgi-bin/admin_php5
+ util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/rc-inst.sh admin/misc/admpass.sh admin/misc/rc-uninst.sh admin/misc/uninstall.sh
+ util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lsws.rc admin/misc/lshttpd.service admin/misc/lsws.rc.gentoo admin/misc/enable_ruby_python_selector.sh
+ util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/mgr_ver.sh admin/misc/gzipStatic.sh admin/misc/fp_install.sh
+ util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/create_admin_keypair.sh admin/misc/awstats_install.sh admin/misc/update.sh
+ util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/cleancache.sh admin/misc/cleanlitemage.sh admin/misc/lsup5.sh
+ util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/fix_cagefs.sh admin/misc/cp_switch_ws.sh
+ util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/lscmctl
+ ln -sf ./lsup5.sh "$LSWS_HOME/admin/misc/lsup.sh"
+ util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/ap_lsws.sh.in admin/misc/build_ap_wrapper.sh admin/misc/cpanel_restart_httpd.in
+ util_cpfile "$SDIR_OWN" $DOC_MOD admin/misc/gdb-bt admin/misc/htpasswd.php admin/misc/php.ini admin/misc/genjCryptionKeyPair.php admin/misc/purge_cache_byurl.php
+
+ if [ -f "$LSINSTALL_DIR/admin/misc/chroot.sh" ]; then
+ util_cpfile "$SDIR_OWN" $EXEC_MOD admin/misc/chroot.sh
+ fi
+
+ if [ $SET_LOGIN -eq 1 ]; then
+ util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/htpasswd
+ else
+ util_ccpfile "$CONF_OWN" $CONF_MOD admin/conf/htpasswd
+ fi
+
+ if [ ! -f "$LSWS_HOME/admin/htpasswds/status" ]; then
+ cp -p "$LSWS_HOME/admin/conf/htpasswd" "$LSWS_HOME/admin/htpasswds/status"
+ fi
+ chown $CONF_OWN "$LSWS_HOME/admin/htpasswds/status"
+ chgrp $WS_GROUP "$LSWS_HOME/admin/htpasswds/status"
+ chmod 0640 "$LSWS_HOME/admin/htpasswds/status"
+
+ if [ $INSTALL_TYPE = "upgrade" ]; then
+ util_ccpfile "$CONF_OWN" $CONF_MOD admin/conf/admin_config.xml
+ util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/php.ini
+ util_ccpfile "$CONF_OWN" $CONF_MOD conf/httpd_config.xml conf/mime.properties conf/templates/ccl.xml conf/templates/phpsuexec.xml conf/templates/rails.xml
+ util_ccpfile "$CONF_OWN" $CONF_MOD conf/templates/ccl.xml
+ $TEST_BIN ! -L "$LSWS_HOME/bin/lshttpd"
+ if [ $? -eq 0 ]; then
+ mv -f "$LSWS_HOME/bin/lshttpd" "$LSWS_HOME/bin/lshttpd.old"
+ fi
+ $TEST_BIN ! -L "$LSWS_HOME/bin/lscgid"
+ if [ $? -eq 0 ]; then
+ mv -f "$LSWS_HOME/bin/lscgid" "$LSWS_HOME/bin/lscgid.old"
+ fi
+ $TEST_BIN ! -L "$LSWS_HOME/bin/lswsctrl"
+ if [ $? -eq 0 ]; then
+ mv -f "$LSWS_HOME/bin/lswsctrl" "$LSWS_HOME/bin/lswsctrl.old"
+ fi
+ $TEST_BIN ! -L "$LSWS_HOME/admin/html"
+ if [ $? -eq 0 ]; then
+ mv -f "$LSWS_HOME/admin/html" "$LSWS_HOME/admin/html.old"
+ fi
+
+ if [ ! -f "$LSWS_HOME/DEFAULT/conf/vhconf.xml" ]; then
+ util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf
+ util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf
+ fi
+ else
+ util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/admin_config.xml
+ util_cpfile "$CONF_OWN" $CONF_MOD conf/templates/ccl.xml conf/templates/phpsuexec.xml conf/templates/rails.xml
+ util_cpfile "$CONF_OWN" $CONF_MOD admin/conf/php.ini
+ util_cpfile "$CONF_OWN" $CONF_MOD conf/httpd_config.xml conf/mime.properties
+ util_mkdir "$CONF_OWN" $DIR_MOD DEFAULT/conf
+ util_cpdir "$CONF_OWN" $DOC_MOD DEFAULT/conf
+ util_mkdir "$SDIR_OWN" $DIR_MOD DEFAULT/html DEFAULT/cgi-bin
+ util_cpdir "$SDIR_OWN" $DOC_MOD DEFAULT/html DEFAULT/cgi-bin
+ fi
+ if [ $SETUP_PHP -eq 1 ]; then
+ if [ ! -s "$LSWS_HOME/fcgi-bin/lsphp" ]; then
+ cp -f "$LSWS_HOME/admin/fcgi-bin/admin_php5" "$LSWS_HOME/fcgi-bin/lsphp"
+ chown "$SDIR_OWN" "$LSWS_HOME/fcgi-bin/lsphp"
+ chmod "$EXEC_MOD" "$LSWS_HOME/fcgi-bin/lsphp"
+ fi
+ if [ ! -f "$LSWS_HOME/fcgi-bin/lsphp4" ]; then
+ ln -sf "./lsphp" "$LSWS_HOME/fcgi-bin/lsphp4"
+ fi
+ if [ ! -f "$LSWS_HOME/fcgi-bin/lsphp5" ]; then
+ ln -sf "./lsphp" "$LSWS_HOME/fcgi-bin/lsphp5"
+ fi
+ if [ ! -e "/usr/local/bin/lsphp" ]; then
+ cp -f "$LSWS_HOME/admin/fcgi-bin/admin_php5" "/usr/local/bin/lsphp"
+ chown "$SDIR_OWN" "/usr/local/bin/lsphp"
+ chmod "$EXEC_MOD" "/usr/local/bin/lsphp"
+ fi
+ fi
+
+ chown -R "$CONF_OWN" "$LSWS_HOME/conf/"
+ chmod -R o-rwx "$LSWS_HOME/conf/"
+
+ util_mkdir "$DIR_OWN" $SDIR_MOD tmp
+
+
+ util_mkdir "$DIR_OWN" $DIR_MOD DEFAULT/logs DEFAULT/fcgi-bin
+ util_cpdirv "$SDIR_OWN" $DOC_MOD $VERSION admin/html
+
+
+ util_cpfile "$SDIR_OWN" $EXEC_MOD bin/wswatch.sh
+ util_cpfilev "$SDIR_OWN" $EXEC_MOD $VERSION bin/lswsctrl bin/lshttpd bin/lscgid
+
+ $TEST_BIN ! -L "$LSWS_HOME/modules"
+ if [ $? -eq 0 ]; then
+ mv -f "$LSWS_HOME/modules" "$LSWS_HOME/modules.old"
+ fi
+
+ if [ -d "$LSWS_HOME/modules.$VERSION" ]; then
+ rm -rf "$LSWS_HOME/modules.$VERSION"
+ fi
+
+ util_mkdir "$SDIR_OWN" $DIR_MOD modules.$VERSION
+ util_cpdirv "$SDIR_OWN" $EXEC_MOD $VERSION modules
+
+ #if [ -e "$LSINSTALL_DIR/bin/lshttpd.dbg" ]; then
+ # if [ -f "$LSINSTALL_DIR/bin/lshttpd.dbg.$VERSION" ]; then
+ # rm "$LSINSTALL_DIR/bin/lshttpd.dbg.$VERSION"
+ # fi
+ # util_cpfilev "$SDIR_OWN" $EXEC_MOD $VERSION bin/lshttpd.dbg
+ #
+ # #enable debug build for beta release
+ # ln -sf ./lshttpd.dbg.$VERSION $LSWS_HOME/bin/lshttpd
+ #fi
+
+ ln -sf ./lshttpd.$VERSION $LSWS_HOME/bin/lshttpd
+ ln -sf lshttpd $LSWS_HOME/bin/litespeed
+
+ ln -sf lscgid.$VERSION $LSWS_HOME/bin/httpd
+ if [ $INST_USER = "root" ]; then
+ chmod u+s "$LSWS_HOME/bin/lscgid.$VERSION"
+
+ fi
+
+ util_cpdir "$SDIR_OWN" $DOC_MOD docs/
+ util_cpfile "$SDIR_OWN" $DOC_MOD VERSION BUILD LICENSE*
+
+ if [ -f $LSWS_HOME/autoupdate/download ]; then
+ rm $LSWS_HOME/autoupdate/download
+ fi
+
+ #compress_admin_file
+
+ if [ ! -f "$LSWS_HOME/admin/conf/jcryption_keypair" ]; then
+ $LSWS_HOME/admin/misc/create_admin_keypair.sh
+ fi
+ chown "$CONF_OWN" "$LSWS_HOME/admin/conf/jcryption_keypair"
+ chmod 0600 "$LSWS_HOME/admin/conf/jcryption_keypair"
+
+ fix_cloudlinux
+
+ if [ $INST_USER = "root" ]; then
+ $LSWS_HOME/admin/misc/rc-inst.sh
+ fi
+
+}
+
+
+setupPHPAccelerator()
+{
+ cat </
+or http://:/
+
+EOF
+
+ if [ $INST_USER = "root" ]; then
+ if [ $INSTALL_TYPE != "upgrade" ]; then
+ printf "%s\n%s" "Would you like to have LiteSpeed Web Server started automatically" "when the server restarts [Y/n]? "
+ START_SERVER='y'
+ echo
+
+ if [ "x$START_SERVER" = "x" ]; then
+ START_SERVER=y
+ fi
+ if [ `expr "$START_SERVER" : '[Yy]'` -gt 0 ]; then
+ $LSWS_HOME/admin/misc/rc-inst.sh
+ else
+ cat <
+ AllowOverride none
+
+
+
+ AllowOverride All
+ Options +Includes -Indexes +ExecCGI
+
+
+DirectoryIndex index.php index.html
+
+
+ Require all denied
+
+
+ErrorLog "/usr/local/lsws/logs/error.log"
+LogLevel warn
+
+LogFormat '"%v %h %l %u %t \"%r\" %>s %b"' combined
+CustomLog "/usr/local/lsws/logs/access.log" combined
+
+
+AddType application/x-compress .Z
+AddType application/x-gzip .gz .tgz
+AddType text/html .shtml
+AddOutputFilter INCLUDES .shtml
+#AddHandler cgi-script .cgi
+
+AddDefaultCharset UTF-8
+
+
+ MIMEMagicFile conf/magic
+
+
+EnableSendfile on
+
+SSLProtocol all -SSLv3 -TLSv1
+SSLHonorCipherOrder on
+
+SSLCipherSuite ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:HIGH:!EDH-RSA-DES-CBC3-SHA:!DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4
+
+
+CacheRoot /home/lscache/
+
+
+
+Include /usr/local/lsws/conf/modsec.conf
diff --git a/serverStatus/litespeed/httpd_config.xml b/serverStatus/litespeed/httpd_config.xml
new file mode 100644
index 000000000..de85c980b
--- /dev/null
+++ b/serverStatus/litespeed/httpd_config.xml
@@ -0,0 +1,388 @@
+
+
+ $HOSTNAME
+ nobody
+ nobody
+ 0
+ /
+ 0
+ 120M
+ /tmp/lshttpd/swap
+ 1
+ 1
+ 0
+ /usr/local/lsws/conf/httpd.conf
+ 0
+ 0
+ 1
+ 5
+ $SERVER_ROOT/conf/mime.properties
+ 0
+ 86400
+ 1
+ usman@cyberpersons.com
+ $SERVER_ROOT/admin/
+
+
+ $SERVER_ROOT/logs/error.log
+ DEBUG
+ 0
+ 10M
+ 1
+ 1
+
+
+ $SERVER_ROOT/logs/access.log
+ 10M
+ 30
+ 0
+
+
+ index.html, index.php
+
+ 0
+ .htaccess
+
+
+ 1
+ image/*=A604800, text/css=A604800, application/x-javascript=A604800, application/javascript=A604800
+
+
+ best
+ 2000
+ 200
+ 300
+ 1000
+ 0
+ 5
+ 0
+ 0
+ 8192
+ 16380
+ 500M
+ 8K
+ 500M
+ 4096
+ 20M
+ 256K
+ 40M
+ 1
+ 1
+ 4
+ 1
+ 1
+ 1
+ text/*,application/x-javascript,application/javascript,application/xml, image/svg+xml
+ 1
+ 6
+ 1M
+ 300
+ null
+
+
+ 1
+
+
+
+ 1
+ 0
+ 000
+ 000
+
+
+ 0
+ 0
+ 0
+ 0
+ 10000
+ 10000
+ 15
+ 300
+
+
+ 200
+ 11
+ 10
+ 0
+ 300
+ 600
+ 1450M
+ 1500M
+ 1400
+ 1450
+
+
+ 0
+ 0
+ deny,log,status:403
+ 1
+ /tmp
+ $SERVER_ROOT/logs/security_audit.log
+
+
+ XSS attack
+ log,deny,status:403,msg:'XSS attack'
+ 1
+ SecFilterSelective ARGS "(alert|expression|eval|url)[[:space:]]*\("
+SecFilterSelective ARGS "(&\{.+\}|(&#[[0-9a-fA-F]]|\x5cx[0-9a-fA-F]){2})"
+
+SecFilterSelective ARGS "((javascript|vbscript):|style[[:space:]]*=)"
+SecFilterSelective ARGS "(fromCharCode|http-equiv|<.+>|innerHTML|dynsrc|-->)"
+SecFilterSelective ARGS "document\.(body|cookie|location|write)"
+
+SecFilterSelective ARGS_VALUES "jsessionid|phpsessid|onReadyStateChange|xmlHttp"
+
+SecFilterSelective ARGS "<(applet|div|embed|iframe|img|meta|object|script|textarea)"
+
+# JavaScript event handlers
+SecFilterSelective ARGS "on(Abort|Blur|Click|DblClick|DragDrop|Error|Focus|KeyUp|KeyDown|KeyPrerss|Load|Mouse(Down|Out|Over|Up)|Move|Reset|Resize|Select|Submit|Unload)"
+
+
+ SQL injection
+ log,pass,msg:'SQL Injection attack'
+ 1
+ #SQL generic
+SecFilterSelective ARGS "drop[[:space:]]+(database|table|column|procedure)"
+SecFilterSelective ARGS "delete[[:space:]]+from|create[[:space:]]+table|update.+set.+=|insert[[:space:]]+into.+values"
+SecFilterSelective ARGS "select.+from|bulk[[:space:]]+insert|union.+select|alter[[:space:]]+table"
+SecFilterSelective ARGS "or.+1[[:space:]]*=[[:space:]]1|or 1=1--'|'.+--"
+
+SecFilterSelective ARGS "into[[:space:]]+outfile|load[[:space:]]+data|/\*.+\*/"
+
+
+ /
+ /etc/*
+ /dev/*
+ $SERVER_ROOT/conf/*
+ $SERVER_ROOT/admin/conf/*
+
+
+ ALL
+
+
+
+
+ lsapi
+ lsphp5
+ uds://tmp/lshttpd/lsphp5.sock
+ 35
+ PHP_LSAPI_CHILDREN=35
+ 60
+ 0
+ 1
+ 0
+ 3
+ $SERVER_ROOT/fcgi-bin/lsphp5
+ 100
+ 1
+ 0
+ 2047M
+ 2047M
+ 400
+ 500
+
+
+ lsapi
+ lsphp53
+ uds://tmp/lshttpd/lsphp53.sock
+ 35
+ PHP_LSAPI_CHILDREN=35
+ 60
+ 0
+ 1
+ 0
+ 3
+ $SERVER_ROOT/lsphp53/bin/lsphp
+ 100
+ 1
+ 0
+ 2047M
+ 2047M
+ 400
+ 500
+
+
+ lsapi
+ lsphp54
+ uds://tmp/lshttpd/lsphp54.sock
+ 35
+ PHP_LSAPI_CHILDREN=35
+ 60
+ 0
+ 1
+ 0
+ 3
+ $SERVER_ROOT/lsphp54/bin/lsphp
+ 100
+ 1
+ 0
+ 2047M
+ 2047M
+ 400
+ 500
+
+
+ lsapi
+ lsphp55
+ uds://tmp/lshttpd/lsphp55.sock
+ 35
+ PHP_LSAPI_CHILDREN=35
+ 60
+ 0
+ 1
+ 0
+ 3
+ $SERVER_ROOT/lsphp55/bin/lsphp
+ 100
+ 1
+ 0
+ 2047M
+ 2047M
+ 400
+ 500
+
+
+ lsapi
+ lsphp56
+ uds://tmp/lshttpd/lsphp56.sock
+ 35
+ PHP_LSAPI_CHILDREN=35
+ 60
+ 0
+ 1
+ 0
+ 3
+ $SERVER_ROOT/lsphp56/bin/lsphp
+ 100
+ 1
+ 0
+ 2047M
+ 2047M
+ 400
+ 500
+
+
+ lsapi
+ lsphp70
+ uds://tmp/lshttpd/lsphp70.sock
+ 35
+ PHP_LSAPI_CHILDREN=35
+ 60
+ 0
+ 1
+ 0
+ 3
+ $SERVER_ROOT/lsphp70/bin/lsphp
+ 100
+ 1
+ 0
+ 2047M
+ 2047M
+ 400
+ 500
+
+
+ lsapi
+ lsphp71
+ uds://tmp/lshttpd/lsphp71.sock
+ 35
+ PHP_LSAPI_CHILDREN=35
+ 60
+ 0
+ 1
+ 0
+ 3
+ $SERVER_ROOT/lsphp71/bin/lsphp
+ 100
+ 1
+ 0
+ 2047M
+ 2047M
+ 400
+ 500
+
+
+ lsapi
+ lsphp72
+ uds://tmp/lshttpd/lsphp72.sock
+ 35
+ PHP_LSAPI_CHILDREN=35
+ 60
+ 0
+ 1
+ 0
+ 3
+ $SERVER_ROOT/lsphp72/bin/lsphp
+ 100
+ 1
+ 0
+ 2047M
+ 2047M
+ 400
+ 500
+
+
+
+
+ php
+ lsapi
+ lsphp5
+
+
+ php5
+ lsapi
+ lsphp5
+
+
+ php53
+ lsapi
+ lsphp53
+
+
+ php54
+ lsapi
+ lsphp54
+
+
+ php55
+ lsapi
+ lsphp55
+
+
+ php56
+ lsapi
+ lsphp56
+
+
+ php70
+ lsapi
+ lsphp70
+
+
+ php71
+ lsapi
+ lsphp71
+
+
+ php72
+ lsapi
+ lsphp72
+
+
+
+ 1
+ 5
+ LSAPI_MAX_IDLE=60
+ 180
+ 0
+ 60
+ 0
+ 50
+ 1
+ 3
+ 2047M
+ 2047M
+ 400
+ 500
+
+
diff --git a/serverStatus/litespeed/install.sh b/serverStatus/litespeed/install.sh
new file mode 100644
index 000000000..5e8d8689c
--- /dev/null
+++ b/serverStatus/litespeed/install.sh
@@ -0,0 +1,506 @@
+#!/bin/sh
+
+cd `dirname "$0"`
+source ./functions.sh 2>/dev/null
+if [ $? != 0 ]; then
+ . ./functions.sh
+ if [ $? != 0 ]; then
+ echo [ERROR] Can not include 'functions.sh'.
+ exit 1
+ fi
+fi
+
+
+test_license()
+{
+ COPY_LICENSE_KEY=1
+ if [ -f "$LSWS_HOME/conf/serial.no" ]; then
+ if [ ! -f "$LSINSTALL_DIR/serial.no" ]; then
+ cp "$LSWS_HOME/conf/serial.no" "$LSINSTALL_DIR/serial.no"
+ else
+ diff "$LSWS_HOME/conf/serial.no" "$LSINSTALL_DIR/serial.no" 1>/dev/null
+ if [ $? -ne 0 ]; then
+ COPY_LICENSE_KEY=0
+ fi
+ fi
+ fi
+# if [ $COPY_LICENSE_KEY -eq 1 ]; then
+# if [ -f "$LSWS_HOME/conf/license.key" ] && [ ! -f "$LSINSTALL_DIR/license.key" ]; then
+# cp "$LSWS_HOME/conf/license.key" "$LSINSTALL_DIR/license.key"
+# fi
+# if [ -f "$LSWS_HOME/conf/license.key" ] && [ -f "$LSINSTALL_DIR/license.key" ]; then
+# diff "$LSWS_HOME/conf/license.key" "$LSINSTALL_DIR/license.key"
+# if [ $? -ne 0 ]; then
+# cp "$LSWS_HOME/conf/license.key" "$LSINSTALL_DIR/license.key"
+# fi
+# fi
+# fi
+ if [ -f "$LSINSTALL_DIR/license.key" ] && [ -f "$LSINSTALL_DIR/serial.no" ]; then
+ echo "License key and serial number are available, testing..."
+ echo
+ bin/lshttpd -V
+ if [ $? -eq 0 ]; then
+ LICENSE_OK=1
+ if [ -f "$LSINSTALL_DIR/conf/license.key" ]; then
+ mv "$LSINSTALL_DIR/conf/license.key" "$LSINSTALL_DIR/license.key"
+ bin/lshttpd -t
+ fi
+ fi
+ echo
+ fi
+
+ if [ "x$LICENSE_OK" = "x" ]; then
+ if [ -f "$LSINSTALL_DIR/serial.no" ]; then
+# echo "Serial number is available."
+# printf "Would you like to register a license key for this server? [Y/n]"
+# read TMP_YN
+# echo ""
+# if [ "x$TMP_YN" = "x" ] || [ `expr "$TMP_YN" : '[Yy]'` -gt 0 ]; then
+ echo "Contacting licensing server ..."
+
+ echo ""
+ $LSINSTALL_DIR/bin/lshttpd -r
+
+ if [ $? -eq 0 ]; then
+ echo "[OK] License key received."
+ $LSINSTALL_DIR/bin/lshttpd -t
+ if [ $? -eq 0 ]; then
+ LICENSE_OK=1
+ else
+ echo "The license key received does not work."
+ fi
+ fi
+# fi
+ fi
+ fi
+
+ if [ "x$LICENSE_OK" = "x" ]; then
+
+ if [ -f "$LSINSTALL_DIR/trial.key" ]; then
+ $LSINSTALL_DIR/bin/lshttpd -t
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+ else
+ cat <" "$LSWS_HOME/conf/httpd_config.xml"`
+ OLD_CHROOT_PATH_CONF=`grep "" "$LSWS_HOME/conf/httpd_config.xml"`
+ OLD_ENABLE_CHROOT=`expr "$OLD_ENABLE_CHROOT_CONF" : '.*\(.*\).*'`
+ OLD_CHROOT_PATH=`expr "$OLD_CHROOT_PATH_CONF" : '[^<]*\([^<]*\).*'`
+ if [ "x$OLD_ENABLE_CHROOT" != "x" ]; then
+ ENABLE_CHROOT=$OLD_ENABLE_CHROOT
+ fi
+ if [ "x$OLD_CHROOT_PATH" != "x" ]; then
+ CHROOT_PATH=$OLD_CHROOT_PATH
+ fi
+ fi
+ CHANGE_CHROOT=0
+ if [ $INST_USER = "root" ]; then
+ CHANGE_CHROOT=1
+
+ if [ $INSTALL_TYPE = "upgrade" ]; then
+ CHANGE_CHROOT=0
+ if [ $ENABLE_CHROOT -eq 1 ]; then
+ cat < $CHROOT_PATH/etc/passwd
+ grep "$WS_GROUP" /etc/group > $CHROOT_PATH/etc/group
+ fi
+ fi
+ cp $LSWS_HOME/conf/httpd_config.xml $LSWS_HOME/conf/httpd_config.xml.bak
+ chown "$DIR_OWN" $LSWS_HOME/conf/httpd_config.xml.bak
+ RES=`grep '' $LSWS_HOME/conf/httpd_config.xml.bak`
+ if [ $? -eq 1 ]; then
+ sed -e "s##$CHROOT_PATH$ENABLE_CHROOT#" "$LSWS_HOME/conf/httpd_config.xml.bak" > "$LSWS_HOME/conf/httpd_config.xml"
+ else
+ sed -e "s#.*<\/chrootPath>#$CHROOT_PATH<\/chrootPath>#" -e "s/.*<\/enableChroot>/$ENABLE_CHROOT<\/enableChroot>/" "$LSWS_HOME/conf/httpd_config.xml.bak" > "$LSWS_HOME/conf/httpd_config.xml"
+ fi
+ fi
+}
+
+installLicense()
+{
+ if [ -f ./serial.no ]; then
+ cp -f ./serial.no $LSWS_HOME/conf
+ chown "$SDIR_OWN" $LSWS_HOME/conf/serial.no
+ chmod "$DOC_MOD" $LSWS_HOME/conf/serial.no
+ fi
+
+ if [ -f ./license.key ]; then
+ cp -f ./license.key $LSWS_HOME/conf
+ chown "$SDIR_OWN" $LSWS_HOME/conf/license.key
+ chmod "$CONF_MOD" $LSWS_HOME/conf/license.key
+ fi
+
+ if [ -f ./trial.key ]; then
+ cp -f ./trial.key $LSWS_HOME/conf
+ chown "$SDIR_OWN" $LSWS_HOME/conf/trial.key
+ chmod "$DOC_MOD" $LSWS_HOME/conf/trial.key
+ fi
+}
+
+portOffset()
+{
+SUCC=0
+SEL=0
+while [ $SUCC -eq "0" ]; do
+
+ cat </dev/null`
+ TST_USER=`expr "$USER_INFO" : 'uid=.*(\(.*\)) gid=.*'`
+ if [ "x$TST_USER" = "xapache" ]; then
+ WS_USER=apache
+ WS_GROUP=apache
+ else
+ WS_USER=www-data
+ WS_GROUP=www-data
+ # default PID FILE, source the real one, debian and ubuntu different
+ APACHE_PID_FILE=/var/run/apache2/apache2.pid
+ source /etc/apache2/envvars 2>/dev/null
+ if [ $? != 0 ]; then
+ . /etc/apache2/envvars
+ fi
+ PANEL_VARY=".debian"
+ fi
+ ADMIN_PORT=7088
+ elif [ $SEL -eq "4" ]; then
+ HOST_PANEL="hsphere"
+ WS_USER=httpd
+ WS_GROUP=httpd
+ elif [ $SEL -eq "5" ]; then
+ HOST_PANEL="interworx"
+ WS_USER=apache
+ WS_GROUP=apache
+ elif [ $SEL -eq "6" ]; then
+ HOST_PANEL="lxadminh"
+ WS_USER=apache
+ WS_GROUP=apache
+ elif [ $SEL -eq "7" ]; then
+ HOST_PANEL="ispmanager"
+ WS_USER=apache
+ WS_GROUP=apache
+ fi
+ fi
+ DIR_OWN=$WS_USER:$WS_GROUP
+ CONF_OWN=$WS_USER:$WS_GROUP
+ else
+ SUCC=1
+ fi
+done
+
+}
+
+
+LSINSTALL_DIR=`dirname "$0"`
+cd $LSINSTALL_DIR
+
+init
+license
+install_dir
+test_license
+admin_login
+
+
+if [ $INSTALL_TYPE = "reinstall" ]; then
+
+ configAdminEmail
+ if [ $INST_USER = "root" ]; then
+ hostPanels
+ fi
+ if [ "x$HOST_PANEL" = "x" ]; then
+ getUserGroup
+ stopLshttpd
+ getServerPort
+ getAdminPort
+ configRuby
+ enablePHPHandler
+ else
+ hostPanelConfig
+ fi
+fi
+
+if [ "x$HOST_PANEL" = "x" ]; then
+ configChroot
+fi
+
+cat <
+SecRuleEngine off
+SecAuditEngine on
+SecDebugLogLevel 0
+SecAuditLogRelevantStatus ^(?:5|4(?!04))
+SecAuditLogParts ABIJDEFHZ
+SecAuditLogType Serial
+SecAuditLog /usr/local/lsws/logs/auditmodsec.log
+SecDataDir /usr/local/lsws/modsec
+Include /usr/local/lsws/conf/comodo_litespeed/*.conf
+Include /usr/local/lsws/conf/rules.conf
+
+
diff --git a/serverStatus/serverStatusUtil.py b/serverStatus/serverStatusUtil.py
new file mode 100644
index 000000000..9b8328a7e
--- /dev/null
+++ b/serverStatus/serverStatusUtil.py
@@ -0,0 +1,213 @@
+#!/usr/local/CyberCP/bin/python2
+import os,sys
+sys.path.append('/usr/local/CyberCP')
+import django
+os.environ.setdefault("DJANGO_SETTINGS_MODULE", "CyberCP.settings")
+django.setup()
+import subprocess
+import shlex
+import argparse
+import shutil
+import plogical.CyberCPLogFileWriter as logging
+from plogical.processUtilities import ProcessUtilities
+
+
+class ServerStatusUtil:
+ lswsInstallStatusPath = '/home/cyberpanel/switchLSWSStatus'
+ serverRootPath = '/usr/local/lsws/'
+
+ @staticmethod
+ def executioner(command, statusFile):
+ try:
+ res = subprocess.call(shlex.split(command), stdout=statusFile, stderr=statusFile)
+ if res == 1:
+ raise 0
+ else:
+ return 1
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(str(msg))
+ return 0
+
+ @staticmethod
+ def installLiteSpeed(licenseKey, statusFile):
+ try:
+
+ cwd = os.getcwd()
+ try:
+
+ command = 'groupadd nobody'
+ ServerStatusUtil.executioner(command, statusFile)
+
+ except:
+ pass
+
+ try:
+ command = 'usermod -a -G nobody nobody'
+ ServerStatusUtil.executioner(command, statusFile)
+ except:
+ pass
+ try:
+ command = 'systemctl stop lsws'
+ ServerStatusUtil.executioner(command, statusFile)
+ except:
+ pass
+
+ command = 'wget https://www.litespeedtech.com/packages/5.0/lsws-5.3-ent-x86_64-linux.tar.gz'
+ if ServerStatusUtil.executioner(command, statusFile) == 0:
+ return 0
+
+ command = 'tar zxf lsws-5.3-ent-x86_64-linux.tar.gz'
+ if ServerStatusUtil.executioner(command, statusFile) == 0:
+ return 0
+
+ writeSerial = open('lsws-5.3/serial.no', 'w')
+ writeSerial.writelines(licenseKey)
+ writeSerial.close()
+
+ shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/install.sh', 'lsws-5.3/')
+ shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/functions.sh', 'lsws-5.3/')
+
+ os.chdir('lsws-5.3')
+
+ command = 'chmod +x install.sh'
+ if ServerStatusUtil.executioner(command, statusFile) == 0:
+ return 0
+
+ command = 'chmod +x functions.sh'
+ if ServerStatusUtil.executioner(command, statusFile) == 0:
+ return 0
+
+ command = './install.sh'
+ if ServerStatusUtil.executioner(command, statusFile) == 0:
+ return 0
+
+ os.chdir(cwd)
+ confPath = '/usr/local/lsws/conf/'
+ shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/httpd_config.xml', confPath)
+ shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/modsec.conf', confPath)
+ shutil.copy('/usr/local/CyberCP/serverStatus/litespeed/httpd.conf', confPath)
+
+ try:
+ command = 'chown -R lsadm:lsadm ' + confPath
+ subprocess.call(shlex.split(command))
+ except:
+ pass
+
+ return 1
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(str(msg))
+ return 0
+
+ @staticmethod
+ def setupFileManager(statusFile):
+ try:
+ logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Setting up Filemanager files..\n")
+
+ fileManagerPath = ServerStatusUtil.serverRootPath+"FileManager"
+ if os.path.exists(fileManagerPath):
+ shutil.rmtree(fileManagerPath)
+ shutil.copytree("/usr/local/CyberCP/serverStatus/litespeed/FileManager",fileManagerPath)
+
+ ## remove unnecessary files
+
+ command = 'chmod -R 777 ' + fileManagerPath
+ if ServerStatusUtil.executioner(command, statusFile) == 0:
+ return 0
+
+ logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,"Filemanager files are set!\n")
+
+ return 1
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(str(msg))
+ return 0
+
+ @staticmethod
+ def recover():
+ FNULL = open(os.devnull, 'w')
+
+ if os.path.exists('/usr/local/lsws'):
+ shutil.rmtree('/usr/local/lsws')
+
+ command = 'tar -zxvf /usr/local/olsBackup.tar.gz -C /usr/local/'
+ ServerStatusUtil.executioner(command, FNULL)
+
+ command = 'mv /usr/local/usr/local/lsws /usr/local'
+ ServerStatusUtil.executioner(command, FNULL)
+
+ if os.path.exists('/usr/local/usr'):
+ shutil.rmtree('/usr/local/usr')
+
+ @staticmethod
+ def switchTOLSWS(licenseKey):
+ try:
+ statusFile = open(ServerStatusUtil.lswsInstallStatusPath, 'w')
+ FNULL = open(os.devnull, 'w')
+
+ logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,"Starting conversion process..\n")
+ logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
+ "Removing OpenLiteSpeed..\n")
+
+ ## Try to stop current LiteSpeed Process
+
+ ProcessUtilities.killLiteSpeed()
+
+ if os.path.exists('/usr/local/lsws'):
+ command = 'tar -zcvf /usr/local/olsBackup.tar.gz /usr/local/lsws'
+ if ServerStatusUtil.executioner(command, FNULL) == 0:
+ logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to create backup of current LSWS. [404]")
+ ServerStatusUtil.recover()
+ return 0
+
+ dirs = os.listdir('/usr/local/lsws')
+ for dir in dirs:
+ if dir.find('lsphp') > -1:
+ continue
+ finalDir = '/usr/local/lsws/' + dir
+ try:
+ shutil.rmtree(finalDir)
+ except:
+ pass
+
+ logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
+ "OpenLiteSpeed removed.\n")
+
+ logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
+ "Installing LiteSpeed Enterprise Web Server ..\n")
+
+
+ if ServerStatusUtil.installLiteSpeed(licenseKey, statusFile) == 0:
+ logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to install LiteSpeed. [404]")
+ ServerStatusUtil.recover()
+ return 0
+
+ logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
+ "LiteSpeed Enterprise Web Server installed.\n")
+
+
+ if ServerStatusUtil.setupFileManager(statusFile) == 0:
+ logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to set up File Manager. [404]")
+ ServerStatusUtil.recover()
+ return 0
+
+ logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,"Successfully switched to LITESPEED ENTERPRISE WEB SERVER. [200]\n")
+
+ except BaseException, msg:
+ logging.CyberCPLogFileWriter.writeToFile(str(msg))
+ ServerStatusUtil.recover()
+
+
+
+def main():
+
+ parser = argparse.ArgumentParser(description='Server Status Util.')
+ parser.add_argument('function', help='Specific a function to call!')
+ parser.add_argument('--licenseKey', help='LITESPEED ENTERPRISE WEB SERVER License Key')
+
+ args = parser.parse_args()
+
+ if args.function == "switchTOLSWS":
+ ServerStatusUtil.switchTOLSWS(args.licenseKey)
+
+
+if __name__ == "__main__":
+ main()
\ No newline at end of file
diff --git a/serverStatus/static/images/agreement.png b/serverStatus/static/images/agreement.png
new file mode 100644
index 0000000000000000000000000000000000000000..a2fabeef4ee302df6a91fd95e4ea1cfc6e2b04e1
GIT binary patch
literal 2173
zcmV-@2!i*CP)wLK{`t>;#^l5M^i6DJ5d8C05}!DoE)a_M
zSo-s*K`s0Wa83Zn(3cH~#{{gk18a@XJpqD~Nx8eXF@0?q)H0bl;tfU6^Xy6RUM~}U
z9Rol5g{i8qQ)&e{LAWb$-ml*sJoj0poFf9HObUjoxc71q%K0pGMP@=k&*^u+4~xD{
zEfdr-VVXvd#T!FUyzo}%_@CdKUM%Z~fGztDA=c5&cm;&v3rCsg;snnR{ILW8z|>S|
zVjhO72)gF`C4jSwWgQVf2tl~D&Aq3qfM?$Ltp`Bw|9|sd9|G|<7)lw2DsQcncSJxX
zD5c1bk3o~Ay5tEVh;8YDzp0spc^eA5pXWL~yw8LH
zIh)4Rl}ioH5mVFH)_;nHc^f+RY$IVA$E%HHuV22YEAlo^Fap6JJWN2p!i0c8ERICa
z4(MgME_p%-nmc<~m~IH(=0wgD2#@(<@o7*zM?vCD2;g`DTb??=Le;7wd1zqx(oY7y
z+xOL<9j4S80v;Daj|uqP6Tl<~Gzv;7#)k$`&Sx8*>u+jC_mLAI9GiQ$CIpz83NbYe
zN@>G$#qiE1OQmn;@vFdH6cLo`LX@vX{e<_!*hM%=!4(^pjasEMu+o)YE1|L
z<^yqC`-`Fo-OyuhbZpopNGV03n0Kvb%~pV0h++w*X~N@iFxet$0KW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Status/serverStatus.js
index e52d380fe..d0286b787 100644
--- a/serverStatus/static/serverStatus/serverStatus.js
+++ b/serverStatus/static/serverStatus/serverStatus.js
@@ -5,7 +5,7 @@
/* Java script code to start/stop litespeed */
-app.controller('litespeedStatus', function($scope,$http) {
+app.controller('litespeedStatus', function ($scope, $http) {
$scope.restartorStopLoading = true;
$scope.actionResult = true;
@@ -13,424 +13,627 @@ app.controller('litespeedStatus', function($scope,$http) {
$scope.serverStatusCouldNotConnect = true;
- $scope.restartLitespeed = function(){
+ $scope.restartLitespeed = function () {
- $scope.disableReboot = true;
- $scope.disableStop = true;
- $scope.restartorStopLoading = false;
+ $scope.disableReboot = true;
+ $scope.disableStop = true;
+ $scope.restartorStopLoading = false;
+ var url = "/serverstatus/startorstopLitespeed";
+
+ var data = {
+ reboot: 1,
+ };
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
- var url = "/serverstatus/startorstopLitespeed";
+ function ListInitialDatas(response) {
- var data = {
- reboot:1,
- };
+ $scope.restartorStopLoading = true;
+ $scope.disableReboot = false;
+ $scope.disableStop = false;
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
+ if (response.data.reboot == 1) {
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
-
-
- function ListInitialDatas(response) {
-
- $scope.restartorStopLoading = true;
- $scope.disableReboot = false;
- $scope.disableStop = false;
-
- if(response.data.reboot == 1){
-
- $scope.restartorStopLoading = true;
- $scope.actionResult = false;
- $scope.actionResultBad = true;
- $scope.serverStatusCouldNotConnect = true;
-
- }
- else{
-
- $scope.restartorStopLoading = true;
- $scope.actionResult = true;
- $scope.actionResultBad = false;
- $scope.serverStatusCouldNotConnect = true;
- }
-
-
- }
- function cantLoadInitialDatas(response) {
- $scope.restartorStopLoading = true;
- $scope.actionResult = true;
- $scope.actionResultBad = true;
- $scope.serverStatusCouldNotConnect = false;
- $scope.disableReboot = false;
- $scope.disableStop = false;
- }
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = false;
+ $scope.actionResultBad = true;
+ $scope.serverStatusCouldNotConnect = true;
+
+ }
+ else {
+
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = true;
+ $scope.actionResultBad = false;
+ $scope.serverStatusCouldNotConnect = true;
+ }
+ }
+ function cantLoadInitialDatas(response) {
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = true;
+ $scope.actionResultBad = true;
+ $scope.serverStatusCouldNotConnect = false;
+ $scope.disableReboot = false;
+ $scope.disableStop = false;
+ }
};
-
- $scope.stopLitespeed = function(){
+ $scope.stopLitespeed = function () {
- $scope.disableReboot = true;
- $scope.disableStop = true;
- $scope.restartorStopLoading = false;
+ $scope.disableReboot = true;
+ $scope.disableStop = true;
+ $scope.restartorStopLoading = false;
+ var url = "/serverstatus/startorstopLitespeed";
+
+ var data = {
+ reboot: 0,
+ };
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
- var url = "/serverstatus/startorstopLitespeed";
+ function ListInitialDatas(response) {
- var data = {
- reboot:0,
- };
+ $scope.restartorStopLoading = true;
+ $scope.disableReboot = false;
+ $scope.disableStop = false;
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
+ if (response.data.shutdown == 1) {
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = false;
+ $scope.actionResultBad = true;
+ $scope.serverStatusCouldNotConnect = true;
+
+ }
+ else {
+
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = true;
+ $scope.actionResultBad = false;
+ $scope.serverStatusCouldNotConnect = true;
+ }
- function ListInitialDatas(response) {
+ }
- $scope.restartorStopLoading = true;
- $scope.disableReboot = false;
- $scope.disableStop = false;
-
- if(response.data.shutdown == 1){
-
- $scope.restartorStopLoading = true;
- $scope.actionResult = false;
- $scope.actionResultBad = true;
- $scope.serverStatusCouldNotConnect = true;
-
- }
- else{
-
- $scope.restartorStopLoading = true;
- $scope.actionResult = true;
- $scope.actionResultBad = false;
- $scope.serverStatusCouldNotConnect = true;
- }
+ function cantLoadInitialDatas(response) {
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = true;
+ $scope.actionResultBad = true;
+ $scope.serverStatusCouldNotConnect = false;
+ $scope.disableReboot = false;
+ $scope.disableStop = false;
+ }
- }
- function cantLoadInitialDatas(response) {
- $scope.restartorStopLoading = true;
- $scope.actionResult = true;
- $scope.actionResultBad = true;
- $scope.serverStatusCouldNotConnect = false;
- $scope.disableReboot = false;
- $scope.disableStop = false;
- }
+ };
+
+ /// License Manager
+
+ $scope.cpLoading = true;
+ $scope.fetchedData = true;
+ $scope.changeSerialBox = true;
+
+ $scope.hideLicenseStatus = function () {
+ $scope.fetchedData = true;
+ };
+
+ $scope.licenseStatus = function () {
+
+ $scope.cpLoading = false;
+ $scope.changeSerialBox = true;
+
+ var url = "/serverstatus/licenseStatus";
+
+ var data = {};
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+ function ListInitialDatas(response) {
+
+ if (response.data.status === 1) {
+ $scope.cpLoading = true;
+ $scope.fetchedData = false;
+ new PNotify({
+ title: 'Success!',
+ text: 'Status successfully fetched',
+ type: 'success'
+ });
+ $scope.lsSerial = response.data.lsSerial;
+ $scope.lsexpiration = response.data.lsexpiration;
+ }
+ else {
+ $scope.cpLoading = true;
+ new PNotify({
+ title: 'Operation Failed!',
+ text: response.data.erroMessage,
+ type: 'error'
+ });
+ }
+
+ }
+
+ function cantLoadInitialDatas(response) {
+ $scope.cpLoading = true;
+ new PNotify({
+ title: 'Operation Failed!',
+ text: 'Could not connect to server, please refresh this page.',
+ type: 'error'
+ });
+
+ }
+
+
+ };
+ $scope.showSerialBox = function () {
+ $scope.fetchedData = true;
+ $scope.changeSerialBox = false;
+ };
+ $scope.changeLicense = function () {
+
+ $scope.cpLoading = false;
+
+ var url = "/serverstatus/changeLicense";
+
+ var data = {newKey: $scope.newKey};
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+
+ if (response.data.status === 1) {
+ $scope.cpLoading = true;
+ new PNotify({
+ title: 'Success!',
+ text: 'License successfully Updated',
+ type: 'success'
+ });
+ }
+ else {
+ $scope.cpLoading = true;
+ new PNotify({
+ title: 'Operation Failed!',
+ text: response.data.erroMessage,
+ type: 'error'
+ });
+ }
+
+ }
+
+ function cantLoadInitialDatas(response) {
+ $scope.cpLoading = true;
+ new PNotify({
+ title: 'Operation Failed!',
+ text: 'Could not connect to server, please refresh this page.',
+ type: 'error'
+ });
+
+ }
+
};
});
-
-
/* Java script code to start/stop litespeed */
-
-
-
/* Java script code to read log file */
+app.controller('readCyberCPLogFile', function ($scope, $http) {
-app.controller('readCyberCPLogFile', function($scope,$http) {
+ $scope.logFileLoading = false;
+ $scope.logsFeteched = true;
+ $scope.couldNotFetchLogs = true;
- $scope.logFileLoading = false;
- $scope.logsFeteched = true;
+
+ var url = "/serverstatus/getFurtherDataFromLogFile";
+
+ var data = {};
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+
+
+ if (response.data.logstatus == 1) {
+
+ $scope.logFileLoading = true;
+ $scope.logsFeteched = false;
+ $scope.couldNotFetchLogs = true;
+
+ $scope.logsData = response.data.logsdata;
+
+
+ }
+ else {
+
+ $scope.logFileLoading = true;
+ $scope.logsFeteched = true;
+ $scope.couldNotFetchLogs = false;
+
+
+ }
+
+
+ }
+
+ function cantLoadInitialDatas(response) {
+
+ $scope.logFileLoading = true;
+ $scope.logsFeteched = true;
+ $scope.couldNotFetchLogs = false;
+
+ }
+
+
+ $scope.fetchLogs = function () {
+
+
+ $scope.logFileLoading = false;
+ $scope.logsFeteched = true;
+ $scope.couldNotFetchLogs = true;
+
+
+ var url = "/serverstatus/getFurtherDataFromLogFile";
+
+ var data = {};
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+
+
+ if (response.data.logstatus == 1) {
+
+ $scope.logFileLoading = true;
+ $scope.logsFeteched = false;
$scope.couldNotFetchLogs = true;
-
- var url = "/serverstatus/getFurtherDataFromLogFile";
-
- var data = {};
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
+ $scope.logsData = response.data.logsdata;
- function ListInitialDatas(response) {
+ }
+ else {
-
-
- if(response.data.logstatus == 1){
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = false;
- $scope.couldNotFetchLogs = true;
-
- $scope.logsData = response.data.logsdata;
-
-
-
- }
- else{
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = true;
- $scope.couldNotFetchLogs = false;
-
-
- }
-
-
- }
- function cantLoadInitialDatas(response) {
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = true;
- $scope.couldNotFetchLogs = false;
-
- }
-
-
-
-
- $scope.fetchLogs = function(){
-
-
- $scope.logFileLoading = false;
+ $scope.logFileLoading = true;
$scope.logsFeteched = true;
- $scope.couldNotFetchLogs = true;
+ $scope.couldNotFetchLogs = false;
- var url = "/serverstatus/getFurtherDataFromLogFile";
-
- var data = {};
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
+ }
- function ListInitialDatas(response) {
-
-
-
- if(response.data.logstatus == 1){
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = false;
- $scope.couldNotFetchLogs = true;
-
- $scope.logsData = response.data.logsdata;
-
-
-
- }
- else{
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = true;
- $scope.couldNotFetchLogs = false;
-
-
- }
-
-
- }
- function cantLoadInitialDatas(response) {
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = true;
- $scope.couldNotFetchLogs = false;
-
- }
+ }
+ function cantLoadInitialDatas(response) {
+ $scope.logFileLoading = true;
+ $scope.logsFeteched = true;
+ $scope.couldNotFetchLogs = false;
+ }
};
});
-
-
/* Java script code to read log file ends here */
-
/* Java script code to read log file ends here */
/* Services */
-app.controller('servicesManager', function($scope,$http) {
+app.controller('servicesManager', function ($scope, $http) {
- $scope.services = false;
- $scope.btnDisable = false;
- $scope.actionLoader = false;
+ $scope.services = false;
+ $scope.btnDisable = false;
+ $scope.actionLoader = false;
- function getServiceStatus(){
- $scope.btnDisable = true;
+ function getServiceStatus() {
+ $scope.btnDisable = true;
- url = "/serverstatus/servicesStatus";
+ url = "/serverstatus/servicesStatus";
- $http.post(url).then(ListInitialDatas, cantLoadInitialDatas);
+ $http.post(url).then(ListInitialDatas, cantLoadInitialDatas);
- function ListInitialDatas(response) {
+ function ListInitialDatas(response) {
- if (response.data.status.litespeed) {
- $scope.olsStatus = "Running";
- $scope.olsStats = true;
- $scope.olsStart = false;
- $scope.olsStop = true;
- $scope.olsMem = Math.round(parseInt(response.data.memUsage.litespeed) / 1048576) + " MB";
- }
- else {
- $scope.olsStatus = "Stopped";
- $scope.olsStats = false;
- $scope.olsStart = true;
- $scope.olsStop = false;
- }
+ if (response.data.status.litespeed) {
+ $scope.olsStatus = "Running";
+ $scope.olsStats = true;
+ $scope.olsStart = false;
+ $scope.olsStop = true;
+ $scope.olsMem = Math.round(parseInt(response.data.memUsage.litespeed) / 1048576) + " MB";
+ }
+ else {
+ $scope.olsStatus = "Stopped";
+ $scope.olsStats = false;
+ $scope.olsStart = true;
+ $scope.olsStop = false;
+ }
- // Update SQL stats
+ // Update SQL stats
- if (response.data.status.mysql) {
- $scope.sqlStatus = "Running";
- $scope.sqlStats = true;
- $scope.sqlStart = false;
- $scope.sqlStop = true;
- $scope.sqlMem = Math.round(parseInt(response.data.memUsage.mysql) / 1048576) + " MB";
- }
- else {
- $scope.sqlStatus = "Stopped";
- $scope.sqlStats = false;
- $scope.sqlStart = true;
- $scope.sqlStop = false;
- }
+ if (response.data.status.mysql) {
+ $scope.sqlStatus = "Running";
+ $scope.sqlStats = true;
+ $scope.sqlStart = false;
+ $scope.sqlStop = true;
+ $scope.sqlMem = Math.round(parseInt(response.data.memUsage.mysql) / 1048576) + " MB";
+ }
+ else {
+ $scope.sqlStatus = "Stopped";
+ $scope.sqlStats = false;
+ $scope.sqlStart = true;
+ $scope.sqlStop = false;
+ }
- // Update DNS stats
+ // Update DNS stats
- if (response.data.status.powerdns) {
- $scope.dnsStatus = "Running";
- $scope.dnsStats = true;
- $scope.dnsStart = false;
- $scope.dnsStop = true;
- $scope.dnsMem = Math.round(parseInt(response.data.memUsage.powerdns) / 1048576) + " MB";
- }
- else {
- $scope.dnsStatus = "Stopped";
- $scope.dnsStats = false;
- $scope.dnsStart = true;
- $scope.dnsStop = false;
- }
+ if (response.data.status.powerdns) {
+ $scope.dnsStatus = "Running";
+ $scope.dnsStats = true;
+ $scope.dnsStart = false;
+ $scope.dnsStop = true;
+ $scope.dnsMem = Math.round(parseInt(response.data.memUsage.powerdns) / 1048576) + " MB";
+ }
+ else {
+ $scope.dnsStatus = "Stopped";
+ $scope.dnsStats = false;
+ $scope.dnsStart = true;
+ $scope.dnsStop = false;
+ }
- // Update FTP stats
+ // Update FTP stats
- if (response.data.status.pureftp) {
- $scope.ftpStatus = "Running";
- $scope.ftpStats = true;
- $scope.ftpStart = false;
- $scope.ftpStop = true;
- $scope.ftpMem = Math.round(parseInt(response.data.memUsage.pureftp) / 1048576) + " MB";
- }
- else {
- $scope.ftpStatus = "Stopped";
- $scope.ftpStats = false;
- $scope.ftpStart = true;
- $scope.ftpStop = false;
- }
+ if (response.data.status.pureftp) {
+ $scope.ftpStatus = "Running";
+ $scope.ftpStats = true;
+ $scope.ftpStart = false;
+ $scope.ftpStop = true;
+ $scope.ftpMem = Math.round(parseInt(response.data.memUsage.pureftp) / 1048576) + " MB";
+ }
+ else {
+ $scope.ftpStatus = "Stopped";
+ $scope.ftpStats = false;
+ $scope.ftpStart = true;
+ $scope.ftpStop = false;
+ }
- $scope.services = true;
+ $scope.services = true;
- $scope.btnDisable = false;
+ $scope.btnDisable = false;
- }
- function cantLoadInitialDatas(response) {
- $scope.couldNotConnect = true;
+ }
- }
+ function cantLoadInitialDatas(response) {
+ $scope.couldNotConnect = true;
- };
- getServiceStatus();
+ }
- $scope.serviceAction = function(serviceName, action){
- $scope.ActionProgress = true;
- $scope.btnDisable = true;
- $scope.ActionSuccessfull = false;
- $scope.ActionFailed = false;
- $scope.couldNotConnect = false;
- $scope.actionLoader = true;
+ };
+ getServiceStatus();
- url = "/serverstatus/servicesAction";
+ $scope.serviceAction = function (serviceName, action) {
+ $scope.ActionProgress = true;
+ $scope.btnDisable = true;
+ $scope.ActionSuccessfull = false;
+ $scope.ActionFailed = false;
+ $scope.couldNotConnect = false;
+ $scope.actionLoader = true;
- var data = {
- service:serviceName,
- action:action
- };
+ url = "/serverstatus/servicesAction";
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
+ var data = {
+ service: serviceName,
+ action: action
+ };
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
- function ListInitialDatas(response) {
- console.log(response.data);
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
- if(response.data.serviceAction == 1){
- setTimeout(function() {
- getServiceStatus();
- $scope.ActionSuccessfull = true;
- $scope.ActionFailed = false;
- $scope.couldNotConnect = false;
- $scope.actionLoader = false;
- $scope.btnDisable = false;
- }, 3000);
- }
- else{
- setTimeout(function() {
- getServiceStatus();
- $scope.ActionSuccessfull = false;
- $scope.ActionFailed = true;
- $scope.couldNotConnect = false;
- $scope.actionLoader = false;
- $scope.btnDisable = false;
- }, 5000);
+ function ListInitialDatas(response) {
+ console.log(response.data);
- }
-
- }
- function cantLoadInitialDatas(response) {
- $scope.ActionSuccessfull = false;
+ if (response.data.serviceAction == 1) {
+ setTimeout(function () {
+ getServiceStatus();
+ $scope.ActionSuccessfull = true;
$scope.ActionFailed = false;
- $scope.couldNotConnect = true;
+ $scope.couldNotConnect = false;
$scope.actionLoader = false;
$scope.btnDisable = false;
- }
+ }, 3000);
+ }
+ else {
+ setTimeout(function () {
+ getServiceStatus();
+ $scope.ActionSuccessfull = false;
+ $scope.ActionFailed = true;
+ $scope.couldNotConnect = false;
+ $scope.actionLoader = false;
+ $scope.btnDisable = false;
+ }, 5000);
- }
+ }
+
+ }
+
+ function cantLoadInitialDatas(response) {
+ $scope.ActionSuccessfull = false;
+ $scope.ActionFailed = false;
+ $scope.couldNotConnect = true;
+ $scope.actionLoader = false;
+ $scope.btnDisable = false;
+ }
+
+ }
});
+
+app.controller('lswsSwitch', function ($scope, $http, $timeout, $window) {
+
+
+ $scope.cyberPanelLoading = true;
+ $scope.installBoxGen = true;
+
+ $scope.switchTOLSWS = function () {
+
+ $scope.cyberPanelLoading = false;
+ $scope.installBoxGen = true;
+
+ url = "/serverstatus/switchTOLSWS";
+
+ var data = {
+ licenseKey: $scope.licenseKey
+ };
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+ $scope.cyberPanelLoading = true;
+ if (response.data.status === 1) {
+ $scope.installBoxGen = false;
+ getRequestStatus();
+ }
+ else {
+ new PNotify({
+ title: 'Operation Failed!',
+ text: response.data.error_message,
+ type: 'error'
+ });
+ }
+
+ }
+
+ function cantLoadInitialDatas(response) {
+ $scope.cyberPanelLoading = true;
+ new PNotify({
+ title: 'Operation Failed!',
+ text: 'Could not connect to server, please refresh this page',
+ type: 'error'
+ });
+ }
+
+ };
+
+ function getRequestStatus() {
+ $scope.cyberPanelLoading = false;
+
+ url = "/serverstatus/switchTOLSWSStatus";
+
+ var data = {};
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+ if (response.data.abort === 0) {
+ $scope.requestData = response.data.requestStatus;
+ $timeout(getRequestStatus, 1000);
+ }
+ else {
+ // Notifications
+ $scope.cyberPanelLoading = true;
+ $timeout.cancel();
+ $scope.requestData = response.data.requestStatus;
+ if (response.data.installed === 1) {
+ $timeout(function () {
+ $window.location.reload();
+ }, 3000);
+ }
+
+ }
+ }
+
+ function cantLoadInitialDatas(response) {
+ $scope.cyberPanelLoading = true;
+ new PNotify({
+ title: 'Operation Failed!',
+ text: 'Could not connect to server, please refresh this page',
+ type: 'error'
+ });
+
+
+ }
+
+ }
+
+});
\ No newline at end of file
diff --git a/serverStatus/templates/serverStatus/litespeedStatus.html b/serverStatus/templates/serverStatus/litespeedStatus.html
index 33f180914..a77e7d078 100644
--- a/serverStatus/templates/serverStatus/litespeedStatus.html
+++ b/serverStatus/templates/serverStatus/litespeedStatus.html
@@ -3,14 +3,13 @@
{% block title %}{% trans "LiteSpeed Status - CyberPanel" %}{% endblock %}
{% block content %}
-{% load static %}
-{% get_current_language as LANGUAGE_CODE %}
-
+ {% load static %}
+ {% get_current_language as LANGUAGE_CODE %}
+
-
-
-
+ {% if OLS %}
+
{% trans "LiteSpeed Status:" %} 
@@ -20,17 +19,17 @@
-
-
+
+
-
+
{% if processList %}
+ {% trans "LiteSpeed Processes" %}
+
@@ -42,7 +41,7 @@
{% for items in processList %}
-
+
| {{ forloop.counter }} |
{{ items }} |
@@ -58,22 +57,24 @@
{% endif %}
- {% endfor %}
+ {% endfor %}
{% else %}
-
{% trans "Could not fetch details, either LiteSpeed is not running or some error occurred, please see CyberPanel Main log file." %}
+
{% trans "Could not fetch details, either LiteSpeed is not running or some error occurred, please see CyberPanel Main log file." %}
{% endif %}
-
+
+
+
+
+
+
+
+
+
+
+
+ | {{ modules }} |
+
+
+
+ {% for items in loadedModules %}
+
+ | {{ items }} |
+
+
+ {% endfor %}
+
+
+
-
-
-
-
-
-
-
-
-
-
-
- | {{ modules }} |
-
-
-
- {% for items in loadedModules %}
-
- | {{ items }} |
-
-
- {% endfor %}
-
-
-
-
-
+
+
+
+
+
+ {% else %}
+
+
+
+
{% trans "LiteSpeed Status:" %} 
+
{% trans "On this page you can get information regarding your LiteSpeed processes." %}
+
+
+
+
+
+
+
+
+
+ {% if processList %}
+
+
+
+
+
+
+ | # |
+ {% trans "Process ID" %} |
+ {% trans "Name" %} |
+
+
+
+ {% for items in processList %}
+
+ | {{ forloop.counter }} |
+
+ {{ items }} |
+
+ {% if forloop.counter == 1 %}
+ {% trans "Main Process" %} |
+
+ {% elif forloop.counter == 2 %}
+ {% trans "lscgid Process" %} |
+
+ {% else %}
+ {% trans "Worker Process" %} |
+
+ {% endif %}
+
+ {% endfor %}
+
+
+
+ {% else %}
+
+
{% trans "Could not fetch details, either LiteSpeed is not running or some error occurred, please see CyberPanel Main log file." %}
+
+ {% endif %}
+
+
+ {% trans "Reboot Litespeed" %}
+
+
+
+
+ {% trans "Stop LiteSpeed" %}
+
+
+
+

+
+
+
+
{% trans "Action successful." %}
+
+
+
+
+
{% trans "Error Occurred. See CyberPanel main log file." %}
+
+
+
+
+
{% trans "Could not connect to server." %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{$ lsSerial $}
+
{$ lsexpiration $}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {% endif %}
{% endblock %}
\ No newline at end of file
diff --git a/serverStatus/templates/serverStatus/services.html b/serverStatus/templates/serverStatus/services.html
index 54ed94e0f..dab445905 100644
--- a/serverStatus/templates/serverStatus/services.html
+++ b/serverStatus/templates/serverStatus/services.html
@@ -35,7 +35,7 @@
-
OpenLiteSpeed
+ {{ serverName }}
Stopped
diff --git a/serverStatus/urls.py b/serverStatus/urls.py
index fa6060e27..39569e1c4 100644
--- a/serverStatus/urls.py
+++ b/serverStatus/urls.py
@@ -3,13 +3,17 @@ import views
urlpatterns = [
url(r'^$', views.serverStatusHome, name='serverStatusHome'),
- url(r'^litespeedStatus', views.litespeedStatus, name='litespeedStatus'),
- url(r'^startorstopLitespeed', views.stopOrRestartLitespeed, name='startorstopLitespeed'),
- url(r'^cyberCPMainLogFile', views.cyberCPMainLogFile, name='cyberCPMainLogFile'),
- url(r'^getFurtherDataFromLogFile',views.getFurtherDataFromLogFile,name='getFurtherDataFromLogFile'),
+ url(r'^litespeedStatus$', views.litespeedStatus, name='litespeedStatus'),
+ url(r'^startorstopLitespeed$', views.stopOrRestartLitespeed, name='startorstopLitespeed'),
+ url(r'^cyberCPMainLogFile$', views.cyberCPMainLogFile, name='cyberCPMainLogFile'),
+ url(r'^getFurtherDataFromLogFile$',views.getFurtherDataFromLogFile,name='getFurtherDataFromLogFile'),
- url(r'^servicesStatus', views.servicesStatus, name='servicesStatus'),
- url(r'^servicesAction', views.servicesAction, name='servicesAction'),
- url(r'^services', views.services, name='services'),
+ url(r'^servicesStatus$', views.servicesStatus, name='servicesStatus'),
+ url(r'^servicesAction$', views.servicesAction, name='servicesAction'),
+ url(r'^services$', views.services, name='services'),
+ url(r'^switchTOLSWS$', views.switchTOLSWS, name='switchTOLSWS'),
+ url(r'^switchTOLSWSStatus$', views.switchTOLSWSStatus, name='switchTOLSWSStatus'),
+ url(r'^licenseStatus$', views.licenseStatus, name='licenseStatus'),
+ url(r'^changeLicense$', views.changeLicense, name='changeLicense'),
]
\ No newline at end of file
diff --git a/serverStatus/views.py b/serverStatus/views.py
index 623bd8f1f..b269fadd2 100644
--- a/serverStatus/views.py
+++ b/serverStatus/views.py
@@ -3,7 +3,6 @@ from __future__ import unicode_literals
from django.shortcuts import render,redirect
from django.http import HttpResponse
-from plogical.processUtilities import ProcessUtilities
import plogical.CyberCPLogFileWriter as logging
from loginSystem.views import loadLoginPage
import json
@@ -13,6 +12,10 @@ import shlex
import socket
from plogical.acl import ACLManager
import os
+from plogical.virtualHostUtilities import virtualHostUtilities
+import time
+import serverStatusUtil
+from plogical.processUtilities import ProcessUtilities
# Create your views here.
def serverStatusHome(request):
@@ -26,7 +29,6 @@ def litespeedStatus(request):
try:
userID = request.session['userID']
-
currentACL = ACLManager.loadedACL(userID)
if currentACL['admin'] == 1:
@@ -36,6 +38,9 @@ def litespeedStatus(request):
processList = ProcessUtilities.getLitespeedProcessNumber()
+ OLS = 0
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ OLS = 1
try:
versionInformation = subprocess.check_output(["/usr/local/lsws/bin/lshttpd", "-v"]).split("\n")
@@ -54,16 +59,16 @@ def litespeedStatus(request):
except subprocess.CalledProcessError,msg:
logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[litespeedStatus]")
- return render(request,"serverStatus/litespeedStatus.html",{"processList":processList,"liteSpeedVersionStatus":"For some reaons not able to load version details, see CyberCP main log file."})
+ return render(request,"serverStatus/litespeedStatus.html",{"processList":processList,"liteSpeedVersionStatus":"For some reaons not able to load version details, see CyberCP main log file.", 'OLS': OLS})
if(processList!=0):
dataForHtml = {"processList": processList, "lsversion": lsversion, "modules": modules,
- "loadedModules": loadedModules}
+ "loadedModules": loadedModules, 'OLS':OLS}
return render(request,"serverStatus/litespeedStatus.html",dataForHtml)
else:
dataForHtml = {"lsversion": lsversion, "modules": modules,
- "loadedModules": loadedModules}
+ "loadedModules": loadedModules, 'OLS': OLS}
return render(request, "serverStatus/litespeedStatus.html",dataForHtml)
except KeyError,msg:
@@ -152,8 +157,14 @@ def services(request):
pass
else:
return ACLManager.loadError()
+ data = {}
- return render(request, 'serverStatus/services.html')
+ if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
+ data['serverName'] = 'OpenLiteSpeed'
+ else:
+ data['serverName'] = 'LiteSpeed Ent'
+
+ return render(request, 'serverStatus/services.html', data)
except KeyError:
return redirect(loadLoginPage)
@@ -302,3 +313,134 @@ def servicesAction(request):
final_dic = {'serviceAction': 0, 'error_message': str(msg)}
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
+
+def switchTOLSWS(request):
+ try:
+ userID = request.session['userID']
+
+ currentACL = ACLManager.loadedACL(userID)
+
+ if currentACL['admin'] == 1:
+ pass
+ else:
+ return ACLManager.loadErrorJson('status', 0)
+
+ data = json.loads(request.body)
+
+ execPath = "sudo /usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/serverStatus/serverStatusUtil.py"
+ execPath = execPath + " switchTOLSWS --licenseKey " + data['licenseKey']
+
+ subprocess.Popen(shlex.split(execPath))
+ time.sleep(2)
+
+ data_ret = {'status': 1, 'error_message': "None", }
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+
+ except BaseException, msg:
+ data_ret = {'status': 0, 'error_message': str(msg)}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+
+def switchTOLSWSStatus(request):
+ try:
+
+ command = 'sudo cat ' + serverStatusUtil.ServerStatusUtil.lswsInstallStatusPath
+ output = subprocess.check_output(shlex.split(command))
+
+ if output.find('[404]') > -1:
+ data_ret = {'abort': 1, 'requestStatus': output, 'installed': 0}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+ elif output.find('[200]') > -1:
+ data_ret = {'abort': 1, 'requestStatus': output, 'installed': 1}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+ else:
+ data_ret = {'abort': 0, 'requestStatus': output, 'installed': 0}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+
+ except BaseException, msg:
+ data_ret = {'abort': 1, 'requestStatus': str(msg), 'installed': 0}
+ json_data = json.dumps(data_ret)
+ return HttpResponse(json_data)
+
+def licenseStatus(request):
+ try:
+ userID = request.session['userID']
+
+ try:
+ currentACL = ACLManager.loadedACL(userID)
+
+ if currentACL['admin'] == 1:
+ pass
+ else:
+ return ACLManager.loadErrorJson('status', 0)
+
+ command = 'sudo cat /usr/local/lsws/conf/serial.no'
+ serial = subprocess.check_output(shlex.split(command))
+
+
+ command = 'sudo /usr/local/lsws/bin/lshttpd -V'
+ expiration = subprocess.check_output(shlex.split(command))
+
+ final_dic = {'status': 1, "erroMessage": 0, 'lsSerial': serial, 'lsexpiration': expiration}
+ final_json = json.dumps(final_dic)
+ return HttpResponse(final_json)
+
+ except BaseException, msg:
+ final_dic = {'status': 0, 'erroMessage': str(msg)}
+ final_json = json.dumps(final_dic)
+ return HttpResponse(final_json)
+ except KeyError, msg:
+ final_dic = {'status': 0, 'erroMessage': str(msg)}
+ final_json = json.dumps(final_dic)
+ return HttpResponse(final_json)
+
+def changeLicense(request):
+ try:
+ userID = request.session['userID']
+
+ try:
+ currentACL = ACLManager.loadedACL(userID)
+
+ if currentACL['admin'] == 1:
+ pass
+ else:
+ return ACLManager.loadErrorJson('status', 0)
+
+ data = json.loads(request.body)
+ newKey = data['newKey']
+
+ command = 'sudo chown -R cyberpanel:cyberpanel /usr/local/lsws/conf'
+ subprocess.call(shlex.split(command))
+
+ serialPath = '/usr/local/lsws/conf/serial.no'
+ serialFile = open(serialPath, 'w')
+ serialFile.write(newKey)
+ serialFile.close()
+
+ command = 'sudo chown -R lsadm:lsadm /usr/local/lsws/conf'
+ subprocess.call(shlex.split(command))
+
+
+ command = 'sudo /usr/local/lsws/bin/lshttpd -r'
+ subprocess.call(shlex.split(command))
+
+ command = 'sudo /usr/local/lsws/bin/lswsctrl restart'
+ subprocess.call(shlex.split(command))
+
+
+ final_dic = {'status': 1, "erroMessage": 'None'}
+ final_json = json.dumps(final_dic)
+ return HttpResponse(final_json)
+
+ except BaseException, msg:
+ final_dic = {'status': 0, 'erroMessage': str(msg)}
+ final_json = json.dumps(final_dic)
+ return HttpResponse(final_json)
+ except KeyError, msg:
+ final_dic = {'status': 0, 'erroMessage': str(msg)}
+ final_json = json.dumps(final_dic)
+ return HttpResponse(final_json)
\ No newline at end of file
diff --git a/static/firewall/firewall.js b/static/firewall/firewall.js
index ba9df9207..bb0e4a07f 100644
--- a/static/firewall/firewall.js
+++ b/static/firewall/firewall.js
@@ -3,10 +3,6 @@
*/
-
-
-
-
/* Java script code to ADD Firewall Rules */
app.controller('firewallController', function($scope,$http) {
@@ -548,8 +544,6 @@ app.controller('firewallController', function($scope,$http) {
/* Java script code to ADD Firewall Rules */
-
-
/* Java script code to Secure SSH */
app.controller('secureSSHCTRL', function($scope,$http) {
diff --git a/static/images/litespeed-logo.png b/static/images/litespeed-logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..5ac9124e5a901df940868f615e0ea6d10f5388dc
GIT binary patch
literal 22141
zcmc$_cT|(x*De|mB#JbZA_$==s1#9}0YXu#6cIv^-lU6Y=%FYeN`O#A5TqzQ^dcZt
zDF#$P2pwsH6zPOs?+Uv2?;H1g=Z<^Fx#OHac6JQ!yVhK5&iTwa*L>ECJDSQgCs|KI
zAP^c=m0NcqkYk*r|DeagFGCNH+kyX`Ln#`dbX@MEJS-mBK;*4mENwVdoh@u_?%G&b
zd%3pSNJAicFx6Y~x}Jmc!&+E2`((Ziez%S_Co3}hCzR-A`8Rc1n8C)yR{FUIH*YYT
zDb|u}D@lwQX-_}MyDMyNa<=9=i~0SmyQZg#itzjn_~SK>=CQxYeq24(oo@bZ@S~@P
z&M
q&
zx8Ne!k(p%wHLb%br5&sI!`;z+iF(<-%W`}Oo%Z(jGIEFy1ESq;gFxp^FRe6-RrRh)
zOis47Rc1Mtp4BLsVKLbqMGfp33L|fUf8tU2EGiS8`&7w$`>K?zp9^mg#M$N~6KRYp
z0cz&bwX<(6CK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0
zusa(g{uk|1u)=K#ECv5J(>Eme
f|1sTif|S&tUyD!lIiX$ZK(dh2ZsIPEoe%SG6%k|L
literal 0
HcmV?d00001
diff --git a/static/serverStatus/serverStatus.js b/static/serverStatus/serverStatus.js
index e52d380fe..99b324364 100644
--- a/static/serverStatus/serverStatus.js
+++ b/static/serverStatus/serverStatus.js
@@ -5,7 +5,7 @@
/* Java script code to start/stop litespeed */
-app.controller('litespeedStatus', function($scope,$http) {
+app.controller('litespeedStatus', function ($scope, $http) {
$scope.restartorStopLoading = true;
$scope.actionResult = true;
@@ -13,424 +13,507 @@ app.controller('litespeedStatus', function($scope,$http) {
$scope.serverStatusCouldNotConnect = true;
- $scope.restartLitespeed = function(){
+ $scope.restartLitespeed = function () {
- $scope.disableReboot = true;
- $scope.disableStop = true;
- $scope.restartorStopLoading = false;
+ $scope.disableReboot = true;
+ $scope.disableStop = true;
+ $scope.restartorStopLoading = false;
+ var url = "/serverstatus/startorstopLitespeed";
+
+ var data = {
+ reboot: 1,
+ };
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
- var url = "/serverstatus/startorstopLitespeed";
+ function ListInitialDatas(response) {
- var data = {
- reboot:1,
- };
+ $scope.restartorStopLoading = true;
+ $scope.disableReboot = false;
+ $scope.disableStop = false;
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
+ if (response.data.reboot == 1) {
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
-
-
- function ListInitialDatas(response) {
-
- $scope.restartorStopLoading = true;
- $scope.disableReboot = false;
- $scope.disableStop = false;
-
- if(response.data.reboot == 1){
-
- $scope.restartorStopLoading = true;
- $scope.actionResult = false;
- $scope.actionResultBad = true;
- $scope.serverStatusCouldNotConnect = true;
-
- }
- else{
-
- $scope.restartorStopLoading = true;
- $scope.actionResult = true;
- $scope.actionResultBad = false;
- $scope.serverStatusCouldNotConnect = true;
- }
-
-
- }
- function cantLoadInitialDatas(response) {
- $scope.restartorStopLoading = true;
- $scope.actionResult = true;
- $scope.actionResultBad = true;
- $scope.serverStatusCouldNotConnect = false;
- $scope.disableReboot = false;
- $scope.disableStop = false;
- }
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = false;
+ $scope.actionResultBad = true;
+ $scope.serverStatusCouldNotConnect = true;
+
+ }
+ else {
+
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = true;
+ $scope.actionResultBad = false;
+ $scope.serverStatusCouldNotConnect = true;
+ }
+ }
+ function cantLoadInitialDatas(response) {
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = true;
+ $scope.actionResultBad = true;
+ $scope.serverStatusCouldNotConnect = false;
+ $scope.disableReboot = false;
+ $scope.disableStop = false;
+ }
};
- $scope.stopLitespeed = function(){
+ $scope.stopLitespeed = function () {
- $scope.disableReboot = true;
- $scope.disableStop = true;
- $scope.restartorStopLoading = false;
+ $scope.disableReboot = true;
+ $scope.disableStop = true;
+ $scope.restartorStopLoading = false;
+ var url = "/serverstatus/startorstopLitespeed";
+
+ var data = {
+ reboot: 0,
+ };
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
- var url = "/serverstatus/startorstopLitespeed";
+ function ListInitialDatas(response) {
- var data = {
- reboot:0,
- };
+ $scope.restartorStopLoading = true;
+ $scope.disableReboot = false;
+ $scope.disableStop = false;
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
+ if (response.data.shutdown == 1) {
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
-
-
- function ListInitialDatas(response) {
-
- $scope.restartorStopLoading = true;
- $scope.disableReboot = false;
- $scope.disableStop = false;
-
- if(response.data.shutdown == 1){
-
- $scope.restartorStopLoading = true;
- $scope.actionResult = false;
- $scope.actionResultBad = true;
- $scope.serverStatusCouldNotConnect = true;
-
- }
- else{
-
- $scope.restartorStopLoading = true;
- $scope.actionResult = true;
- $scope.actionResultBad = false;
- $scope.serverStatusCouldNotConnect = true;
- }
-
-
- }
- function cantLoadInitialDatas(response) {
- $scope.restartorStopLoading = true;
- $scope.actionResult = true;
- $scope.actionResultBad = true;
- $scope.serverStatusCouldNotConnect = false;
- $scope.disableReboot = false;
- $scope.disableStop = false;
- }
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = false;
+ $scope.actionResultBad = true;
+ $scope.serverStatusCouldNotConnect = true;
+
+ }
+ else {
+
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = true;
+ $scope.actionResultBad = false;
+ $scope.serverStatusCouldNotConnect = true;
+ }
+ }
+ function cantLoadInitialDatas(response) {
+ $scope.restartorStopLoading = true;
+ $scope.actionResult = true;
+ $scope.actionResultBad = true;
+ $scope.serverStatusCouldNotConnect = false;
+ $scope.disableReboot = false;
+ $scope.disableStop = false;
+ }
};
});
-
-
/* Java script code to start/stop litespeed */
-
-
-
/* Java script code to read log file */
+app.controller('readCyberCPLogFile', function ($scope, $http) {
-app.controller('readCyberCPLogFile', function($scope,$http) {
+ $scope.logFileLoading = false;
+ $scope.logsFeteched = true;
+ $scope.couldNotFetchLogs = true;
- $scope.logFileLoading = false;
- $scope.logsFeteched = true;
+
+ var url = "/serverstatus/getFurtherDataFromLogFile";
+
+ var data = {};
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+
+
+ if (response.data.logstatus == 1) {
+
+ $scope.logFileLoading = true;
+ $scope.logsFeteched = false;
+ $scope.couldNotFetchLogs = true;
+
+ $scope.logsData = response.data.logsdata;
+
+
+ }
+ else {
+
+ $scope.logFileLoading = true;
+ $scope.logsFeteched = true;
+ $scope.couldNotFetchLogs = false;
+
+
+ }
+
+
+ }
+
+ function cantLoadInitialDatas(response) {
+
+ $scope.logFileLoading = true;
+ $scope.logsFeteched = true;
+ $scope.couldNotFetchLogs = false;
+
+ }
+
+
+ $scope.fetchLogs = function () {
+
+
+ $scope.logFileLoading = false;
+ $scope.logsFeteched = true;
+ $scope.couldNotFetchLogs = true;
+
+
+ var url = "/serverstatus/getFurtherDataFromLogFile";
+
+ var data = {};
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+
+
+ if (response.data.logstatus == 1) {
+
+ $scope.logFileLoading = true;
+ $scope.logsFeteched = false;
$scope.couldNotFetchLogs = true;
-
- var url = "/serverstatus/getFurtherDataFromLogFile";
-
- var data = {};
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
+ $scope.logsData = response.data.logsdata;
- function ListInitialDatas(response) {
+ }
+ else {
-
-
- if(response.data.logstatus == 1){
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = false;
- $scope.couldNotFetchLogs = true;
-
- $scope.logsData = response.data.logsdata;
-
-
-
- }
- else{
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = true;
- $scope.couldNotFetchLogs = false;
-
-
- }
-
-
- }
- function cantLoadInitialDatas(response) {
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = true;
- $scope.couldNotFetchLogs = false;
-
- }
-
-
-
-
- $scope.fetchLogs = function(){
-
-
- $scope.logFileLoading = false;
+ $scope.logFileLoading = true;
$scope.logsFeteched = true;
- $scope.couldNotFetchLogs = true;
+ $scope.couldNotFetchLogs = false;
- var url = "/serverstatus/getFurtherDataFromLogFile";
-
- var data = {};
-
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
-
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
+ }
- function ListInitialDatas(response) {
-
-
-
- if(response.data.logstatus == 1){
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = false;
- $scope.couldNotFetchLogs = true;
-
- $scope.logsData = response.data.logsdata;
-
-
-
- }
- else{
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = true;
- $scope.couldNotFetchLogs = false;
-
-
- }
-
-
- }
- function cantLoadInitialDatas(response) {
-
- $scope.logFileLoading = true;
- $scope.logsFeteched = true;
- $scope.couldNotFetchLogs = false;
-
- }
+ }
+ function cantLoadInitialDatas(response) {
+ $scope.logFileLoading = true;
+ $scope.logsFeteched = true;
+ $scope.couldNotFetchLogs = false;
+ }
};
});
-
-
/* Java script code to read log file ends here */
-
/* Java script code to read log file ends here */
/* Services */
-app.controller('servicesManager', function($scope,$http) {
+app.controller('servicesManager', function ($scope, $http) {
- $scope.services = false;
- $scope.btnDisable = false;
- $scope.actionLoader = false;
+ $scope.services = false;
+ $scope.btnDisable = false;
+ $scope.actionLoader = false;
- function getServiceStatus(){
- $scope.btnDisable = true;
+ function getServiceStatus() {
+ $scope.btnDisable = true;
- url = "/serverstatus/servicesStatus";
+ url = "/serverstatus/servicesStatus";
- $http.post(url).then(ListInitialDatas, cantLoadInitialDatas);
+ $http.post(url).then(ListInitialDatas, cantLoadInitialDatas);
- function ListInitialDatas(response) {
+ function ListInitialDatas(response) {
- if (response.data.status.litespeed) {
- $scope.olsStatus = "Running";
- $scope.olsStats = true;
- $scope.olsStart = false;
- $scope.olsStop = true;
- $scope.olsMem = Math.round(parseInt(response.data.memUsage.litespeed) / 1048576) + " MB";
- }
- else {
- $scope.olsStatus = "Stopped";
- $scope.olsStats = false;
- $scope.olsStart = true;
- $scope.olsStop = false;
- }
+ if (response.data.status.litespeed) {
+ $scope.olsStatus = "Running";
+ $scope.olsStats = true;
+ $scope.olsStart = false;
+ $scope.olsStop = true;
+ $scope.olsMem = Math.round(parseInt(response.data.memUsage.litespeed) / 1048576) + " MB";
+ }
+ else {
+ $scope.olsStatus = "Stopped";
+ $scope.olsStats = false;
+ $scope.olsStart = true;
+ $scope.olsStop = false;
+ }
- // Update SQL stats
+ // Update SQL stats
- if (response.data.status.mysql) {
- $scope.sqlStatus = "Running";
- $scope.sqlStats = true;
- $scope.sqlStart = false;
- $scope.sqlStop = true;
- $scope.sqlMem = Math.round(parseInt(response.data.memUsage.mysql) / 1048576) + " MB";
- }
- else {
- $scope.sqlStatus = "Stopped";
- $scope.sqlStats = false;
- $scope.sqlStart = true;
- $scope.sqlStop = false;
- }
+ if (response.data.status.mysql) {
+ $scope.sqlStatus = "Running";
+ $scope.sqlStats = true;
+ $scope.sqlStart = false;
+ $scope.sqlStop = true;
+ $scope.sqlMem = Math.round(parseInt(response.data.memUsage.mysql) / 1048576) + " MB";
+ }
+ else {
+ $scope.sqlStatus = "Stopped";
+ $scope.sqlStats = false;
+ $scope.sqlStart = true;
+ $scope.sqlStop = false;
+ }
- // Update DNS stats
+ // Update DNS stats
- if (response.data.status.powerdns) {
- $scope.dnsStatus = "Running";
- $scope.dnsStats = true;
- $scope.dnsStart = false;
- $scope.dnsStop = true;
- $scope.dnsMem = Math.round(parseInt(response.data.memUsage.powerdns) / 1048576) + " MB";
- }
- else {
- $scope.dnsStatus = "Stopped";
- $scope.dnsStats = false;
- $scope.dnsStart = true;
- $scope.dnsStop = false;
- }
+ if (response.data.status.powerdns) {
+ $scope.dnsStatus = "Running";
+ $scope.dnsStats = true;
+ $scope.dnsStart = false;
+ $scope.dnsStop = true;
+ $scope.dnsMem = Math.round(parseInt(response.data.memUsage.powerdns) / 1048576) + " MB";
+ }
+ else {
+ $scope.dnsStatus = "Stopped";
+ $scope.dnsStats = false;
+ $scope.dnsStart = true;
+ $scope.dnsStop = false;
+ }
- // Update FTP stats
+ // Update FTP stats
- if (response.data.status.pureftp) {
- $scope.ftpStatus = "Running";
- $scope.ftpStats = true;
- $scope.ftpStart = false;
- $scope.ftpStop = true;
- $scope.ftpMem = Math.round(parseInt(response.data.memUsage.pureftp) / 1048576) + " MB";
- }
- else {
- $scope.ftpStatus = "Stopped";
- $scope.ftpStats = false;
- $scope.ftpStart = true;
- $scope.ftpStop = false;
- }
+ if (response.data.status.pureftp) {
+ $scope.ftpStatus = "Running";
+ $scope.ftpStats = true;
+ $scope.ftpStart = false;
+ $scope.ftpStop = true;
+ $scope.ftpMem = Math.round(parseInt(response.data.memUsage.pureftp) / 1048576) + " MB";
+ }
+ else {
+ $scope.ftpStatus = "Stopped";
+ $scope.ftpStats = false;
+ $scope.ftpStart = true;
+ $scope.ftpStop = false;
+ }
- $scope.services = true;
+ $scope.services = true;
- $scope.btnDisable = false;
+ $scope.btnDisable = false;
- }
- function cantLoadInitialDatas(response) {
- $scope.couldNotConnect = true;
+ }
- }
+ function cantLoadInitialDatas(response) {
+ $scope.couldNotConnect = true;
- };
- getServiceStatus();
+ }
- $scope.serviceAction = function(serviceName, action){
- $scope.ActionProgress = true;
- $scope.btnDisable = true;
- $scope.ActionSuccessfull = false;
- $scope.ActionFailed = false;
- $scope.couldNotConnect = false;
- $scope.actionLoader = true;
+ };
+ getServiceStatus();
- url = "/serverstatus/servicesAction";
+ $scope.serviceAction = function (serviceName, action) {
+ $scope.ActionProgress = true;
+ $scope.btnDisable = true;
+ $scope.ActionSuccessfull = false;
+ $scope.ActionFailed = false;
+ $scope.couldNotConnect = false;
+ $scope.actionLoader = true;
- var data = {
- service:serviceName,
- action:action
- };
+ url = "/serverstatus/servicesAction";
- var config = {
- headers : {
- 'X-CSRFToken': getCookie('csrftoken')
- }
- };
+ var data = {
+ service: serviceName,
+ action: action
+ };
- $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
- function ListInitialDatas(response) {
- console.log(response.data);
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
- if(response.data.serviceAction == 1){
- setTimeout(function() {
- getServiceStatus();
- $scope.ActionSuccessfull = true;
- $scope.ActionFailed = false;
- $scope.couldNotConnect = false;
- $scope.actionLoader = false;
- $scope.btnDisable = false;
- }, 3000);
- }
- else{
- setTimeout(function() {
- getServiceStatus();
- $scope.ActionSuccessfull = false;
- $scope.ActionFailed = true;
- $scope.couldNotConnect = false;
- $scope.actionLoader = false;
- $scope.btnDisable = false;
- }, 5000);
+ function ListInitialDatas(response) {
+ console.log(response.data);
- }
-
- }
- function cantLoadInitialDatas(response) {
- $scope.ActionSuccessfull = false;
+ if (response.data.serviceAction == 1) {
+ setTimeout(function () {
+ getServiceStatus();
+ $scope.ActionSuccessfull = true;
$scope.ActionFailed = false;
- $scope.couldNotConnect = true;
+ $scope.couldNotConnect = false;
$scope.actionLoader = false;
$scope.btnDisable = false;
- }
+ }, 3000);
+ }
+ else {
+ setTimeout(function () {
+ getServiceStatus();
+ $scope.ActionSuccessfull = false;
+ $scope.ActionFailed = true;
+ $scope.couldNotConnect = false;
+ $scope.actionLoader = false;
+ $scope.btnDisable = false;
+ }, 5000);
- }
+ }
+
+ }
+
+ function cantLoadInitialDatas(response) {
+ $scope.ActionSuccessfull = false;
+ $scope.ActionFailed = false;
+ $scope.couldNotConnect = true;
+ $scope.actionLoader = false;
+ $scope.btnDisable = false;
+ }
+
+ }
});
+
+app.controller('lswsSwitch', function ($scope, $http, $timeout, $window) {
+
+
+ $scope.cyberPanelLoading = true;
+ $scope.installBoxGen = true;
+
+ $scope.switchTOLSWS = function () {
+
+ $scope.cyberPanelLoading = false;
+ $scope.installBoxGen = true;
+
+ url = "/serverstatus/switchTOLSWS";
+
+ var data = {
+ licenseKey: $scope.licenseKey
+ };
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+ $scope.cyberPanelLoading = true;
+ if (response.data.status === 1) {
+ $scope.installBoxGen = false;
+ getRequestStatus();
+ }
+ else {
+ new PNotify({
+ title: 'Operation Failed!',
+ text: response.data.error_message,
+ type: 'error'
+ });
+ }
+
+ }
+
+ function cantLoadInitialDatas(response) {
+ $scope.cyberPanelLoading = true;
+ new PNotify({
+ title: 'Operation Failed!',
+ text: 'Could not connect to server, please refresh this page',
+ type: 'error'
+ });
+ }
+
+ };
+
+ function getRequestStatus() {
+ $scope.cyberPanelLoading = false;
+
+ url = "/serverstatus/switchTOLSWSStatus";
+
+ var data = {};
+
+ var config = {
+ headers: {
+ 'X-CSRFToken': getCookie('csrftoken')
+ }
+ };
+
+
+ $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
+
+
+ function ListInitialDatas(response) {
+ if (response.data.abort === 0) {
+ $scope.requestData = response.data.requestStatus;
+ $timeout(getRequestStatus, 1000);
+ }
+ else {
+ // Notifications
+ $scope.cyberPanelLoading = true;
+ $timeout.cancel();
+ $scope.requestData = response.data.requestStatus;
+ if (response.data.installed === 1) {
+ $timeout(function () {
+ $window.location.reload();
+ }, 3000);
+ }
+
+ }
+ }
+
+ function cantLoadInitialDatas(response) {
+ $scope.cyberPanelLoading = true;
+ new PNotify({
+ title: 'Operation Failed!',
+ text: 'Could not connect to server, please refresh this page',
+ type: 'error'
+ });
+
+
+ }
+
+ }
+
+});
\ No newline at end of file