Skip to content

Commit d165e1d

Browse files
committed
bug fix: install process
1 parent 9a78d85 commit d165e1d

3 files changed

Lines changed: 15 additions & 13 deletions

File tree

install/install.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,19 +1025,21 @@ def download_install_CyberPanel(self, mysqlPassword, mysql):
10251025

10261026
logging.InstallLog.writeToFile("settings.py updated!")
10271027

1028+
self.setupVirtualEnv(self.distro)
1029+
10281030
### Applying migrations
10291031

10301032

10311033
os.chdir("CyberCP")
10321034

1033-
command = "python manage.py makemigrations"
1035+
command = "/usr/local/CyberCP/bin/python2 manage.py makemigrations"
10341036
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
10351037
'CyberPanel Make Migrations',
10361038
1, 1, os.EX_OSERR)
10371039

10381040
##
10391041

1040-
command = "python manage.py migrate"
1042+
command = "/usr/local/CyberCP/bin/python2 manage.py migrate"
10411043
preFlightsChecks.call(command, self.distro, '[download_install_CyberPanel]',
10421044
'CyberPanel Migrate',1, 1, os.EX_OSERR)
10431045

@@ -3847,7 +3849,6 @@ def main():
38473849
checks.configureOpenDKIM()
38483850

38493851
checks.modSecPreReqs()
3850-
checks.setupVirtualEnv(distro)
38513852
checks.installLSCPD()
38523853
checks.setupLSCPDDaemon()
38533854
checks.fixCyberPanelPermissions()

serverStatus/serverStatusUtil.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,9 @@ def recover():
145145
if os.path.exists('/usr/local/lsws'):
146146
shutil.rmtree('/usr/local/lsws')
147147

148-
command = 'tar -zxvf /usr/local/olsBackup.tar.gz -C /usr/local/'
148+
command = 'mv /usr/local/lsws.bak /usr/local/lsws'
149149
ServerStatusUtil.executioner(command, FNULL)
150150

151-
command = 'mv /usr/local/usr/local/lsws /usr/local'
152-
ServerStatusUtil.executioner(command, FNULL)
153-
154-
if os.path.exists('/usr/local/usr'):
155-
shutil.rmtree('/usr/local/usr')
156-
157151
@staticmethod
158152
def createWebsite(website):
159153
try:
@@ -285,9 +279,16 @@ def switchTOLSWS(licenseKey):
285279
ProcessUtilities.killLiteSpeed()
286280

287281
if os.path.exists('/usr/local/lsws'):
288-
command = 'tar -zcvf /usr/local/olsBackup.tar.gz /usr/local/lsws'
282+
command = 'mkdir /usr/local/lsws.bak'
283+
if ServerStatusUtil.executioner(command, FNULL) == 0:
284+
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to create backup of current LSWS. [mkdir] [404]", 1)
285+
ServerStatusUtil.recover()
286+
return 0
287+
288+
command = 'cp -R /usr/local/lsws/* /usr/local/lsws.bak/'
289289
if ServerStatusUtil.executioner(command, FNULL) == 0:
290-
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Failed to create backup of current LSWS. [404]", 1)
290+
logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath,
291+
"Failed to create backup of current LSWS. [cp][404]", 1)
291292
ServerStatusUtil.recover()
292293
return 0
293294

serverStatus/templates/serverStatus/litespeedStatus.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ <h3 class="content-box-header">
146146
<form action="/" class="form-horizontal bordered-row">
147147

148148
<div class="form-group">
149-
<label class="col-sm-3 control-label">{% trans "License Key" %}</label>
149+
<label class="col-sm-3 control-label">{% trans "LiteSpeed Serial No. (License Key)" %}</label>
150150
<div class="col-sm-6">
151151
<input type="text" class="form-control" ng-model="licenseKey"
152152
required>

0 commit comments

Comments
 (0)