Join the community today
Become a Member

phpmyadmin.sh Addon

Discussion in 'Add Ons' started by eva2000, May 25, 2014.

  1. eva2000

    eva2000 Administrator Staff Member

    53,821
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    The Centmin Mod Addon for phpmyadmin auto installation, phpmyadmin.sh has been in beta status for a while now with instructions at Addon phpmyadmin.sh - CentminMod.com LEMP Nginx web stack for CentOS.

    This thread is for feedback for this phpmyadmin installer.

    Background:

    There are many ways to configure and install phpmyadmin from phpmyadmin.net documentation with Nginx. Some not as secure as other methods. It's one of reason I have yet to include it in Centmin Mod.

    To be able to include phpmyadmin.sh auto installer as a Centmin Mod official Add On, it will have to be locked down tight:
    1. behind SSL and only accesible via https://
    2. password protected directory
    3. randomised directory install path unique to each Centmin Mod installation
    4. separate php-fpm pool with different user
    5. deny all access with only 127.0.0.1 and your ISP ip address allowed access
    6. auto updatable phpmyadmin

    phpmyadmin.sh 0.1.6 Update March 14, 2019



    You can check your existing /usr/local/src/centminmod/addons/phpmyadmin.sh version via command
    Code (Text):
    grep -w VER /usr/local/src/centminmod/addons/phpmyadmin.sh
    

    example
    Code (Text):
    grep -w VER /usr/local/src/centminmod/addons/phpmyadmin.sh
    VER='0.1.2'
    


    phpmyadmin.sh addon installs phpmyadmin via git so it can do update updates via git pull. However, phpmyadmin git stable branch is now 4.7.0. phpyadmin 4.7.0 requires composer so the updated phpmyadmin.sh 0.1.0 script does a local composer.phar install to phpmyadmin git cloned directory for the required composer updates to missing files like "./vendor/autoload.php missing" as seen at PHPMYADMIN File ./vendor/autoload.php missing or not readable.

    Auto Fix



    Easiest way to update is uninstall your existing phpmyadmin install using uninstall script listed at Addon phpmyadmin.sh - CentminMod.com LEMP Nginx web stack for CentOS and then download latest phpmyadmin.sh addon script
    Code (Text):
    cd /usr/local/src/centminmod/addons
    rm -rf phpmyadmin.sh
    wget --no-check-certificate https://github.com/centminmod/phpmyadmin/raw/master/phpmyadmin.sh
    

    and then reinstall phpmyadmin.sh as per instructions at Addon phpmyadmin.sh - CentminMod.com LEMP Nginx web stack for CentOS


    Manual Fix



    If you don't want to uninstall, you can manually update your phpmyadmin install to the new requirements. Using below steps.

    Step 1. If your phpmyadmin install is at say /usr/local/nginx/html/2040_mysqladmin14941 go into that directory and type these commands
    Code (Text):
    cd /usr/local/nginx/html/2040_mysqladmin14941
    git pull
    rm -rf composer.phar
    wget -cnv https://getcomposer.org/composer.phar -O composer.phar
    php composer.phar update --no-dev
    


    Step 2. Edit the phpmyadmin_update.sh script at /root/tools/phpmyadmin_update.sh, edit /root/tools/phpmyadmin_update.sh and add after the git pull line, these 3 additional lines
    Code (Text):
    git pull
    rm -rf composer.phar
    wget -cnv https://getcomposer.org/composer.phar -O composer.phar
    php composer.phar update --no-dev
    


    Then restart nginx and php services
    Code (Text):
    nprestart
    


    phpmyadmin 4.7.0 release notes

    /tmp/phpfpm_myadmin.sock Errors Fix



    If you get errrors due to unix:/tmp/phpfpm_myadmin.sock with phpmyadmin installed via phpmyadmin.sh like
    Code (Text):
    connect() to unix:/tmp/phpfpm_myadmin.sock failed (2: No such file or directory) while connecting to upstream
    

    Then it's due to 123.09beta01 updated php-fpm default config so phpmyadmin's php-fpm pool needs to switch over to using TCP instead of unix sockets.

    The fix is to:

    1. uninstall existing phpmyadmin install made via phpmyadmin.sh by running uninstaller
    Code (Text):
    /root/tools/phpmyadmin_uninstall.sh


    2. download updated phpmyadmin.sh as per Addon phpmyadmin.sh - CentminMod.com LEMP Nginx web stack for CentOS
    Code (Text):
    cd /usr/local/src/centminmod/addons
    wget --no-check-certificate https://github.com/centminmod/phpmyadmin/raw/master/phpmyadmin.sh -O phpmyadmin.sh
    


    3. install phpmyadmin again - the location of install will change as it's randomly generated and unique to each install run
    Code (Text):
    cd /usr/local/src/centminmod/addons/
    ./phpmyadmin.sh install
    


    Using Letsencrypt Trusted SSL Certificates and/or Handling HSTS



    Read the notes at https://community.centminmod.com/threads/phpmyadmin-sh-addon.27/page-21#post-97403 to understand why using Letsencrypt Trusted SSL certificates may not be a good idea of phpmyadmin's main hostname and if you have HSTS issues.
     
    Last edited: Mar 31, 2017
  2. eva2000

    eva2000 Administrator Staff Member

    53,821
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  3. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    8:50 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    Does it works on the latest centminmod beta?

    Is it tha newest phpmyadmin version?
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,821
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah the Github repo will always have latest version

    It did work fine on previous .07 betas, haven't tested specifially for .07 beta 21 but you're welcome to try and provide feedback here :D
     
  5. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    8:50 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    Yes working great :)

    I hate that is using as default the latin1_swedish_ci collation when you create a new database :(
     
  6. eva2000

    eva2000 Administrator Staff Member

    53,821
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Last edited: Jun 9, 2014
  7. pamamolf

    pamamolf Premium Member Premium Member

    4,070
    427
    83
    May 31, 2014
    Ratings:
    +832
    Local Time:
    8:50 PM
    Nginx-1.25.x
    MariaDB 10.3.x
    How can i disable it when i do not need it and avoid access from the browser?

    I want to be able to disable it and enable it :)
     
  8. eva2000

    eva2000 Administrator Staff Member

    53,821
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    well you could edit vhost with allow/deny and restart nginx server

    Code:
     location ^~ /22531_mysqladmin23762/ {
            include /usr/local/nginx/conf/php_22531_mysqladmin23762.conf;
    
            auth_basic      "Private Access";
            auth_basic_user_file  /usr/local/nginx/conf/htpassphpmyadmin;
            allow 127.0.0.1;
            deny all;
    }
    and to re-enable access comment it out and restart nginx

    Code:
            #allow 127.0.0.1;
            #deny all;
     
  9. Vishall

    Vishall New Member

    15
    10
    3
    Aug 3, 2014
    Ratings:
    +10
    Local Time:
    2:50 PM
    1.7
    MariaDB 10
    Hey guys, does this work with php version 5.5.15?
     
  10. rdan

    rdan Well-Known Member

    5,439
    1,399
    113
    May 25, 2014
    Ratings:
    +2,188
    Local Time:
    2:50 AM
    Mainline
    10.2
    Yes I think.
     
  11. Vishall

    Vishall New Member

    15
    10
    3
    Aug 3, 2014
    Ratings:
    +10
    Local Time:
    2:50 PM
    1.7
    MariaDB 10
    Thanks i'd try to install it, glad to see you over on this forum too @RoldanLT (y)
     
  12. eva2000

    eva2000 Administrator Staff Member

    53,821
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah should work for all PHP versions :D
     
  13. Vishall

    Vishall New Member

    15
    10
    3
    Aug 3, 2014
    Ratings:
    +10
    Local Time:
    2:50 PM
    1.7
    MariaDB 10
    Installed and working perfect guys, success (y)
     
  14. eva2000

    eva2000 Administrator Staff Member

    53,821
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Great to hear :)
     
  15. Afterward

    Afterward Member

    94
    29
    18
    Jul 20, 2014
    Ratings:
    +29
    Local Time:
    7:50 PM
    1.7.5
    5.5
    Im using vultr vps so the web url i got was like this:
    Code:
    https://vultr.guest/xxxx_mysqladminxxxx
    
    Instead of my domain name, is it normal?
     
  16. eva2000

    eva2000 Administrator Staff Member

    53,821
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  17. Afterward

    Afterward Member

    94
    29
    18
    Jul 20, 2014
    Ratings:
    +29
    Local Time:
    7:50 PM
    1.7.5
    5.5
  18. eva2000

    eva2000 Administrator Staff Member

    53,821
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  19. Afterward

    Afterward Member

    94
    29
    18
    Jul 20, 2014
    Ratings:
    +29
    Local Time:
    7:50 PM
    1.7.5
    5.5
    I edited virtual.conf as well yet still the same thing, im lost.
     
  20. eva2000

    eva2000 Administrator Staff Member

    53,821
    12,160
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,712
    Local Time:
    4:50 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+