mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
bug fix: apache manager and resolve some ports conflicts
This commit is contained in:
@@ -128,15 +128,20 @@ LoadModule mpm_event_module modules/mod_mpm_event.so
|
|||||||
|
|
||||||
confPath = ApacheVhost.serverRootPath + "/conf/httpd.conf"
|
confPath = ApacheVhost.serverRootPath + "/conf/httpd.conf"
|
||||||
|
|
||||||
|
CurrentConf = open(confPath, 'r').read()
|
||||||
|
|
||||||
data = open(confPath, 'r').readlines()
|
data = open(confPath, 'r').readlines()
|
||||||
writeToFile = open(confPath, 'w')
|
writeToFile = open(confPath, 'w')
|
||||||
|
|
||||||
for items in data:
|
for items in data:
|
||||||
if items.find("Listen") > -1 and items.find("80") > -1 and items.find('#') == -1:
|
if items.find("Listen") > -1 and items.find("80") > -1 and items.find('#') == -1:
|
||||||
writeToFile.writelines("Listen 8081\nListen 8082\n")
|
if CurrentConf.find('Listen 8083') ==-1:
|
||||||
|
writeToFile.writelines("Listen 8083\nListen 8082\n")
|
||||||
elif items.find("User") > -1 and items.find('#') == -1:
|
elif items.find("User") > -1 and items.find('#') == -1:
|
||||||
|
if CurrentConf.find('User nobody') == -1:
|
||||||
writeToFile.writelines("User nobody\n")
|
writeToFile.writelines("User nobody\n")
|
||||||
elif items.find("Group") > -1 and items.find('#') == -1:
|
elif items.find("Group") > -1 and items.find('#') == -1:
|
||||||
|
if CurrentConf.find('Group nobody') == -1:
|
||||||
writeToFile.writelines("Group nobody\n")
|
writeToFile.writelines("Group nobody\n")
|
||||||
writeToFile.writelines('SetEnv LSWS_EDITION Openlitespeed\nSetEnv X-LSCACHE on\n')
|
writeToFile.writelines('SetEnv LSWS_EDITION Openlitespeed\nSetEnv X-LSCACHE on\n')
|
||||||
elif items[0] == "#":
|
elif items[0] == "#":
|
||||||
@@ -160,7 +165,7 @@ LoadModule mpm_event_module modules/mod_mpm_event.so
|
|||||||
portsPath = '/etc/apache2/ports.conf'
|
portsPath = '/etc/apache2/ports.conf'
|
||||||
|
|
||||||
WriteToFile = open(portsPath, 'w')
|
WriteToFile = open(portsPath, 'w')
|
||||||
WriteToFile.write('Listen 8081\nListen 8082\n')
|
WriteToFile.write('Listen 8083\nListen 8082\n')
|
||||||
WriteToFile.close()
|
WriteToFile.close()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1297,6 +1297,9 @@ def getExtensionsInformation(request):
|
|||||||
|
|
||||||
if request.GET.get('apache', None) == None:
|
if request.GET.get('apache', None) == None:
|
||||||
phpVers = f"lsphp{PHPManager.getPHPString(phpVers)}"
|
phpVers = f"lsphp{PHPManager.getPHPString(phpVers)}"
|
||||||
|
else:
|
||||||
|
if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||||
|
phpVers = f"php{PHPManager.getPHPString(phpVers)}"
|
||||||
else:
|
else:
|
||||||
phpVers = phpVers.replace(' ', '').lower()
|
phpVers = phpVers.replace(' ', '').lower()
|
||||||
|
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ context /.well-known/acme-challenge {
|
|||||||
|
|
||||||
</VirtualHost>"""
|
</VirtualHost>"""
|
||||||
|
|
||||||
apacheConf = """<VirtualHost *:8081>
|
apacheConf = """<VirtualHost *:8082>
|
||||||
|
|
||||||
ServerName {virtualHostName}
|
ServerName {virtualHostName}
|
||||||
ServerAlias www.{virtualHostName}
|
ServerAlias www.{virtualHostName}
|
||||||
@@ -269,7 +269,7 @@ context /.well-known/acme-challenge {
|
|||||||
|
|
||||||
</VirtualHost>
|
</VirtualHost>
|
||||||
"""
|
"""
|
||||||
apacheConfChild = """<VirtualHost *:8081>
|
apacheConfChild = """<VirtualHost *:8083>
|
||||||
|
|
||||||
ServerName {virtualHostName}
|
ServerName {virtualHostName}
|
||||||
ServerAlias www.{virtualHostName}
|
ServerAlias www.{virtualHostName}
|
||||||
@@ -325,7 +325,7 @@ context /.well-known/acme-challenge {
|
|||||||
"""
|
"""
|
||||||
proxyApacheBackend = """extprocessor apachebackend {
|
proxyApacheBackend = """extprocessor apachebackend {
|
||||||
type proxy
|
type proxy
|
||||||
address http://127.0.0.1:8081
|
address http://127.0.0.1:8083
|
||||||
maxConns 100
|
maxConns 100
|
||||||
pcKeepAliveTimeout 60
|
pcKeepAliveTimeout 60
|
||||||
initTimeout 60
|
initTimeout 60
|
||||||
|
|||||||
Reference in New Issue
Block a user