mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
apache manager
This commit is contained in:
@@ -293,12 +293,11 @@ LoadModule mpm_event_module modules/mod_mpm_event.so
|
|||||||
if ProcessUtilities.executioner(command, None, True) == 0:
|
if ProcessUtilities.executioner(command, None, True) == 0:
|
||||||
return "Failed to ppa:ondrej/php"
|
return "Failed to ppa:ondrej/php"
|
||||||
|
|
||||||
command = "sudo apt-get install -y php-fpm php7.4-fpm php8.0-fpm php7.4-mysql php7.4-curl php7.4-gd php7.4-mbstring php7.4-xml php7.4-zip php8.0-mysql php8.0-curl php8.0-gd php8.0-mbstring php8.0-xml php8.0-zip"
|
command = "DEBIAN_FRONTEND=noninteractive apt-get install -y php-fpm php?.?-fpm php?.?-fpm php?.?-mysql php?.?-curl php?.?-gd php?.?-mbstring php?.?-xml php?.?-zip"
|
||||||
|
|
||||||
if ProcessUtilities.executioner(command, None, True) == 0:
|
if ProcessUtilities.executioner(command, None, True) == 0:
|
||||||
return "Failed to install Apache and PHP-FPM."
|
return "Failed to install Apache and PHP-FPM."
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
wwwConfPath = ApacheVhost.php54Path + "/www.conf"
|
wwwConfPath = ApacheVhost.php54Path + "/www.conf"
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ class ApacheVhost:
|
|||||||
php72Path = '/etc/opt/remi/php72/php-fpm.d/'
|
php72Path = '/etc/opt/remi/php72/php-fpm.d/'
|
||||||
php73Path = '/etc/opt/remi/php73/php-fpm.d/'
|
php73Path = '/etc/opt/remi/php73/php-fpm.d/'
|
||||||
|
|
||||||
|
serviceName = 'httpd'
|
||||||
|
|
||||||
else:
|
else:
|
||||||
serverRootPath = '/etc/apache2'
|
serverRootPath = '/etc/apache2'
|
||||||
configBasePath = '/etc/apache2/sites-enabled/'
|
configBasePath = '/etc/apache2/sites-enabled/'
|
||||||
@@ -46,6 +48,8 @@ class ApacheVhost:
|
|||||||
php81Path = '/etc/php/8.1/fpm/pool.d/'
|
php81Path = '/etc/php/8.1/fpm/pool.d/'
|
||||||
php82Path = '/etc/php/8.2/fpm/pool.d/'
|
php82Path = '/etc/php/8.2/fpm/pool.d/'
|
||||||
|
|
||||||
|
serviceName = 'apache2'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lswsMainConf = "/usr/local/lsws/conf/httpd_config.conf"
|
lswsMainConf = "/usr/local/lsws/conf/httpd_config.conf"
|
||||||
@@ -139,8 +143,10 @@ class ApacheVhost:
|
|||||||
|
|
||||||
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
sockPath = '/var/run/php-fpm/'
|
sockPath = '/var/run/php-fpm/'
|
||||||
|
group = 'nobody'
|
||||||
else:
|
else:
|
||||||
sockPath = '/var/run/php/'
|
sockPath = '/var/run/php/'
|
||||||
|
group = 'nogroup'
|
||||||
|
|
||||||
## Non-SSL Conf
|
## Non-SSL Conf
|
||||||
|
|
||||||
@@ -191,12 +197,13 @@ class ApacheVhost:
|
|||||||
currentConf = currentConf.replace('{Sock}', virtualHostName)
|
currentConf = currentConf.replace('{Sock}', virtualHostName)
|
||||||
currentConf = currentConf.replace('{externalApp}', externalApp)
|
currentConf = currentConf.replace('{externalApp}', externalApp)
|
||||||
currentConf = currentConf.replace('{sockPath}', sockPath)
|
currentConf = currentConf.replace('{sockPath}', sockPath)
|
||||||
|
currentConf = currentConf.replace('{group}', group)
|
||||||
|
|
||||||
confFile.write(currentConf)
|
confFile.write(currentConf)
|
||||||
|
|
||||||
ApacheVhost.GenerateSelfSignedSSL(virtualHostName)
|
ApacheVhost.GenerateSelfSignedSSL(virtualHostName)
|
||||||
|
|
||||||
command = "systemctl restart httpd"
|
command = f"systemctl restart {ApacheVhost.serviceName}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
return [1, 'None']
|
return [1, 'None']
|
||||||
@@ -262,8 +269,10 @@ class ApacheVhost:
|
|||||||
|
|
||||||
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
sockPath = '/var/run/php-fpm/'
|
sockPath = '/var/run/php-fpm/'
|
||||||
|
group = 'nobody'
|
||||||
else:
|
else:
|
||||||
sockPath = '/var/run/php/'
|
sockPath = '/var/run/php/'
|
||||||
|
group = 'nogroup'
|
||||||
|
|
||||||
finalConfPath = ApacheVhost.configBasePath + virtualHostName + '.conf'
|
finalConfPath = ApacheVhost.configBasePath + virtualHostName + '.conf'
|
||||||
confFile = open(finalConfPath, "w+")
|
confFile = open(finalConfPath, "w+")
|
||||||
@@ -312,12 +321,13 @@ class ApacheVhost:
|
|||||||
currentConf = currentConf.replace('{Sock}', virtualHostName)
|
currentConf = currentConf.replace('{Sock}', virtualHostName)
|
||||||
currentConf = currentConf.replace('{externalApp}', externalApp)
|
currentConf = currentConf.replace('{externalApp}', externalApp)
|
||||||
currentConf = currentConf.replace('{sockPath}', sockPath)
|
currentConf = currentConf.replace('{sockPath}', sockPath)
|
||||||
|
currentConf = currentConf.replace('{group}', group)
|
||||||
|
|
||||||
confFile.write(currentConf)
|
confFile.write(currentConf)
|
||||||
|
|
||||||
ApacheVhost.GenerateSelfSignedSSL(virtualHostName)
|
ApacheVhost.GenerateSelfSignedSSL(virtualHostName)
|
||||||
|
|
||||||
command = "systemctl restart httpd"
|
command = f"systemctl restart {ApacheVhost.serviceName}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
return [1, 'None']
|
return [1, 'None']
|
||||||
@@ -326,6 +336,7 @@ class ApacheVhost:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def setupApacheVhostChild(administratorEmail, externalApp, virtualHostUser, phpVersion, virtualHostName, path):
|
def setupApacheVhostChild(administratorEmail, externalApp, virtualHostUser, phpVersion, virtualHostName, path):
|
||||||
|
|
||||||
result = ApacheVhost.perHostVirtualConfChild(administratorEmail, externalApp, virtualHostUser, phpVersion,
|
result = ApacheVhost.perHostVirtualConfChild(administratorEmail, externalApp, virtualHostUser, phpVersion,
|
||||||
virtualHostName, path)
|
virtualHostName, path)
|
||||||
if result[0] == 0:
|
if result[0] == 0:
|
||||||
@@ -347,7 +358,7 @@ class ApacheVhost:
|
|||||||
|
|
||||||
ApacheVhost.deletePHPPath(virtualHostName)
|
ApacheVhost.deletePHPPath(virtualHostName)
|
||||||
|
|
||||||
command = "systemctl restart httpd"
|
command = f"systemctl restart {ApacheVhost.serviceName}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
@@ -375,59 +386,154 @@ class ApacheVhost:
|
|||||||
phpPath = ApacheVhost.DecidePHPPath('54', virtualHostName)
|
phpPath = ApacheVhost.DecidePHPPath('54', virtualHostName)
|
||||||
if os.path.exists(phpPath):
|
if os.path.exists(phpPath):
|
||||||
os.remove(phpPath)
|
os.remove(phpPath)
|
||||||
command = "systemctl restart php%s-php-fpm" % ('54')
|
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php54-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"php5.4-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
phpPath = ApacheVhost.DecidePHPPath('55', virtualHostName)
|
phpPath = ApacheVhost.DecidePHPPath('55', virtualHostName)
|
||||||
if os.path.exists(phpPath):
|
if os.path.exists(phpPath):
|
||||||
|
|
||||||
os.remove(phpPath)
|
os.remove(phpPath)
|
||||||
command = "systemctl restart php%s-php-fpm" % ('55')
|
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php55-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"php5.5-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
phpPath = ApacheVhost.DecidePHPPath('56', virtualHostName)
|
phpPath = ApacheVhost.DecidePHPPath('56', virtualHostName)
|
||||||
if os.path.exists(phpPath):
|
if os.path.exists(phpPath):
|
||||||
os.remove(phpPath)
|
os.remove(phpPath)
|
||||||
command = "systemctl restart php%s-php-fpm" % ('56')
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php56-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"php5.6-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
phpPath = ApacheVhost.DecidePHPPath('70', virtualHostName)
|
phpPath = ApacheVhost.DecidePHPPath('70', virtualHostName)
|
||||||
if os.path.exists(phpPath):
|
if os.path.exists(phpPath):
|
||||||
os.remove(phpPath)
|
os.remove(phpPath)
|
||||||
command = "systemctl restart php%s-php-fpm" % ('70')
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php70-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"php7.0-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
phpPath = ApacheVhost.DecidePHPPath('71', virtualHostName)
|
phpPath = ApacheVhost.DecidePHPPath('71', virtualHostName)
|
||||||
if os.path.exists(phpPath):
|
if os.path.exists(phpPath):
|
||||||
os.remove(phpPath)
|
os.remove(phpPath)
|
||||||
command = "systemctl restart php%s-php-fpm" % ('71')
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php71-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"php7.1-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
phpPath = ApacheVhost.DecidePHPPath('72', virtualHostName)
|
phpPath = ApacheVhost.DecidePHPPath('72', virtualHostName)
|
||||||
if os.path.exists(phpPath):
|
if os.path.exists(phpPath):
|
||||||
os.remove(phpPath)
|
os.remove(phpPath)
|
||||||
command = "systemctl restart php%s-php-fpm" % ('72')
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php72-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"php7.2-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
phpPath = ApacheVhost.DecidePHPPath('73', virtualHostName)
|
phpPath = ApacheVhost.DecidePHPPath('73', virtualHostName)
|
||||||
if os.path.exists(phpPath):
|
if os.path.exists(phpPath):
|
||||||
os.remove(phpPath)
|
os.remove(phpPath)
|
||||||
command = "systemctl restart php%s-php-fpm" % ('73')
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php73-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"php7.3-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
phpPath = ApacheVhost.DecidePHPPath('74', virtualHostName)
|
||||||
|
if os.path.exists(phpPath):
|
||||||
|
os.remove(phpPath)
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php74-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"php7.4-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
phpPath = ApacheVhost.DecidePHPPath('80', virtualHostName)
|
||||||
|
if os.path.exists(phpPath):
|
||||||
|
os.remove(phpPath)
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php80-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"php8.0-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
phpPath = ApacheVhost.DecidePHPPath('81', virtualHostName)
|
||||||
|
if os.path.exists(phpPath):
|
||||||
|
os.remove(phpPath)
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php81-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"php8.1-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
phpPath = ApacheVhost.DecidePHPPath('82', virtualHostName)
|
||||||
|
if os.path.exists(phpPath):
|
||||||
|
os.remove(phpPath)
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php82-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"php8.2-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def changePHP(phpVersion, vhFile):
|
def changePHP(phpVersion, vhFile):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
sockPath = '/var/run/php-fpm/'
|
||||||
|
group = 'nobody'
|
||||||
|
else:
|
||||||
|
sockPath = '/var/run/php/'
|
||||||
|
group = 'nogroup'
|
||||||
|
|
||||||
virtualHostName = vhFile.split('/')[6]
|
virtualHostName = vhFile.split('/')[6]
|
||||||
|
|
||||||
finalConfPath = ApacheVhost.configBasePath + virtualHostName + '.conf'
|
finalConfPath = ApacheVhost.configBasePath + virtualHostName + '.conf'
|
||||||
|
|
||||||
if not os.path.exists(finalConfPath):
|
if not os.path.exists(finalConfPath):
|
||||||
|
logging.writeToFile(f'Config path: {finalConfPath}')
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
ApacheVhost.deletePHPPath(virtualHostName)
|
ApacheVhost.deletePHPPath(virtualHostName)
|
||||||
|
|
||||||
|
try:
|
||||||
website = Websites.objects.get(domain=virtualHostName)
|
website = Websites.objects.get(domain=virtualHostName)
|
||||||
|
externalApp = website.externalApp
|
||||||
|
except:
|
||||||
|
child = ChildDomains.objects.get(domain=virtualHostName)
|
||||||
|
externalApp = child.master.externalApp
|
||||||
|
|
||||||
php = PHPManager.getPHPString(phpVersion)
|
php = PHPManager.getPHPString(phpVersion)
|
||||||
|
|
||||||
@@ -435,16 +541,26 @@ class ApacheVhost:
|
|||||||
|
|
||||||
confFile = open(finalConfPath, "w+")
|
confFile = open(finalConfPath, "w+")
|
||||||
currentConf = vhostConfs.phpFpmPool
|
currentConf = vhostConfs.phpFpmPool
|
||||||
currentConf = currentConf.replace('{www}', website.externalApp)
|
currentConf = currentConf.replace('{www}', externalApp)
|
||||||
currentConf = currentConf.replace('{Sock}', virtualHostName)
|
currentConf = currentConf.replace('{Sock}', virtualHostName)
|
||||||
currentConf = currentConf.replace('{externalApp}', website.externalApp)
|
currentConf = currentConf.replace('{externalApp}', externalApp)
|
||||||
|
currentConf = currentConf.replace('{sockPath}', sockPath)
|
||||||
|
currentConf = currentConf.replace('{group}', group)
|
||||||
|
|
||||||
confFile.write(currentConf)
|
confFile.write(currentConf)
|
||||||
|
|
||||||
command = "systemctl stop php%s-php-fpm" % (php)
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php{php}-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"{phpVersion.replace(' ', '').lower()}-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl stop {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
command = "systemctl restart php%s-php-fpm" % (php)
|
command = f"systemctl restart {phpService}"
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
command = f"systemctl restart {ApacheVhost.serviceName}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|||||||
@@ -618,8 +618,17 @@ class vhost:
|
|||||||
def changePHP(vhFile, phpVersion):
|
def changePHP(vhFile, phpVersion):
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
HomePath = Path("/home/%s" % (vhFile.split('/')[-2]))
|
domain = vhFile.split('/')[6]
|
||||||
virtualHostUser = HomePath.owner()
|
print(domain)
|
||||||
|
try:
|
||||||
|
website = Websites.objects.get(domain=domain)
|
||||||
|
externalApp = website.externalApp
|
||||||
|
except:
|
||||||
|
child = ChildDomains.objects.get(domain=domain)
|
||||||
|
externalApp = child.master.externalApp
|
||||||
|
#HomePath = website.externalApp
|
||||||
|
virtualHostUser = externalApp
|
||||||
|
|
||||||
phpDetachUpdatePath = '/home/%s/.lsphp_restart.txt' % (vhFile.split('/')[-2])
|
phpDetachUpdatePath = '/home/%s/.lsphp_restart.txt' % (vhFile.split('/')[-2])
|
||||||
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
if ProcessUtilities.decideServer() == ProcessUtilities.OLS:
|
||||||
try:
|
try:
|
||||||
@@ -657,7 +666,13 @@ class vhost:
|
|||||||
logging.CyberCPLogFileWriter.writeToFile('apache vhost 1')
|
logging.CyberCPLogFileWriter.writeToFile('apache vhost 1')
|
||||||
|
|
||||||
php = PHPManager.getPHPString(phpVersion)
|
php = PHPManager.getPHPString(phpVersion)
|
||||||
command = "systemctl restart php%s-php-fpm" % (php)
|
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php{php}-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"{phpVersion.replace(' ', '').lower()}-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
print("1,None")
|
print("1,None")
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ REWRITERULE ^(.*)$ HTTP://proxyApacheBackendSSL/$1 [P,L]
|
|||||||
phpFpmPool = """[{www}]
|
phpFpmPool = """[{www}]
|
||||||
listen = {sockPath}{Sock}.sock
|
listen = {sockPath}{Sock}.sock
|
||||||
listen.owner = nobody
|
listen.owner = nobody
|
||||||
listen.group = nobody
|
listen.group = {group}
|
||||||
listen.mode = 0660
|
listen.mode = 0660
|
||||||
user = {externalApp}
|
user = {externalApp}
|
||||||
group = {externalApp}
|
group = {externalApp}
|
||||||
@@ -398,7 +398,7 @@ pm.max_spare_servers = 1
|
|||||||
phpFpmPoolReplace = """[{www}]
|
phpFpmPoolReplace = """[{www}]
|
||||||
listen = {sockPath}{Sock}.sock
|
listen = {sockPath}{Sock}.sock
|
||||||
listen.owner = nobody
|
listen.owner = nobody
|
||||||
listen.group = nobody
|
listen.group = {group}
|
||||||
listen.mode = 0660
|
listen.mode = 0660
|
||||||
user = {externalApp}
|
user = {externalApp}
|
||||||
group = {externalApp}
|
group = {externalApp}
|
||||||
|
|||||||
@@ -244,7 +244,13 @@ class virtualHostUtilities:
|
|||||||
ApacheVhost.perHostVirtualConfOLS(completePathToConfigFile, administratorEmail)
|
ApacheVhost.perHostVirtualConfOLS(completePathToConfigFile, administratorEmail)
|
||||||
installUtilities.installUtilities.reStartLiteSpeed()
|
installUtilities.installUtilities.reStartLiteSpeed()
|
||||||
php = PHPManager.getPHPString(phpVersion)
|
php = PHPManager.getPHPString(phpVersion)
|
||||||
command = "systemctl restart php%s-php-fpm" % (php)
|
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php{php}-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"{phpVersion.replace(' ', '').lower()}-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
## Create Configurations ends here
|
## Create Configurations ends here
|
||||||
@@ -437,6 +443,29 @@ class virtualHostUtilities:
|
|||||||
str(msg) + " [saveVHostConfigs]")
|
str(msg) + " [saveVHostConfigs]")
|
||||||
print("0," + str(msg))
|
print("0," + str(msg))
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def saveApacheConfigsToFile(fileName, tempPath):
|
||||||
|
try:
|
||||||
|
|
||||||
|
vhost = open(fileName, "w")
|
||||||
|
|
||||||
|
vhost.write(open(tempPath, "r").read())
|
||||||
|
|
||||||
|
vhost.close()
|
||||||
|
|
||||||
|
if os.path.exists(tempPath):
|
||||||
|
os.remove(tempPath)
|
||||||
|
|
||||||
|
command = f"systemctl restart {ApacheVhost.serviceName}"
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
print("1,None")
|
||||||
|
|
||||||
|
except BaseException as msg:
|
||||||
|
logging.CyberCPLogFileWriter.writeToFile(
|
||||||
|
str(msg) + " [saveApacheConfigsToFile]")
|
||||||
|
print("0," + str(msg))
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def saveRewriteRules(virtualHost, fileName, tempPath):
|
def saveRewriteRules(virtualHost, fileName, tempPath):
|
||||||
try:
|
try:
|
||||||
@@ -1094,7 +1123,13 @@ class virtualHostUtilities:
|
|||||||
ApacheVhost.perHostVirtualConfOLS(completePathToConfigFile, master.adminEmail)
|
ApacheVhost.perHostVirtualConfOLS(completePathToConfigFile, master.adminEmail)
|
||||||
installUtilities.installUtilities.reStartLiteSpeed()
|
installUtilities.installUtilities.reStartLiteSpeed()
|
||||||
php = PHPManager.getPHPString(phpVersion)
|
php = PHPManager.getPHPString(phpVersion)
|
||||||
command = "systemctl restart php%s-php-fpm" % (php)
|
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php{php}-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"{phpVersion.replace(' ', '').lower()}-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
## DKIM Check
|
## DKIM Check
|
||||||
@@ -1183,8 +1218,25 @@ class virtualHostUtilities:
|
|||||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, 'Restarting servers and phps..,90')
|
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, 'Restarting servers and phps..,90')
|
||||||
|
|
||||||
php = PHPManager.getPHPString(phpVersion)
|
php = PHPManager.getPHPString(phpVersion)
|
||||||
command = "systemctl restart php%s-php-fpm" % (php)
|
|
||||||
|
##
|
||||||
|
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpService = f'php{php}-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"{phpVersion.replace(' ', '').lower()}-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl stop {phpService}"
|
||||||
ProcessUtilities.normalExecutioner(command)
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
command = f"systemctl restart {ApacheVhost.serviceName}"
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
installUtilities.installUtilities.reStartLiteSpeed()
|
installUtilities.installUtilities.reStartLiteSpeed()
|
||||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, 'Successfully converted.[200]')
|
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, 'Successfully converted.[200]')
|
||||||
else:
|
else:
|
||||||
@@ -1561,6 +1613,8 @@ def main():
|
|||||||
virtualHostUtilities.getErrorLogs(args.path, int(args.page))
|
virtualHostUtilities.getErrorLogs(args.path, int(args.page))
|
||||||
elif args.function == "saveVHostConfigs":
|
elif args.function == "saveVHostConfigs":
|
||||||
virtualHostUtilities.saveVHostConfigs(args.path, args.tempPath)
|
virtualHostUtilities.saveVHostConfigs(args.path, args.tempPath)
|
||||||
|
elif args.function == "saveApacheConfigsToFile":
|
||||||
|
virtualHostUtilities.saveApacheConfigsToFile(args.path, args.tempPath)
|
||||||
elif args.function == "saveRewriteRules":
|
elif args.function == "saveRewriteRules":
|
||||||
virtualHostUtilities.saveRewriteRules(args.virtualHostName, args.path, args.tempPath)
|
virtualHostUtilities.saveRewriteRules(args.virtualHostName, args.path, args.tempPath)
|
||||||
elif args.function == "saveSSL":
|
elif args.function == "saveSSL":
|
||||||
|
|||||||
@@ -4518,7 +4518,7 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
|||||||
$scope.currentStatus = "Starting creation..";
|
$scope.currentStatus = "Starting creation..";
|
||||||
$scope.DomainCreateForm = true;
|
$scope.DomainCreateForm = true;
|
||||||
|
|
||||||
var ssl, dkimCheck, openBasedir;
|
var ssl, dkimCheck, openBasedir, apacheBackend;
|
||||||
|
|
||||||
if ($scope.sslCheck === true) {
|
if ($scope.sslCheck === true) {
|
||||||
ssl = 1;
|
ssl = 1;
|
||||||
@@ -4539,6 +4539,13 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($scope.apacheBackend === true) {
|
||||||
|
apacheBackend = 1;
|
||||||
|
} else {
|
||||||
|
apacheBackend = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
url = "/websites/submitDomainCreation";
|
url = "/websites/submitDomainCreation";
|
||||||
var domainName = $scope.domainNameCreate;
|
var domainName = $scope.domainNameCreate;
|
||||||
var phpSelection = $scope.phpSelection;
|
var phpSelection = $scope.phpSelection;
|
||||||
@@ -4567,7 +4574,8 @@ app.controller('websitePages', function ($scope, $http, $timeout, $window) {
|
|||||||
path: path,
|
path: path,
|
||||||
masterDomain: $scope.masterDomain,
|
masterDomain: $scope.masterDomain,
|
||||||
dkimCheck: dkimCheck,
|
dkimCheck: dkimCheck,
|
||||||
openBasedir: openBasedir
|
openBasedir: openBasedir,
|
||||||
|
apacheBackend: apacheBackend
|
||||||
};
|
};
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
@@ -9694,3 +9702,284 @@ app.controller('manageGIT', function ($scope, $http, $timeout, $window) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
/* Java script code to git tracking ends here */
|
/* Java script code to git tracking ends here */
|
||||||
|
|
||||||
|
|
||||||
|
app.controller('ApacheManager', function ($scope, $http, $timeout) {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
$scope.apacheOLS = true;
|
||||||
|
$scope.pureOLS = true;
|
||||||
|
$scope.lswsEnt = true;
|
||||||
|
|
||||||
|
var apache = 1, ols = 2, lsws = 3;
|
||||||
|
var statusFile;
|
||||||
|
|
||||||
|
$scope.getSwitchStatus = function () {
|
||||||
|
$scope.cyberpanelloading = false;
|
||||||
|
url = "/websites/getSwitchStatus";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
domainName: $("#domainNamePage").text()
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialData(response) {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
if (response.data.server === apache) {
|
||||||
|
$scope.apacheOLS = false;
|
||||||
|
$scope.pureOLS = true;
|
||||||
|
$scope.lswsEnt = true;
|
||||||
|
$scope.configData = response.data.configData;
|
||||||
|
|
||||||
|
$scope.pmMaxChildren = response.data.pmMaxChildren;
|
||||||
|
$scope.pmStartServers = response.data.pmStartServers;
|
||||||
|
$scope.pmMinSpareServers = response.data.pmMinSpareServers;
|
||||||
|
$scope.pmMaxSpareServers = response.data.pmMaxSpareServers;
|
||||||
|
$scope.phpPath = response.data.phpPath;
|
||||||
|
|
||||||
|
|
||||||
|
} else if (response.data.server === ols) {
|
||||||
|
$scope.apacheOLS = true;
|
||||||
|
$scope.pureOLS = false;
|
||||||
|
$scope.lswsEnt = true;
|
||||||
|
} else {
|
||||||
|
$scope.apacheOLS = true;
|
||||||
|
$scope.pureOLS = true;
|
||||||
|
$scope.lswsEnt = false;
|
||||||
|
}
|
||||||
|
//$scope.records = JSON.parse(response.data.data);
|
||||||
|
} else {
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialData(response) {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: 'Could not connect to server, please refresh this page.',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
$scope.getSwitchStatus();
|
||||||
|
|
||||||
|
$scope.switchServer = function (server) {
|
||||||
|
$scope.cyberpanelloading = false;
|
||||||
|
$scope.functionProgress = {"width": "0%"};
|
||||||
|
$scope.functionStatus = 'Starting conversion..';
|
||||||
|
|
||||||
|
url = "/websites/switchServer";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
domainName: $("#domainNamePage").text(),
|
||||||
|
phpSelection: $scope.phpSelection,
|
||||||
|
server: server
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
|
||||||
|
|
||||||
|
function ListInitialData(response) {
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
statusFile = response.data.tempStatusPath;
|
||||||
|
statusFunc();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialData(response) {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: 'Could not connect to server, please refresh this page.',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
function statusFunc() {
|
||||||
|
$scope.cyberpanelloading = false;
|
||||||
|
url = "/websites/statusFunc";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
statusFile: statusFile
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
|
||||||
|
|
||||||
|
|
||||||
|
function ListInitialData(response) {
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
if (response.data.abort === 1) {
|
||||||
|
$scope.functionProgress = {"width": "100%"};
|
||||||
|
$scope.functionStatus = response.data.currentStatus;
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
$timeout.cancel();
|
||||||
|
$scope.getSwitchStatus();
|
||||||
|
} else {
|
||||||
|
$scope.functionProgress = {"width": response.data.installationProgress + "%"};
|
||||||
|
$scope.functionStatus = response.data.currentStatus;
|
||||||
|
$timeout(statusFunc, 3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
$scope.functionStatus = response.data.error_message;
|
||||||
|
$scope.functionProgress = {"width": response.data.installationProgress + "%"};
|
||||||
|
$timeout.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialData(response) {
|
||||||
|
$scope.functionProgress = {"width": response.data.installationProgress + "%"};
|
||||||
|
$scope.functionStatus = 'Could not connect to server, please refresh this page.';
|
||||||
|
$timeout.cancel();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$scope.tuneSettings = function () {
|
||||||
|
$scope.cyberpanelloading = false;
|
||||||
|
|
||||||
|
url = "/websites/tuneSettings";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
domainName: $("#domainNamePage").text(),
|
||||||
|
pmMaxChildren: $scope.pmMaxChildren,
|
||||||
|
pmStartServers: $scope.pmStartServers,
|
||||||
|
pmMinSpareServers: $scope.pmMinSpareServers,
|
||||||
|
pmMaxSpareServers: $scope.pmMaxSpareServers,
|
||||||
|
phpPath: $scope.phpPath
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
|
||||||
|
|
||||||
|
function ListInitialData(response) {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
|
||||||
|
new PNotify({
|
||||||
|
title: 'Success',
|
||||||
|
text: 'Changes successfully applied.',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialData(response) {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: 'Could not connect to server, please refresh this page.',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.saveApacheConfig = function () {
|
||||||
|
$scope.cyberpanelloading = false;
|
||||||
|
|
||||||
|
url = "/websites/saveApacheConfigsToFile";
|
||||||
|
|
||||||
|
var data = {
|
||||||
|
domainName: $("#domainNamePage").text(),
|
||||||
|
configData: $scope.configData
|
||||||
|
};
|
||||||
|
|
||||||
|
var config = {
|
||||||
|
headers: {
|
||||||
|
'X-CSRFToken': getCookie('csrftoken')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
$http.post(url, data, config).then(ListInitialData, cantLoadInitialData);
|
||||||
|
|
||||||
|
function ListInitialData(response) {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
|
||||||
|
new PNotify({
|
||||||
|
title: 'Success',
|
||||||
|
text: 'Changes successfully applied.',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: response.data.error_message,
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function cantLoadInitialData(response) {
|
||||||
|
$scope.cyberpanelloading = true;
|
||||||
|
new PNotify({
|
||||||
|
title: 'Operation Failed!',
|
||||||
|
text: 'Could not connect to server, please refresh this page.',
|
||||||
|
type: 'error'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
});
|
||||||
218
websiteFunctions/templates/websiteFunctions/ApacheManager.html
Executable file
218
websiteFunctions/templates/websiteFunctions/ApacheManager.html
Executable file
@@ -0,0 +1,218 @@
|
|||||||
|
{% extends "baseTemplate/index.html" %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% block title %}{% trans "Apache Manager - CyberPanel" %}{% endblock %}
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% load static %}
|
||||||
|
{% get_current_language as LANGUAGE_CODE %}
|
||||||
|
<!-- Current language: {{ LANGUAGE_CODE }} -->
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div id="page-title">
|
||||||
|
<h2>{% trans "Apache Manager" %}</h2>
|
||||||
|
<p>{% trans "Switch between Apache (as reverse proxy) and OpenLiteSpeed." %}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div ng-controller="ApacheManager" class="panel">
|
||||||
|
<div class="panel-body">
|
||||||
|
<h3 class="title-hero">
|
||||||
|
<span id="domainNamePage">{{ domainName }}</span> <img ng-hide="cyberpanelloading"
|
||||||
|
src="{% static 'images/loading.gif' %}">
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
<div class="card card-body">
|
||||||
|
<h5 ng-hide="apacheOLS" class="card-title">{{ domainName }} is currently using Apache as Reverse
|
||||||
|
Proxy to
|
||||||
|
OpenLiteSpeed. <img
|
||||||
|
style="height: 25px" ng-hide="cyberpanelloading"
|
||||||
|
src="{% static 'images/loading.gif' %}"></h5>
|
||||||
|
<!-- Using Apache -->
|
||||||
|
<div ng-hide="apacheOLS" class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<label for="example-select">PHP</label>
|
||||||
|
<select ng-model="phpSelection" class="form-control" id="example-select">
|
||||||
|
{% for php in phps %}
|
||||||
|
<option>{{ php }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> <!-- end row -->
|
||||||
|
<a data-toggle="modal" data-target="#bs-example-modal-lg" ng-hide="apacheOLS"
|
||||||
|
ng-click="switchServer(2)" href="#" class="btn btn-primary">Switch to pure
|
||||||
|
OpenLiteSpeed.</a>
|
||||||
|
|
||||||
|
|
||||||
|
<div ng-hide="apacheOLS" class="col-md-12">
|
||||||
|
|
||||||
|
<form style="margin-top: 2%" class="form-horizontal bordered-row">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<h3 style="margin-bottom: 2%" ng-hide="apacheOLS">Apache Configurations</h3>
|
||||||
|
<div class="col-sm-12">
|
||||||
|
<textarea ng-model="configData" rows="20" class="form-control"></textarea>
|
||||||
|
</div>
|
||||||
|
<div ng-hide="saveConfigBtn" class="form-group">
|
||||||
|
<div style="margin: 2%" class="col-sm-4">
|
||||||
|
<button type="button" ng-click="saveApacheConfig()"
|
||||||
|
class="btn btn-primary btn-lg">{% trans "Save Apache Configurations" %}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<!-- Tune FPM -->
|
||||||
|
|
||||||
|
<div class="card card-body">
|
||||||
|
<h3 style="margin-bottom: 2%" ng-hide="apacheOLS">PHP-FPM Configurations <img
|
||||||
|
style="height: 25px" ng-hide="cyberpanelloading"
|
||||||
|
src="{% static 'images/loading.gif' %}"></h3>
|
||||||
|
<!-- Using Apache -->
|
||||||
|
<form ng-hide="apacheOLS">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="billing-town-city">pm.max_children</label>
|
||||||
|
<input class="form-control" type="text"
|
||||||
|
ng-model="pmMaxChildren"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="billing-town-city">pm.start_servers</label>
|
||||||
|
<input class="form-control" type="text"
|
||||||
|
ng-model="pmStartServers"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> <!-- end row -->
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="billing-town-city">pm.min_spare_servers</label>
|
||||||
|
<input class="form-control" type="text"
|
||||||
|
ng-model="pmMinSpareServers"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="billing-town-city">pm.max_spare_servers</label>
|
||||||
|
<input class="form-control" type="text"
|
||||||
|
ng-model="pmMaxSpareServers"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> <!-- end row -->
|
||||||
|
</form>
|
||||||
|
<a ng-hide="apacheOLS" ng-click="tuneSettings()"
|
||||||
|
href="#" class="btn btn-primary">Tune PHP-FPM Settings.</a>
|
||||||
|
<!-- Using OpenLiteSpeed -->
|
||||||
|
<p ng-hide="pureOLS" class="card-text">{{ domainName }} is currently using pure
|
||||||
|
OpenLiteSpeed, PHP-FPM
|
||||||
|
is
|
||||||
|
not used with OpenLiteSpeed, thus tuning is disabled.</p>
|
||||||
|
<!-- Using OpenLiteSpeed -->
|
||||||
|
<p ng-hide="lswsEnt" class="card-text">{{ domainName }} is using LiteSpeed Enterprise.
|
||||||
|
PHP-FPM is not
|
||||||
|
used
|
||||||
|
with LiteSpeed
|
||||||
|
Enterprise.</p>
|
||||||
|
</div> <!-- end card-->
|
||||||
|
|
||||||
|
<!-- Modal content for the above example -->
|
||||||
|
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog"
|
||||||
|
aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="myLargeModalLabel">{$ functionStatus $} <img
|
||||||
|
style="height: 25px"
|
||||||
|
ng-hide="cyberpanelloading"
|
||||||
|
src="{% static 'images/loading.gif' %}">
|
||||||
|
</h4>
|
||||||
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
|
aria-hidden="true">×
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="progress">
|
||||||
|
<div ng-style="functionProgress"
|
||||||
|
class="progress-bar progress-bar-striped bg-info"
|
||||||
|
role="progressbar"
|
||||||
|
aria-valuenow="50" aria-valuemin="0"
|
||||||
|
aria-valuemax="100"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.modal-content -->
|
||||||
|
</div><!-- /.modal-dialog -->
|
||||||
|
</div><!-- /.modal -->
|
||||||
|
|
||||||
|
<!-- Tune FPM End -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- Using OpenLiteSpeed -->
|
||||||
|
<p ng-hide="pureOLS" class="card-text">{{ domainName }} is currently using pure OpenLiteSpeed.</p>
|
||||||
|
<div ng-hide="pureOLS" class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<label for="example-select">PHP</label>
|
||||||
|
<select ng-model="phpSelection" class="form-control" id="example-select">
|
||||||
|
{% for php in phps %}
|
||||||
|
<option>{{ php }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> <!-- end row -->
|
||||||
|
<a data-toggle="modal" data-target="#bs-example-modal-lg" ng-hide="pureOLS"
|
||||||
|
ng-click="switchServer(1)" href="#" class="btn btn-primary">Switch to OpenLiteSpeed +
|
||||||
|
Apache
|
||||||
|
as reverse proxy.</a>
|
||||||
|
<!-- Using OpenLiteSpeed -->
|
||||||
|
<p ng-hide="lswsEnt" class="card-text">{{ domainName }} is using LiteSpeed Enterprise. When
|
||||||
|
LiteSpeed
|
||||||
|
Enterprise is active switching is not required.</p>
|
||||||
|
</div> <!-- end card-->
|
||||||
|
|
||||||
|
<!-- Modal content for the above example -->
|
||||||
|
<div class="modal fade" id="bs-example-modal-lg" tabindex="-1" role="dialog"
|
||||||
|
aria-labelledby="myLargeModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="myLargeModalLabel">{$ functionStatus $} <img
|
||||||
|
style="height: 25px"
|
||||||
|
ng-hide="cyberpanelloading"
|
||||||
|
src="{% static 'images/loading.gif' %}">
|
||||||
|
</h4>
|
||||||
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
|
aria-hidden="true">×
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="progress">
|
||||||
|
<div ng-style="functionProgress"
|
||||||
|
class="progress-bar progress-bar-striped bg-info"
|
||||||
|
role="progressbar"
|
||||||
|
aria-valuenow="50" aria-valuemin="0"
|
||||||
|
aria-valuemax="100"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.modal-content -->
|
||||||
|
</div><!-- /.modal-dialog -->
|
||||||
|
</div><!-- /.modal -->
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
@@ -264,6 +264,16 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<label class="col-sm-3 control-label"></label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<div class="checkbox">
|
||||||
|
<label>
|
||||||
|
<input ng-model="apacheBackend" type="checkbox" value="">
|
||||||
|
Apache as Backend
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<label class="col-sm-3 control-label"></label>
|
<label class="col-sm-3 control-label"></label>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
|
|||||||
@@ -26,13 +26,17 @@
|
|||||||
|
|
||||||
<h3 class="content-box-header">
|
<h3 class="content-box-header">
|
||||||
{% trans "Resource Usage" %}
|
{% trans "Resource Usage" %}
|
||||||
<a style="float: right; margin-left: 2%" class="btn btn-border btn-alt border-orange btn-link font-orange" href="/websites/{{ childDomain }}/manageGIT" title="Manage Git"><span>{% trans "Manage Git" %}</span></a>
|
<a style="float: right; margin-left: 2%"
|
||||||
|
class="btn btn-border btn-alt border-orange btn-link font-orange"
|
||||||
|
href="/websites/{{ childDomain }}/manageGIT"
|
||||||
|
title="Manage Git"><span>{% trans "Manage Git" %}</span></a>
|
||||||
<a style="float: right; margin-left: 2%"
|
<a style="float: right; margin-left: 2%"
|
||||||
class="btn btn-border btn-alt border-azure btn-link font-azure"
|
class="btn btn-border btn-alt border-azure btn-link font-azure"
|
||||||
href="/websites/{{ domain }}/{{ childDomain }}/syncToMaster"
|
href="/websites/{{ domain }}/{{ childDomain }}/syncToMaster"
|
||||||
title=""><span>{% trans "Copy/Sync to Master" %}</span></a>
|
title=""><span>{% trans "Copy/Sync to Master" %}</span></a>
|
||||||
<a style="float: right" class="btn btn-border btn-alt border-black btn-link font-black"
|
<a style="float: right" class="btn btn-border btn-alt border-black btn-link font-black"
|
||||||
href="https://go.cyberpanel.net/StessTest" title=""><span>{% trans "Stress Test" %}</span></a>
|
href="https://go.cyberpanel.net/StessTest"
|
||||||
|
title=""><span>{% trans "Stress Test" %}</span></a>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
<div class="">
|
<div class="">
|
||||||
@@ -277,6 +281,17 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3 panel-body">
|
||||||
|
<a href="{% url 'ApacheManager' domain=domain %}"
|
||||||
|
title="{% trans 'Apache Manager' %}">
|
||||||
|
<img src="{% static 'images/icons/file.png' %}" width="65" class="mr-10">
|
||||||
|
</a>
|
||||||
|
<a href="{% url 'ApacheManager' domain=childDomain %}"
|
||||||
|
title="{% trans 'Apache Manager' %}">
|
||||||
|
<span class="h4">{% trans "Apache Manager" %}</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3 panel-body">
|
<div class="col-md-3 panel-body">
|
||||||
|
|
||||||
<a ng-click="fetchRewriteFules()" href=""
|
<a ng-click="fetchRewriteFules()" href=""
|
||||||
@@ -690,17 +705,17 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{# <div class="col-md-3 panel-body">#}
|
{# <div class="col-md-3 panel-body">#}
|
||||||
{##}
|
{##}
|
||||||
{# <a href="{$ joomlaInstallURL $}" target="_blank"#}
|
{# <a href="{$ joomlaInstallURL $}" target="_blank"#}
|
||||||
{# title="{% trans 'Install Joomla with LSCache' %}">#}
|
{# title="{% trans 'Install Joomla with LSCache' %}">#}
|
||||||
{# <img src="{% static 'images/icons/joomla-logo.png' %}" width="65" class="mr-10">#}
|
{# <img src="{% static 'images/icons/joomla-logo.png' %}" width="65" class="mr-10">#}
|
||||||
{# </a>#}
|
{# </a>#}
|
||||||
{# <a href="{$ joomlaInstallURL $}" target="_blank"#}
|
{# <a href="{$ joomlaInstallURL $}" target="_blank"#}
|
||||||
{# title="{% trans 'Install Joomla with LSCache' %}">#}
|
{# title="{% trans 'Install Joomla with LSCache' %}">#}
|
||||||
{# <span class="h4">{% trans "Joomla" %}</span>#}
|
{# <span class="h4">{% trans "Joomla" %}</span>#}
|
||||||
{# </a>#}
|
{# </a>#}
|
||||||
{# </div>#}
|
{# </div>#}
|
||||||
|
|
||||||
<div class="col-md-3 panel-body">
|
<div class="col-md-3 panel-body">
|
||||||
<a href="/websites/{{ childDomain }}/manageGIT" target="_blank"
|
<a href="/websites/{{ childDomain }}/manageGIT" target="_blank"
|
||||||
@@ -728,16 +743,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{# <div class="col-md-3 panel-body">#}
|
{# <div class="col-md-3 panel-body">#}
|
||||||
{# <a href="{$ installMagentoURL $}" target="_blank"#}
|
{# <a href="{$ installMagentoURL $}" target="_blank"#}
|
||||||
{# title="{% trans 'Install Magento' %}">#}
|
{# title="{% trans 'Install Magento' %}">#}
|
||||||
{# <img src="{% static 'images/icons/magento.png' %}" width="65" class="mr-10">#}
|
{# <img src="{% static 'images/icons/magento.png' %}" width="65" class="mr-10">#}
|
||||||
{# </a>#}
|
{# </a>#}
|
||||||
{# <a href="{$ installMagentoURL $}" target="_blank"#}
|
{# <a href="{$ installMagentoURL $}" target="_blank"#}
|
||||||
{# title="{% trans 'Install Magento' %}">#}
|
{# title="{% trans 'Install Magento' %}">#}
|
||||||
{# <span class="h4">{% trans "Magento" %}</span>#}
|
{# <span class="h4">{% trans "Magento" %}</span>#}
|
||||||
{# </a>#}
|
{# </a>#}
|
||||||
{# </div>#}
|
{# </div>#}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -532,6 +532,17 @@
|
|||||||
</h3>
|
</h3>
|
||||||
<div class="content-box-wrapper">
|
<div class="content-box-wrapper">
|
||||||
<div class="row mx-10">
|
<div class="row mx-10">
|
||||||
|
<div class="col-md-3 panel-body">
|
||||||
|
<a href="{% url 'ApacheManager' domain=domain %}"
|
||||||
|
title="{% trans 'Apache Manager' %}">
|
||||||
|
<img src="{% static 'images/icons/file.png' %}" width="65" class="mr-10">
|
||||||
|
</a>
|
||||||
|
<a href="{% url 'ApacheManager' domain=domain %}"
|
||||||
|
title="{% trans 'Apache Manager' %}">
|
||||||
|
<span class="h4">{% trans "Apache Manager" %}</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3 panel-body">
|
<div class="col-md-3 panel-body">
|
||||||
<a ng-click="fetchConfigurations()" href=""
|
<a ng-click="fetchConfigurations()" href=""
|
||||||
title="{% trans 'Edit vHost Main Configurations' %}">
|
title="{% trans 'Edit vHost Main Configurations' %}">
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
from django.conf.urls import url
|
from django.conf.urls import url
|
||||||
from . import views
|
from . import views
|
||||||
|
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^$', views.loadWebsitesHome, name='loadWebsitesHome'),
|
url(r'^$', views.loadWebsitesHome, name='loadWebsitesHome'),
|
||||||
url(r'^createWebsite$', views.createWebsite, name='createWebsite'),
|
url(r'^createWebsite$', views.createWebsite, name='createWebsite'),
|
||||||
@@ -15,7 +14,6 @@ urlpatterns = [
|
|||||||
|
|
||||||
url(r'^CreateNewDomain$', views.CreateNewDomain, name='CreateNewDomain'),
|
url(r'^CreateNewDomain$', views.CreateNewDomain, name='CreateNewDomain'),
|
||||||
|
|
||||||
|
|
||||||
### WordPress
|
### WordPress
|
||||||
url(r'^createWordpress$', views.WPCreate, name='createWordpress'),
|
url(r'^createWordpress$', views.WPCreate, name='createWordpress'),
|
||||||
url(r'^ListWPSites$', views.ListWPSites, name='ListWPSites'),
|
url(r'^ListWPSites$', views.ListWPSites, name='ListWPSites'),
|
||||||
@@ -28,7 +26,6 @@ urlpatterns = [
|
|||||||
url(r'^AddRemoteBackupsite$', views.AddRemoteBackupsite, name='AddRemoteBackupsite'),
|
url(r'^AddRemoteBackupsite$', views.AddRemoteBackupsite, name='AddRemoteBackupsite'),
|
||||||
url(r'^pricing$', views.WordpressPricing, name='pricing'),
|
url(r'^pricing$', views.WordpressPricing, name='pricing'),
|
||||||
|
|
||||||
|
|
||||||
###WordPress Ajax
|
###WordPress Ajax
|
||||||
url(r'^submitWorpressCreation', views.submitWorpressCreation, name='submitWorpressCreation'),
|
url(r'^submitWorpressCreation', views.submitWorpressCreation, name='submitWorpressCreation'),
|
||||||
url(r'^FetchWPdata', views.FetchWPdata, name='FetchWPdata'),
|
url(r'^FetchWPdata', views.FetchWPdata, name='FetchWPdata'),
|
||||||
@@ -56,26 +53,19 @@ urlpatterns = [
|
|||||||
url(r'^UpdateRemoteschedules', views.UpdateRemoteschedules, name='UpdateRemoteschedules'),
|
url(r'^UpdateRemoteschedules', views.UpdateRemoteschedules, name='UpdateRemoteschedules'),
|
||||||
url(r'^ScanWordpressSite', views.ScanWordpressSite, name='ScanWordpressSite'),
|
url(r'^ScanWordpressSite', views.ScanWordpressSite, name='ScanWordpressSite'),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### AddPlugin
|
#### AddPlugin
|
||||||
url(r'^ConfigurePlugins$', views.ConfigurePlugins, name='ConfigurePlugins'),
|
url(r'^ConfigurePlugins$', views.ConfigurePlugins, name='ConfigurePlugins'),
|
||||||
url(r'^Addnewplugin$', views.Addnewplugin, name='Addnewplugin'),
|
url(r'^Addnewplugin$', views.Addnewplugin, name='Addnewplugin'),
|
||||||
url(r'^EidtPlugin$', views.EidtPlugin, name='EidtPlugin'),
|
url(r'^EidtPlugin$', views.EidtPlugin, name='EidtPlugin'),
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## AddPlugin Ajax
|
## AddPlugin Ajax
|
||||||
url(r'^SearchOnkeyupPlugin$', views.SearchOnkeyupPlugin, name='SearchOnkeyupPlugin'),
|
url(r'^SearchOnkeyupPlugin$', views.SearchOnkeyupPlugin, name='SearchOnkeyupPlugin'),
|
||||||
url(r'^AddNewpluginAjax$', views.AddNewpluginAjax, name='AddNewpluginAjax'),
|
url(r'^AddNewpluginAjax$', views.AddNewpluginAjax, name='AddNewpluginAjax'),
|
||||||
url(r'^deletesPlgin', views.deletesPlgin, name='deletesPlgin'),
|
url(r'^deletesPlgin', views.deletesPlgin, name='deletesPlgin'),
|
||||||
url(r'^Addplugineidt', views.Addplugineidt, name='Addplugineidt'),
|
url(r'^Addplugineidt', views.Addplugineidt, name='Addplugineidt'),
|
||||||
|
|
||||||
|
|
||||||
# Website modification url
|
# Website modification url
|
||||||
|
|
||||||
|
|
||||||
url(r'^submitWebsiteCreation$', views.submitWebsiteCreation, name='submitWebsiteCreation'),
|
url(r'^submitWebsiteCreation$', views.submitWebsiteCreation, name='submitWebsiteCreation'),
|
||||||
url(r'^submitWebsiteDeletion$', views.submitWebsiteDeletion, name='submitWebsiteDeletion'),
|
url(r'^submitWebsiteDeletion$', views.submitWebsiteDeletion, name='submitWebsiteDeletion'),
|
||||||
url(r'^submitWebsiteListing$', views.getFurtherAccounts, name='submitWebsiteListing'),
|
url(r'^submitWebsiteListing$', views.getFurtherAccounts, name='submitWebsiteListing'),
|
||||||
@@ -86,7 +76,6 @@ urlpatterns = [
|
|||||||
url(r'^submitWebsiteModification$', views.deleteWebsite, name='submitWebsiteModification'),
|
url(r'^submitWebsiteModification$', views.deleteWebsite, name='submitWebsiteModification'),
|
||||||
url(r'^submitWebsiteStatus$', views.submitWebsiteStatus, name='submitWebsiteStatus'),
|
url(r'^submitWebsiteStatus$', views.submitWebsiteStatus, name='submitWebsiteStatus'),
|
||||||
|
|
||||||
|
|
||||||
url(r'^getWebsiteDetails$', views.submitWebsiteModify, name='getWebsiteDetails'),
|
url(r'^getWebsiteDetails$', views.submitWebsiteModify, name='getWebsiteDetails'),
|
||||||
url(r'^saveWebsiteChanges', views.saveWebsiteChanges, name='saveWebsiteChanges'),
|
url(r'^saveWebsiteChanges', views.saveWebsiteChanges, name='saveWebsiteChanges'),
|
||||||
|
|
||||||
@@ -97,7 +86,6 @@ urlpatterns = [
|
|||||||
|
|
||||||
url(r'^saveConfigsToFile$', views.saveConfigsToFile, name='saveConfigsToFile'),
|
url(r'^saveConfigsToFile$', views.saveConfigsToFile, name='saveConfigsToFile'),
|
||||||
|
|
||||||
|
|
||||||
url(r'^getRewriteRules$', views.getRewriteRules, name='getRewriteRules'),
|
url(r'^getRewriteRules$', views.getRewriteRules, name='getRewriteRules'),
|
||||||
|
|
||||||
url(r'^saveRewriteRules$', views.saveRewriteRules, name='saveRewriteRules'),
|
url(r'^saveRewriteRules$', views.saveRewriteRules, name='saveRewriteRules'),
|
||||||
@@ -116,32 +104,29 @@ urlpatterns = [
|
|||||||
url(r'^searchChilds$', views.searchChilds, name='searchChilds'),
|
url(r'^searchChilds$', views.searchChilds, name='searchChilds'),
|
||||||
# crons
|
# crons
|
||||||
|
|
||||||
url(r'^listCron$',views.listCron,name="listCron"),
|
url(r'^listCron$', views.listCron, name="listCron"),
|
||||||
url(r'^getWebsiteCron$',views.getWebsiteCron,name="getWebsiteCron"),
|
url(r'^getWebsiteCron$', views.getWebsiteCron, name="getWebsiteCron"),
|
||||||
url(r'^getCronbyLine$',views.getCronbyLine,name="getCronbyLine"),
|
url(r'^getCronbyLine$', views.getCronbyLine, name="getCronbyLine"),
|
||||||
url(r'^remCronbyLine$',views.remCronbyLine,name="remCronbyLine"),
|
url(r'^remCronbyLine$', views.remCronbyLine, name="remCronbyLine"),
|
||||||
url(r'^saveCronChanges$',views.saveCronChanges,name="saveCronChanges"),
|
url(r'^saveCronChanges$', views.saveCronChanges, name="saveCronChanges"),
|
||||||
url(r'^addNewCron$',views.addNewCron,name="addNewCron"),
|
url(r'^addNewCron$', views.addNewCron, name="addNewCron"),
|
||||||
|
|
||||||
|
|
||||||
## Domain Alias
|
## Domain Alias
|
||||||
|
|
||||||
url(r'^(?P<domain>(.*))/domainAlias$', views.domainAlias, name='domainAlias'),
|
url(r'^(?P<domain>(.*))/domainAlias$', views.domainAlias, name='domainAlias'),
|
||||||
url(r'^submitAliasCreation$',views.submitAliasCreation,name="submitAliasCreation"),
|
url(r'^submitAliasCreation$', views.submitAliasCreation, name="submitAliasCreation"),
|
||||||
url(r'^issueAliasSSL$',views.issueAliasSSL,name="issueAliasSSL"),
|
url(r'^issueAliasSSL$', views.issueAliasSSL, name="issueAliasSSL"),
|
||||||
url(r'^delateAlias$',views.delateAlias,name="delateAlias"),
|
url(r'^delateAlias$', views.delateAlias, name="delateAlias"),
|
||||||
|
|
||||||
|
|
||||||
## Openbasedir
|
## Openbasedir
|
||||||
url(r'^changeOpenBasedir$',views.changeOpenBasedir,name="changeOpenBasedir"),
|
url(r'^changeOpenBasedir$', views.changeOpenBasedir, name="changeOpenBasedir"),
|
||||||
|
|
||||||
## WP Install
|
## WP Install
|
||||||
|
|
||||||
url(r'^(?P<domain>(.*))/wordpressInstall$', views.wordpressInstall, name='wordpressInstall'),
|
url(r'^(?P<domain>(.*))/wordpressInstall$', views.wordpressInstall, name='wordpressInstall'),
|
||||||
url(r'^installWordpressStatus$',views.installWordpressStatus,name="installWordpressStatus"),
|
url(r'^installWordpressStatus$', views.installWordpressStatus, name="installWordpressStatus"),
|
||||||
url(r'^installWordpress$', views.installWordpress, name='installWordpress'),
|
url(r'^installWordpress$', views.installWordpress, name='installWordpress'),
|
||||||
|
|
||||||
|
|
||||||
## Joomla Install
|
## Joomla Install
|
||||||
|
|
||||||
url(r'^installJoomla$', views.installJoomla, name='installJoomla'),
|
url(r'^installJoomla$', views.installJoomla, name='installJoomla'),
|
||||||
@@ -162,7 +147,6 @@ urlpatterns = [
|
|||||||
url(r'^(?P<domain>(.*))/installMautic$', views.installMautic, name='installMautic'),
|
url(r'^(?P<domain>(.*))/installMautic$', views.installMautic, name='installMautic'),
|
||||||
url(r'^mauticInstall$', views.mauticInstall, name='mauticInstall'),
|
url(r'^mauticInstall$', views.mauticInstall, name='mauticInstall'),
|
||||||
|
|
||||||
|
|
||||||
## Git
|
## Git
|
||||||
url(r'^(?P<domain>(.*))/setupGit$', views.setupGit, name='setupGit'),
|
url(r'^(?P<domain>(.*))/setupGit$', views.setupGit, name='setupGit'),
|
||||||
url(r'^setupGitRepo$', views.setupGitRepo, name='setupGitRepo'),
|
url(r'^setupGitRepo$', views.setupGitRepo, name='setupGitRepo'),
|
||||||
@@ -178,7 +162,6 @@ urlpatterns = [
|
|||||||
url(r'^(?P<domain>(.*))/(?P<childDomain>(.*))/syncToMaster$', views.syncToMaster, name='syncToMaster'),
|
url(r'^(?P<domain>(.*))/(?P<childDomain>(.*))/syncToMaster$', views.syncToMaster, name='syncToMaster'),
|
||||||
url(r'^startSync$', views.startSync, name='startSync'),
|
url(r'^startSync$', views.startSync, name='startSync'),
|
||||||
|
|
||||||
|
|
||||||
url(r'^(?P<domain>(.*))/gitNotify$', views.gitNotify, name='gitNotify'),
|
url(r'^(?P<domain>(.*))/gitNotify$', views.gitNotify, name='gitNotify'),
|
||||||
url(r'^detachRepo$', views.detachRepo, name='detachRepo'),
|
url(r'^detachRepo$', views.detachRepo, name='detachRepo'),
|
||||||
url(r'^changeBranch$', views.changeBranch, name='changeBranch'),
|
url(r'^changeBranch$', views.changeBranch, name='changeBranch'),
|
||||||
@@ -211,8 +194,17 @@ urlpatterns = [
|
|||||||
url(r'^deleteSSHKey$', views.deleteSSHKey, name='deleteSSHKey'),
|
url(r'^deleteSSHKey$', views.deleteSSHKey, name='deleteSSHKey'),
|
||||||
url(r'^addSSHKey$', views.addSSHKey, name='addSSHKey'),
|
url(r'^addSSHKey$', views.addSSHKey, name='addSSHKey'),
|
||||||
|
|
||||||
|
### Apache Manager
|
||||||
|
|
||||||
|
url(r'^ApacheManager/(?P<domain>(.*))$', views.ApacheManager, name='ApacheManager'),
|
||||||
|
url(r'^getSwitchStatus$', views.getSwitchStatus, name='getSwitchStatus'),
|
||||||
|
url(r'^switchServer$', views.switchServer, name='switchServer'),
|
||||||
|
url(r'^statusFunc$', views.statusFunc, name='statusFunc'),
|
||||||
|
url(r'^tuneSettings$', views.tuneSettings, name='tuneSettings'),
|
||||||
|
url(r'^saveApacheConfigsToFile$', views.saveApacheConfigsToFile, name='saveApacheConfigsToFile'),
|
||||||
|
|
||||||
## Catch all for domains
|
## Catch all for domains
|
||||||
url(r'^(?P<domain>(.*))/(?P<childDomain>(.*))$', views.launchChild, name='launchChild'),
|
url(r'^(?P<domain>(.*))/(?P<childDomain>(.*))$', views.launchChild, name='launchChild'),
|
||||||
url(r'^(?P<domain>(.*))$', views.domain, name='domain'),
|
url(r'^(?P<domain>(.*))$', views.domain, name='domain'),
|
||||||
|
|
||||||
]
|
]
|
||||||
@@ -1695,3 +1695,58 @@ def webhook(request, domain):
|
|||||||
return wm.webhook(domain, json.loads(request.body))
|
return wm.webhook(domain, json.loads(request.body))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
return redirect(loadLoginPage)
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
|
|
||||||
|
def ApacheManager(request, domain):
|
||||||
|
try:
|
||||||
|
userID = request.session['userID']
|
||||||
|
wm = WebsiteManager(domain)
|
||||||
|
return wm.ApacheManager(request, userID)
|
||||||
|
except KeyError:
|
||||||
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
|
|
||||||
|
def getSwitchStatus(request):
|
||||||
|
try:
|
||||||
|
userID = request.session['userID']
|
||||||
|
wm = WebsiteManager()
|
||||||
|
return wm.getSwitchStatus(userID, json.loads(request.body))
|
||||||
|
except KeyError:
|
||||||
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
|
def switchServer(request):
|
||||||
|
try:
|
||||||
|
userID = request.session['userID']
|
||||||
|
wm = WebsiteManager()
|
||||||
|
return wm.switchServer(userID, json.loads(request.body))
|
||||||
|
except KeyError:
|
||||||
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
|
def statusFunc(request):
|
||||||
|
try:
|
||||||
|
userID = request.session['userID']
|
||||||
|
data = json.loads(request.body)
|
||||||
|
from cloudAPI.cloudManager import CloudManager
|
||||||
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
cm = CloudManager(data, admin)
|
||||||
|
return cm.statusFunc()
|
||||||
|
except KeyError:
|
||||||
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
|
def tuneSettings(request):
|
||||||
|
try:
|
||||||
|
userID = request.session['userID']
|
||||||
|
data = json.loads(request.body)
|
||||||
|
wm = WebsiteManager()
|
||||||
|
return wm.tuneSettings(userID, data)
|
||||||
|
except KeyError:
|
||||||
|
return redirect(loadLoginPage)
|
||||||
|
|
||||||
|
def saveApacheConfigsToFile(request):
|
||||||
|
try:
|
||||||
|
userID = request.session['userID']
|
||||||
|
data = json.loads(request.body)
|
||||||
|
wm = WebsiteManager()
|
||||||
|
return wm.saveApacheConfigsToFile(userID, data)
|
||||||
|
except KeyError:
|
||||||
|
return redirect(loadLoginPage)
|
||||||
|
|||||||
@@ -4527,6 +4527,7 @@ StrictHostKeyChecking no
|
|||||||
data['pmMinSpareServers'] = pmMinSpareServers
|
data['pmMinSpareServers'] = pmMinSpareServers
|
||||||
data['pmMaxSpareServers'] = pmMaxSpareServers
|
data['pmMaxSpareServers'] = pmMaxSpareServers
|
||||||
data['phpPath'] = phpPath
|
data['phpPath'] = phpPath
|
||||||
|
data['configData'] = ProcessUtilities.outputExecutioner(f'cat {finalConfPath}')
|
||||||
else:
|
else:
|
||||||
data = {}
|
data = {}
|
||||||
data['status'] = 1
|
data['status'] = 1
|
||||||
@@ -4572,6 +4573,7 @@ StrictHostKeyChecking no
|
|||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
def tuneSettings(self, userID=None, data=None):
|
def tuneSettings(self, userID=None, data=None):
|
||||||
|
try:
|
||||||
|
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
admin = Administrator.objects.get(pk=userID)
|
admin = Administrator.objects.get(pk=userID)
|
||||||
@@ -4608,6 +4610,13 @@ StrictHostKeyChecking no
|
|||||||
|
|
||||||
tempStatusPath = "/home/cyberpanel/" + str(randint(1000, 9999))
|
tempStatusPath = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||||
|
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
sockPath = '/var/run/php-fpm/'
|
||||||
|
group = 'nobody'
|
||||||
|
else:
|
||||||
|
sockPath = '/var/run/php/'
|
||||||
|
group = 'nogroup'
|
||||||
|
|
||||||
phpFPMConf = vhostConfs.phpFpmPoolReplace
|
phpFPMConf = vhostConfs.phpFpmPoolReplace
|
||||||
phpFPMConf = phpFPMConf.replace('{externalApp}', externalApp)
|
phpFPMConf = phpFPMConf.replace('{externalApp}', externalApp)
|
||||||
phpFPMConf = phpFPMConf.replace('{pmMaxChildren}', pmMaxChildren)
|
phpFPMConf = phpFPMConf.replace('{pmMaxChildren}', pmMaxChildren)
|
||||||
@@ -4616,6 +4625,8 @@ StrictHostKeyChecking no
|
|||||||
phpFPMConf = phpFPMConf.replace('{pmMaxSpareServers}', pmMaxSpareServers)
|
phpFPMConf = phpFPMConf.replace('{pmMaxSpareServers}', pmMaxSpareServers)
|
||||||
phpFPMConf = phpFPMConf.replace('{www}', "".join(re.findall("[a-zA-Z]+", domainName))[:7])
|
phpFPMConf = phpFPMConf.replace('{www}', "".join(re.findall("[a-zA-Z]+", domainName))[:7])
|
||||||
phpFPMConf = phpFPMConf.replace('{Sock}', domainName)
|
phpFPMConf = phpFPMConf.replace('{Sock}', domainName)
|
||||||
|
phpFPMConf = phpFPMConf.replace('{sockPath}', sockPath)
|
||||||
|
phpFPMConf = phpFPMConf.replace('{group}', group)
|
||||||
|
|
||||||
writeToFile = open(tempStatusPath, 'w')
|
writeToFile = open(tempStatusPath, 'w')
|
||||||
writeToFile.writelines(phpFPMConf)
|
writeToFile.writelines(phpFPMConf)
|
||||||
@@ -4626,20 +4637,34 @@ StrictHostKeyChecking no
|
|||||||
|
|
||||||
phpPath = phpPath.split('/')
|
phpPath = phpPath.split('/')
|
||||||
|
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
if phpPath[1] == 'etc':
|
if phpPath[1] == 'etc':
|
||||||
phpVersion = phpPath[4][3] + phpPath[4][4]
|
phpVersion = phpPath[4][3] + phpPath[4][4]
|
||||||
else:
|
else:
|
||||||
phpVersion = phpPath[3][3] + phpPath[3][4]
|
phpVersion = phpPath[3][3] + phpPath[3][4]
|
||||||
|
else:
|
||||||
|
phpVersion = f'PHP {phpPath[2]}'
|
||||||
|
|
||||||
command = "systemctl stop php%s-php-fpm" % (phpVersion)
|
php = PHPManager.getPHPString(phpVersion)
|
||||||
ProcessUtilities.executioner(command)
|
|
||||||
|
|
||||||
command = "systemctl restart php%s-php-fpm" % (phpVersion)
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
ProcessUtilities.executioner(command)
|
phpService = f'php{php}-php-fpm'
|
||||||
|
else:
|
||||||
|
phpService = f"{phpVersion.replace(' ', '').lower()}-fpm"
|
||||||
|
|
||||||
|
command = f"systemctl stop {phpService}"
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
|
command = f"systemctl restart {phpService}"
|
||||||
|
ProcessUtilities.normalExecutioner(command)
|
||||||
|
|
||||||
data_ret = {'status': 1}
|
data_ret = {'status': 1}
|
||||||
json_data = json.dumps(data_ret)
|
json_data = json.dumps(data_ret)
|
||||||
return HttpResponse(json_data)
|
return HttpResponse(json_data)
|
||||||
|
except BaseException as msg:
|
||||||
|
data_ret = {'status': 0, 'error_message': str(msg)}
|
||||||
|
json_data = json.dumps(data_ret)
|
||||||
|
return HttpResponse(json_data)
|
||||||
|
|
||||||
def sshAccess(self, request=None, userID=None, data=None):
|
def sshAccess(self, request=None, userID=None, data=None):
|
||||||
currentACL = ACLManager.loadedACL(userID)
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
@@ -6396,3 +6421,58 @@ StrictHostKeyChecking no
|
|||||||
final_dic = {'status': 0, 'add_status': 0, 'error_mssage': str(msg)}
|
final_dic = {'status': 0, 'add_status': 0, 'error_mssage': str(msg)}
|
||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
|
||||||
|
def ApacheManager(self, request=None, userID=None, data=None):
|
||||||
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
admin = Administrator.objects.get(pk=userID)
|
||||||
|
|
||||||
|
if ACLManager.checkOwnership(self.domain, admin, currentACL) == 1:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
return ACLManager.loadError()
|
||||||
|
|
||||||
|
phps = PHPManager.findPHPVersions()
|
||||||
|
|
||||||
|
proc = httpProc(request, 'websiteFunctions/ApacheManager.html', {'domainName': self.domain, 'phps': phps})
|
||||||
|
return proc.render()
|
||||||
|
|
||||||
|
def saveApacheConfigsToFile(self, userID=None, data=None):
|
||||||
|
|
||||||
|
currentACL = ACLManager.loadedACL(userID)
|
||||||
|
|
||||||
|
if currentACL['admin'] != 1:
|
||||||
|
return ACLManager.loadErrorJson('configstatus', 0)
|
||||||
|
|
||||||
|
configData = data['configData']
|
||||||
|
self.domain = data['domainName']
|
||||||
|
|
||||||
|
mailUtilities.checkHome()
|
||||||
|
|
||||||
|
tempPath = "/home/cyberpanel/" + str(randint(1000, 9999))
|
||||||
|
|
||||||
|
vhost = open(tempPath, "w")
|
||||||
|
|
||||||
|
vhost.write(configData)
|
||||||
|
|
||||||
|
vhost.close()
|
||||||
|
|
||||||
|
## writing data temporary to file
|
||||||
|
|
||||||
|
filePath = ApacheVhost.configBasePath + self.domain + '.conf'
|
||||||
|
|
||||||
|
## save configuration data
|
||||||
|
|
||||||
|
execPath = "/usr/local/CyberCP/bin/python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
|
||||||
|
execPath = execPath + " saveApacheConfigsToFile --path " + filePath + " --tempPath " + tempPath
|
||||||
|
|
||||||
|
output = ProcessUtilities.outputExecutioner(execPath)
|
||||||
|
|
||||||
|
if output.find("1,None") > -1:
|
||||||
|
status = {"status": 1}
|
||||||
|
final_json = json.dumps(status)
|
||||||
|
return HttpResponse(final_json)
|
||||||
|
else:
|
||||||
|
final_dic = {'status': 0, 'error_message': output}
|
||||||
|
final_json = json.dumps(final_dic)
|
||||||
|
return HttpResponse(final_json)
|
||||||
|
|||||||
Reference in New Issue
Block a user