Concerning phpMyAdmin : do you install it on all web server or just one ?

Discussion in 'Installation/Configuration' started by ledufakademy, Aug 30, 2020.

  1. ledufakademy

    ledufakademy Member

    but for your multi server setup : do you install phpmyadmin (so with nginx or apache) on database server ?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You can install it there where you prefer it to be. You can even use one central phpmyadmin installation. And then set the URL in ispconfig the way that matches your setup.

    Personally, I won't use separate database servers unless you host a single site that exceeds the capabilities of one web server or in other words, you have just one website which is so big that you need several web servers to serve the pages. In all other cases, having the database on the webserver is faster and scales better as the network connection between web and db server is a bottleneck.
     
  3. ledufakademy

    ledufakademy Member

    ok : it's WORKING , you force me to ... think stronger ! (and thanks again)

    No phpyadmin install on other servers (db or web) , just on the first one , web1. (with our panel !)
    panel url : https://panel.domain.com:8080/

    in System \ Main config ==> https://panel.domain.com:8080/phpmyadmin/
    Then edit : nano /etc/nginx/sites-enabled/000-ispconfig.vhos
    comment out : phpmyadmin part.
    Finaly edit : nano /usr/share/phpmyadmin/config.inc.php

    with

    /**
    * Second server
    */
    $i++;
    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    /* Server parameters */
    $cfg['Servers'][$i]['verbose'] = 'db1.domain.com';
    $cfg['Servers'][$i]['host'] = '10.100.100.1';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['AllowNoPassword'] = false;
    $cfg['Servers'][$i]['AllowRootPassword'] = false;
    $cfg['Servers'][$i]['hide_db'] = 'information_schema';
     
    Last edited: Sep 3, 2020
  4. ledufakademy

    ledufakademy Member

    i'm reading that in pdf manual : "Don't forget to reload nginx afterwards:"
    when copy / paste snipet (ie. phpmyadmin nginx) : must i log to server then systemctl restart nginx ? (or panel will do it for us ?)
     
  5. ledufakademy

    ledufakademy Member

    No agree, with not separate web server and database !
    VM to VM Network traffic, same node : "Yes, we use a linux bridge device."
    Proxmox inside. (our web1 and db1 are always on the same nodes)
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The manual does not as that you have to reload nginx when you copy/paste a snippet into the nginx directives field. The text you cited is from a chapter where you manually edit a config file of the server on the shell and when you manually edit config files, then the service that the config file belongs to must be reloaded or restarted.
     
    ledufakademy likes this.
  7. ledufakademy

    ledufakademy Member

    ok, that a good news ;-)thank you till.
     
  8. ledufakademy

    ledufakademy Member

    Sum up (nginx setup) , what have been done :

    1 - ISPCOnfig : create DNS : A (or CNAME) record , panel.domain.com pointing on public IP of your web server

    All this must be done by chosing webserver (in ispconfig) where you have installed phpMyadmin or ssh to this server :

    2 - ISPCOnfig : Create website "domain.com" + let's encrypt + ssl php-fpm + auto-subdomain " *. "
    3 - SSH WEBSERVER : Comment out this in /etc/nginx/sites-enabled/000-ispconfig.vhost
    location /phpmyadmin {
    root /usr/share/;
    index index.php index.html index.htm;
    location ~ ^/phpmyadmin/(.+\.php)$ {
    try_files $uri =404;
    root /usr/share/;
    include /etc/nginx/fastcgi_params;
    fastcgi_pass unix:/var/lib/php7.3-fpm/ispconfig.sock;
    fastcgi_param HTTPS on;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    }
    location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
    root /usr/share/;
    }
    }
    location /phpMyAdmin {
    rewrite ^/* /phpmyadmin last;
    }​
    4 - ISPCOnfig :: set "System\ Main config \ php URL to "https://panel.domain.com:8080/phpmyadmin/"
    5 - SSH WEBSERVER : Edit your "/usr/share/phpmyadmin/config.inc.php" (config of php
    <?php
    /* vim: set expandtab sw=4 ts=4 sts=4: */
    /**
    * phpMyAdmin sample configuration, you can use it as base for
    * manual configuration. For easier setup you can use setup/
    *
    * All directives are explained in documentation in the doc/ folder
    * or at <https://docs.phpmyadmin.net/>.
    *
    * @package PhpMyAdmin
    */

    /**
    * This is needed for cookie based authentication to encrypt password in
    * cookie. Needs to be 32 chars long.
    */
    $cfg['blowfish_secret'] = 'bD3e63214fnd9fzhgefuzhfzoguhzoghouhzeghzogho; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

    /**
    * Servers configuration
    */
    $i = 0;

    /**
    * First server
    */
    $i++;
    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    /* Server parameters */
    $cfg['Servers'][$i]['verbose'] = 'db1.domain.com';
    $cfg['Servers'][$i]['host'] = '10.10.10.1';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['AllowNoPassword'] = false;
    $cfg['Servers'][$i]['AllowRoot'] = false;
    $cfg['Servers'][$i]['hide_db'] = 'information_schema';

    /**
    * Second server
    */
    $i++;
    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    /* Server parameters */
    $cfg['Servers'][$i]['verbose'] = 'db2.domain.com';
    $cfg['Servers'][$i]['host'] = '10.10.10.2';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['AllowNoPassword'] = false;
    $cfg['Servers'][$i]['AllowRoot'] = false;
    $cfg['Servers'][$i]['hide_db'] = 'information_schema';

    /**
    * Third server
    */
    $i++;
    /* Authentication type */
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    /* Server parameters */
    $cfg['Servers'][$i]['verbose'] = 'db3.domain.com';
    $cfg['Servers'][$i]['host'] = '10.10.10.3';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['AllowNoPassword'] = false;
    $cfg['Servers'][$i]['AllowRoot'] = false;
    $cfg['Servers'][$i]['hide_db'] = 'information_schema';

    /**
    * End of servers configuration
    */

    /**
    * Directories for saving/loading files from server
    */
    $cfg['UploadDir'] = '';
    $cfg['SaveDir'] = '';

    /**
    * Whether to display icons or text or both icons and text in table row
    * action segment. Value can be either of 'icons', 'text' or 'both'.
    * default = 'both'
    */
    //$cfg['RowActionType'] = 'icons';

    /**
    * Defines whether a user should be displayed a "show all (records)"
    * button in browse mode or not.
    * default = false
    */
    //$cfg['ShowAll'] = true;

    /**
    * Number of rows displayed when browsing a result set. If the result
    * set contains more rows, "Previous" and "Next".
    * Possible values: 25, 50, 100, 250, 500
    * default = 25
    */
    //$cfg['MaxRows'] = 50;

    /**
    * Disallow editing of binary fields
    * valid values are:
    * false allow editing
    * 'blob' allow editing except for BLOB fields
    * 'noblob' disallow editing except for BLOB fields
    * 'all' disallow editing
    * default = 'blob'
    */
    //$cfg['ProtectBinary'] = false;

    /**
    * Default language to use, if not browser-defined or user-defined
    * (you find all languages in the locale folder)
    * uncomment the desired line:
    * default = 'en'
    */
    //$cfg['DefaultLang'] = 'en';
    //$cfg['DefaultLang'] = 'de';

    /**
    * How many columns should be used for table display of a database?
    * (a value larger than 1 results in some information being hidden)
    * default = 1
    */
    //$cfg['PropertiesNumColumns'] = 2;

    /**
    * Set to true if you want DB-based query history.If false, this utilizes
    * JS-routines to display query history (lost by window close)
    *
    * This requires configuration storage enabled, see above.
    * default = false
    */
    //$cfg['QueryHistoryDB'] = true;

    /**
    * When using DB-based query history, how many entries should be kept?
    * default = 25
    */
    //$cfg['QueryHistoryMax'] = 100;

    /**
    * Whether or not to query the user before sending the error report to
    * the phpMyAdmin team when a JavaScript error occurs
    *
    * Available options
    * ('ask' | 'always' | 'never')
    * default = 'ask'
    */
    //$cfg['SendErrorReports'] = 'always';

    /**
    * You can find more configuration options in the documentation
    * in the doc/ folder or at <https://docs.phpmyadmin.net/>.
    */
    $cfg['TempDir'] = '/tmp';​

    6 - your panel is ok here : https://panel.domain.com:8080/phpmyadmin/

    Now when you create database you could administrate it through ISPconfig via phpmyadmin icon on the right of the database name.

    Note : this how to suppose that you have dedicated Databse server (here db1,db2 and db3)
     
    Last edited: Sep 4, 2020

Share This Page