howto - disable default remote access to sql, enable webserver access automatically
Maybe someone can use this
.
I have multiserver setup, where Database server is different then webserver
server1: ISPConfig webinterface, DNS, oldwebserver
server2: mailserver, dbserver
When you add Database in Sites=> Database menu, there is Remote Access IPs field (separate by , and leave blank for any)
I don't like that access to mysql server is enabled by default from anywhere. Want to explicitly allow all accessing IPs . And i also need webserver to have allowed access to DB by default (my clients will never know what to fill into that field)
It's easy:
On Database server edit file
/usr/local/ispconfig/server/plugins-available/mysql_clientdb_plugin.inc.php
and change
//if(trim($host_list) == "") $host_list = '%';
to
if(trim($host_list) == "") $host_list = '1.2.3.4';
and also change
//if(!is_array($host_list)) $host_list = explode(',', $host_list);
to
if(!is_array($host_list)) {$host_list = split(',', $host_list); $host_list[] = '1.2.3.4';}
where 1.2.3.4 is adress of your webserver (or any server you want to allow acces to by default)
You can check result in Privileges table in phpMyAdmin
Last edited by radim_h; 28th August 2012 at 12:10.
|
Recent comments
1 day 2 hours ago
1 day 9 hours ago
1 day 12 hours ago
1 day 14 hours ago
1 day 23 hours ago
2 days 8 hours ago
2 days 9 hours ago
2 days 12 hours ago
2 days 17 hours ago
2 days 17 hours ago