mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-13 08:46:09 +01:00
enable remote mysql for other services
This commit is contained in:
@@ -917,6 +917,32 @@ class preFlightsChecks:
|
|||||||
|
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if self.remotemysql == 'ON':
|
||||||
|
command = "sed -i 's|host=localhost|host=%s|g' %s" % (self.mysqlhost, davecotmysql)
|
||||||
|
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
command = "sed -i 's|port=3306|port=%s|g' %s" % (self.mysqlport, davecotmysql)
|
||||||
|
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
command = "sed -i 's|localhost|%s:%s|g' %s" % (self.mysqlhost, self.mysqlport, mysql_virtual_domains)
|
||||||
|
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
command = "sed -i 's|localhost|%s:%s|g' %s" % (
|
||||||
|
self.mysqlhost, self.mysqlport, mysql_virtual_forwardings)
|
||||||
|
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
command = "sed -i 's|localhost|%s:%s|g' %s" % (
|
||||||
|
self.mysqlhost, self.mysqlport, mysql_virtual_mailboxes)
|
||||||
|
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
command = "sed -i 's|localhost|%s:%s|g' %s" % (
|
||||||
|
self.mysqlhost, self.mysqlport, mysql_virtual_email2email)
|
||||||
|
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
logging.InstallLog.writeToFile("Authentication for Postfix and Dovecot set.")
|
logging.InstallLog.writeToFile("Authentication for Postfix and Dovecot set.")
|
||||||
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
|
|||||||
@@ -420,6 +420,18 @@ class InstallCyberPanel:
|
|||||||
|
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
|
ftpConfPath = '/etc/pure-ftpd/pureftpd-mysql.conf'
|
||||||
|
|
||||||
|
if self.remotemysql == 'ON':
|
||||||
|
command = "sed -i 's|localhost|%s|g' %s" % (self.mysqlhost, ftpConfPath)
|
||||||
|
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
command = "sed -i 's|3306|%s|g' %s" % (self.mysqlport, ftpConfPath)
|
||||||
|
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
command = "sed -i 's|MYSQLSocket /var/lib/mysql/mysql.sock||g' %s" % (ftpConfPath)
|
||||||
|
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
if self.distro == ubuntu:
|
if self.distro == ubuntu:
|
||||||
|
|
||||||
if os.path.exists('/etc/pure-ftpd/db/mysql.conf'):
|
if os.path.exists('/etc/pure-ftpd/db/mysql.conf'):
|
||||||
@@ -551,6 +563,14 @@ class InstallCyberPanel:
|
|||||||
|
|
||||||
writeDataToFile.close()
|
writeDataToFile.close()
|
||||||
|
|
||||||
|
|
||||||
|
if self.remotemysql == 'ON':
|
||||||
|
command = "sed -i 's|gmysql-host=127.0.0.1|gmysql-host=%s|g' %s" % (self.mysqlhost, dnsPath)
|
||||||
|
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
|
command = "sed -i 's|gmysql-port=3306|gmysql-port=%s|g' %s" % (self.mysqlport, dnsPath)
|
||||||
|
install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
||||||
|
|
||||||
InstallCyberPanel.stdOut("PowerDNS configured!", 1)
|
InstallCyberPanel.stdOut("PowerDNS configured!", 1)
|
||||||
|
|
||||||
except IOError as msg:
|
except IOError as msg:
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ class mysqlUtilities:
|
|||||||
dropDB = "GRANT ALL PRIVILEGES ON " + dbname + ".* TO '" + dbuser + "'@'%s'" % (publicip)
|
dropDB = "GRANT ALL PRIVILEGES ON " + dbname + ".* TO '" + dbuser + "'@'%s'" % (publicip)
|
||||||
else:
|
else:
|
||||||
dropDB = "GRANT ALL PRIVILEGES ON " + dbname + ".* TO '" + dbuser + "'@'localhost'"
|
dropDB = "GRANT ALL PRIVILEGES ON " + dbname + ".* TO '" + dbuser + "'@'localhost'"
|
||||||
|
|
||||||
command = initCommand + dropDB + '"'
|
command = initCommand + dropDB + '"'
|
||||||
|
|
||||||
if install.preFlightsChecks.debug:
|
if install.preFlightsChecks.debug:
|
||||||
|
|||||||
Reference in New Issue
Block a user