if add a database server or postgresql database
Posted: Sat Jan 26, 2013 12:39 am
Vesta support add remote database server, but in the panel if I use the "open phpMyAdmin" or "open phpPgAdmin" button, always redirect to localhost server.
To fix this, add $data[$key]['HOST'] value to $httpd var in php code (embedded in the html list_db.html), which gets the correct host database:
The other issue is referring to postgresql database, cant no add this type, this is because in vesta.conf only is added mysql type (DB_SYSTEM='mysql') this changes to DB_SYSTEM='mysql,pgsql' and the problem is solved.
regards
To fix this, add $data[$key]['HOST'] value to $httpd var in php code (embedded in the html list_db.html), which gets the correct host database:
Code: Select all
<?php
list($http_host, $port) = explode(':', $_SERVER["HTTP_HOST"]);
foreach ($data as $key => $value) {
++$i;
if ($data[$key]['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'unsuspend' ;
} else {
$status = 'active';
$spnd_action = 'suspend' ;
}
$http_host=$data[$key]['HOST']; <=== THIS
if ($data[$key]['TYPE'] == 'mysql') $db_admin = "phpMyAdmin";
if ($data[$key]['TYPE'] == 'mysql') $db_admin_link = "http://".$http_host."/phpMyAdmin/";
if ($data[$key]['TYPE'] == 'pgsql') $db_admin = "phpPgAdmin";
if ($data[$key]['TYPE'] == 'pgsql') $db_admin_link = "http://".$http_host."/phpPgAdmin/";
?>
regards