Access phpmyadmin on separate server

Discussion in 'Installation/Configuration' started by rsteuer, Dec 14, 2017.

  1. rsteuer

    rsteuer New Member

    We have a separate server for web and separate for databases. The issue we're running into is that users cannot access phpmyadmin for database administration, as phpmyadmin is trying to access the database on the webserver rather than the database serer. Is there a way to send phpmyadmin requests to the database backend?

    servers were configured with Debian 8 following the install manual. Thanks
     
  2. ahrasis

    ahrasis Active Member

    I think you may need to modify PMA config.inc.php like what was being done in here.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    There are two solutions, either configure phpmyadmin as ahrasis pointed out or in case you have a phpmyadmin on each database server, then you can use the [SERVERNAME] placeholder in the PHPMyAdmin URL in ISPConfig, this placehlder gets replaced with the correct mysql server name automatically.
     
    ahrasis likes this.
  4. rsteuer

    rsteuer New Member

    Thanks to both for the reply.
    Till, from ISPConfig panel, if a user clicks on the phpmyadmin icon, the site name is replaced by the local server name. For instance, if the site is xyz.com and they click on the icon, the browser is trying to take them to dbserver.ourdomain.com/phpmyadmin, which fails because we do not publish the db server through our firewall. Is there any way to change this so that we do not need to publish our database server?
    Thank you
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    PHPMyAdmin can connect remotely to a server, so you can install PHPMyAdmin at any location that is accessible, then set the link in ISPConfig under System > Interface config to that location and finally configure phpmyadmin in it's config file to connect to your DB server. That's basically the config that ahrasis suggested (see link in his post).
     
  6. rsteuer

    rsteuer New Member

    Thanks for the info. I am not able to get phpmyadmin to accept connections. What I've done so far is:
    1. added servername/phpmyadmin to System | System Config (also added check to Link to phpmyadmin in DB list)
    2. on the webserver, changed the IP in /etc/phpMyAdmin/config.inc.php to point to the dbserver
    3. commented out the bind addr in my.cnf
    I could not locate /etc/httpd/conf.d/phpMyAdmin.conf (or /etc/apache2/...) to make the change suggested.
    When attempting to access domain.com/phpmyadmin, I receive a prompt for credentials, but the login fails. I'm assuming the requests are being sent to the phpmyadmin directory on the webserver, not the db server because I can login to phpmyadmin on the db server without issue.

    Any suggestions?
     
  7. ahrasis

    ahrasis Active Member

    If you are using ISPConfig, you don't need to make any changes to "phpmyadmin.conf" because none exist and I think normally phpmyadmin is under ISPConfig vhost while the permissions to access its web page are already granted by default.

    If your config.inc.php has been set correctly and apache / nginx has been restarted accordingly, reasons on why you cannot access it may probably be seen from the logs of the servers.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    domain.tld/phpmyadmin is the local phpmyadmin and not the Db server of course. The setting in ISPConfig configures the phpmyadmin button in the database list and you have to use [SERVERNAME] and not servername there. Enter into the phpmyadmin URL field

    http://[SERVERNAME]/phpmyadmin

    and when you click on the phpmyadmin button in ISPConfig, the phpmyadmin of the database server will be opened.
     
  9. rsteuer

    rsteuer New Member

    Hi @ahrasis,
    I was going to change the phpmyadmin.conf based on the link you provided, starting with "We have to edit the vi /etc/httpd/conf.d/phpMyAdmin.conf file". But, since I couldn't locate such a file, nothing was actually changed.

    @till, I will make the change suggested and let you know.

    Thanks to both of you.
     

Share This Page