Join the community today
Become a Member

phpmyadmin.sh Addon

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

  1. CrumX

    CrumX New Member

    5
    1
    3
    Sep 22, 2014
    Ratings:
    +1
    Local Time:
    10:22 AM
    [crit] 2418#0: *10 connect() to unix:/tmp/phpfpm_myadmin.sock failed (13: Permission denied) while connecting to upstream, client: <ip here>, server: <hostname here>, request: "GET /22399_mysqladmin4181/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/phpfpm_myadmin.sock:", host: "<hostname here>"


    I got such error and I'm out of idea what to do next, any advice?
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    1. what version of Centmin Mod ?
    2. how old was the initial installation of it ?
    3. how old is the initial phpmyadmin.sh addon installation ?
    4. contents of /usr/local/nginx/conf/phpfpmd/phpfpm_myadmin.conf file - latest install code should have the following options set and uncommented (without front semicolon ;)
    Code:
    user = phpmyadmin
    group = nginx
    
    listen.owner=phpmyadmin
    listen.group=nginx
    on older installers the listen owner and group were not uncommented so they caused permission denied errors like yours. If commented out with semicolon ;, remove the semicolon and save file and restart Nginx and PHP-FPM you can do that for both using Centmin Mod shortcut command

    Code:
    nprestart
     
  3. CrumX

    CrumX New Member

    5
    1
    3
    Sep 22, 2014
    Ratings:
    +1
    Local Time:
    10:22 AM
    what version of Centmin Mod ?
    The latest available version

    how old was the initial installation of it ?
    Maybe less than 24 hour before I start the thread

    how old is the initial phpmyadmin.sh addon installation ?
    As soon as Centmin Mod installation done

    Code:
    [phpmyadmin]
    user = phpmyadmin
    group = nginx
    
    ;listen = 127.0.0.1:9001
    listen = /tmp/phpfpm_myadmin.sock
    listen.allowed_clients = 127.0.0.1
    I find that I didn't have
    Code:
    listen.owner=phpmyadmin
    listen.group=nginx
    so i add it on the conf file and do the nprestart and open it again..

    Code:
    2014/09/22 01:24:38 [crit] 6533#0: *2 connect() to unix:/tmp/phpfpm_myadmin.sock failed (2: No such file or directory) while connecting to upstream, client: <myip>, server: <myhostname>, request: "GET /28590_mysqladmin2193/ HTTP/1.1", upstream: "fastcgi://unix:/tmp/phpfpm_myadmin.sock:", host: "<myhostname>"
    [root@server ~]# date
    Mon Sep 22 01:36:52 UTC 2014
    [root@server ~]#
    
    Still have the same result 502 bad gateway.
     
    Last edited: Sep 22, 2014
  4. CrumX

    CrumX New Member

    5
    1
    3
    Sep 22, 2014
    Ratings:
    +1
    Local Time:
    10:22 AM
    So I check again on phpmyadmin_https.conf and it appear that allow 127.0.0.1 has been commented so I removed it and it work like a charm now. Thanks for the help.
    Code:
            auth_basic      "Private Access";
            auth_basic_user_file  /usr/local/nginx/conf/htpassphpmyadmin;
            allow 127.0.0.1;
            #allow 175.138.232.197;
            #deny all;
    }
    
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    thanks for the info, did you have default STATICIP='n' or changed to STATICIP='y'

    strange as those 2 options are available if you used the official addon repo at phpmyadmin/phpmyadmin.sh at master · centminmod/phpmyadmin · GitHub

    edit: I think I know what the problem was.. you accessing phpmyadmin url from a client machine that is 127.0.0.1 as opposed to a separate computer ? if you are browsing via 127.0.0.1 then yes it would be blocked.

    can you double check and comment out 127.0.0.1 again and see if it gives you an error ?
     
    Last edited: Sep 22, 2014
  6. CrumX

    CrumX New Member

    5
    1
    3
    Sep 22, 2014
    Ratings:
    +1
    Local Time:
    10:22 AM
    STATICIP='n'

    I access phpmyadmin from my own laptop not from the client machine. After I disable 127.0.0.1, I have the same problem again not being able to access the phpmyadmin. My guess is that if you disable 127.0.0.1 it will block phpmyadmin which cause sock fail.

    I hope there is more input from other user to back up this finding.
     
  7. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    thanks for the info

    I just tested and don't have that problem as usually folks browsing phpmyadmin come from non-127.0.0.1 access from their client and without the line deny all further below which is commented out, you shouldn't be blocked anyway.
     
  8. Josephm

    Josephm Active Member

    132
    44
    28
    Aug 26, 2014
    Ratings:
    +48
    Local Time:
    9:22 AM
    1.9.5
    10.0.21
    Hi @eva; can you share your own current practice for administrating SQL with GUI?
    I asked this because I'd like to centminmod. However; it seems that there is not another solution like phpmyadmin. Anyways I do not like to install phpmyadmin in same server as I worry about security...
     
  9. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    I don't use a gui for mysql - it's all done via SSH command line from mysql client tools as per MySQL MariaDB performance drop in replacement on Centmin Mod - Menu based Nginx installer for CentOS servers option 1

    my mysqlmymonlite.sh has a few options I do use for showtable, show index and other mysql related stats and info mysqlmymonlite.sh Addon | Centmin Mod Community
     
  10. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  11. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  12. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Updated phpmyadmin addon to correct the phpmyadmin bug that mistakenly gives you https navigational access to the full main hostname as opposed to https only for phpmyadmin url. For existing phpmyadmin addon users to fix this, edit /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf and

    change
    Code:
      location / {
    
    
      }
    to
    Code:
        location / {
            return 302 http://$server_name$request_uri;
        }
        
    and comment out include /usr/local/nginx/conf/php.conf line

    Code:
    #include /usr/local/nginx/conf/php.conf;
    or you can uninstall phpmyadmin addon and reinstall it again

    uninstall
    Code:
    /root/tools/phpmyadmin_uninstall.sh
     
    Last edited: Jul 9, 2015
  13. pamamolf

    pamamolf Premium Member Premium Member

    4,074
    427
    83
    May 31, 2014
    Ratings:
    +833
    Local Time:
    4:22 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    I uninstall it and install again and all working great but i just got a notice:

    Code:
    nginx: [emerg] "fastcgi_pass" directive is duplicate in /usr/local/nginx/conf/php_15396_mysqladmin5546.conf:8
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
    I can see that the parameter is duplicated and i just comment the second one and is ok now....

    Code:
        fastcgi_pass phpbackend;
        fastcgi_keep_conn on;
        # fastcgi_pass   unix:/tmp/phpfpm_myadmin.sock;
     
    Last edited: Jul 9, 2015
  14. pamamolf

    pamamolf Premium Member Premium Member

    4,074
    427
    83
    May 31, 2014
    Ratings:
    +833
    Local Time:
    4:22 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    Also the recommended web url never works for me:

    Code:
    https://server.mydomain.com/15396_mysqladmin5546
    I am getting
    This webpage is not available
    DNS_PROBE_FINISHED_NXDOMAIN

    Instead i use:
    Code:
    https://serverip/15396_mysqladmin5546
    I also check that after uninstalling and installing phpmyadmin the code in location / is wrong:
    Code:
        location / {
            return 302 http://;
        }
    
      include /usr/local/nginx/conf/phpmyadmin_https.conf;
      include /usr/local/nginx/conf/staticfiles.conf;
      #include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      include /usr/local/nginx/conf/errorpage.conf;
    }
    so i manually edit it to:
    Code:
        location / {
            return 302 http://$server_name$request_uri;
        }
    and then i restart nginx and phpfpm and it works again with the ip only...

    Thanks
     
    Last edited: Jul 9, 2015
  15. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    post contents of your /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf you can mask the phpmyadmin urlname

    did you setup dns for server.mydomain.com as per?
    my bad, need to update phpmyadmin code BRB

    edit: fixed update fix phpmyadmin.sh · centminmod/phpmyadmin@f536417 · GitHub
     
  16. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    oh that is because you setup multiple php-fpm pools which isn't accounted for in phpmyadmin.sh installer

    so yes manually commenting out the duplicate is the solution
     
  17. pamamolf

    pamamolf Premium Member Premium Member

    4,074
    427
    83
    May 31, 2014
    Ratings:
    +833
    Local Time:
    4:22 AM
    Nginx-1.25.x
    MariaDB 10.3.x
    In /etc/hosts i was use old entry for server.mydomain.com ...

    I edit it and now it works :)
     
  18. bloop

    bloop New Member

    12
    1
    3
    Jul 13, 2015
    Ratings:
    +1
    Local Time:
    12:22 PM
    Hello, I recently installed this addon and I was getting the 502 gateway error.
    Just wanted to note that I had to manually add the below to phpfpm_myadmin.conf for it to work properly. I have the latest addon installed and static ip set to Yes.

    Code:
    listen.owner=phpmyadmin
    listen.group=nginx
    
     
  19. eva2000

    eva2000 Administrator Staff Member

    54,098
    12,177
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,735
    Local Time:
    12:22 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Strange as phpmyadmin.sh addon does add those lines on lines 390-391 of the phpfpm_myadmin.conf file

    if you uninstall
    Code:
    /root/tools/phpmyadmin_uninstall.sh
    then reinstall can you confirm if phpfpm_myadmin.conf is missing those 2 lines ?
     
  20. bloop

    bloop New Member

    12
    1
    3
    Jul 13, 2015
    Ratings:
    +1
    Local Time:
    12:22 PM
    hi eva, i'll try this tomorrow and let you know.