Learn about Centmin Mod LEMP Stack today
Register Now

phpmyadmin access denied

Discussion in 'Add Ons' started by alan, Dec 25, 2016.

  1. alan

    alan New Member

    15
    4
    3
    Dec 16, 2016
    Ratings:
    +5
    Local Time:
    10:57 PM
    Do not know why.
    But after some changes to nginx/php, pma can not be accessed.
    I have reinstalled it, but still got below error.

    2016/12/24 20:40:39 [error] 26943#26943: *23 FastCGI sent in stderr: "Access to the script '/usr/local/nginx/html' has been denied (see security.limit_extensions)" while reading response header from upstream, client: 175.156.121.15, server: hostad.yousite.com, request: "GET /17911_mysqladmin23345/ HTTP/2.0", upstream: "fastcgi://unix:/tmp/phpfpm_myadmin.sock:", host: "hostad.yousite.com"
     
  2. alan

    alan New Member

    15
    4
    3
    Dec 16, 2016
    Ratings:
    +5
    Local Time:
    10:57 PM
    just found I can not access mysql as well. Access denied.
    Very strange.

    ● mariadb.service - MariaDB database server
    Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
    └─migrated-from-my.cnf-settings.conf, protecthome.conf
    Active: failed (Result: exit-code) since Sat 2016-12-24 21:41:41 UTC; 3min 17s ago
    Process: 30108 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 993 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
    Process: 749 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
    Process: 747 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Main PID: 993 (code=exited, status=1/FAILURE)
    Status: "MariaDB server is down"
     
    Last edited: Dec 25, 2016
  3. SFLC

    SFLC Active Member

    224
    59
    28
    Dec 4, 2016
    The Canadas
    Ratings:
    +112
    Local Time:
    4:57 PM
    1
    10
    change the mysql password from the centmin menu and try to connect to sql from the command line first

    mysql -u root -p

    if you cant login there then your problems go much deeper

    also when installing phpmyadmin, are you using the sh tool from the centmin addons folder, if so are you choosing the correct option when asked if you have a static ip as that doesnt apply to your servers ip, but the ip that you use to connect ie your home computer
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    12:57 AM
    Nginx 1.13.x
    MariaDB 5.5
    what changes specifically did you do to nginx and php ? could you outline them ?

    that error says MariaDB mysql server is down and not running, so try starting the service
    Code (Text):
    service mysql start
    

    or
    Code (Text):
    systemctl start mariadb
    

    or
    Code (Text):
    mysqlstart
    
     
    • Like Like x 1
  5. alan

    alan New Member

    15
    4
    3
    Dec 16, 2016
    Ratings:
    +5
    Local Time:
    10:57 PM
    now I have restarted mysql server and it's ok.
    But pma still access denied.
    The only change I think related to pma is that I set php pathinfo=0.

    I got following localhost error

    2016/12/25 06:24:41 [error] 8053#8053: *237 FastCGI sent in stderr: "Access to the script '/usr/local/nginx/html' has been denied (see security.limit_extensions)" while reading response header from upstream, client: 175.156.121.15, server: hostad.yousite.com, request: "GET /17911_mysqladmin23345/ HTTP/2.0", upstream: "fastcgi://unix:/tmp/phpfpm_myadmin.sock:",
     
  6. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    12:57 AM
    Nginx 1.13.x
    MariaDB 5.5
    Reverse that change
     
  7. alan

    alan New Member

    15
    4
    3
    Dec 16, 2016
    Ratings:
    +5
    Local Time:
    10:57 PM
    but my website app require cgi.fix_pathinfo = 0
     
  8. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,784
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,135
    Local Time:
    12:57 AM
    Nginx 1.13.x
    MariaDB 5.5
    that will break php-fpm for alot of web apps ! what web app you using ?

    see Is the PHP option 'cgi.fix_pathinfo' really dangerous with Nginx + PHP-FPM?

    Centmin Mod PHP-FPM is properly secured as per official Nginx wiki documentation PHP FastCGI Example | NGINX and doesn't require cgi.fix_pathinfo disabled

    each vhost include file for /usr/local/nginx/conf/php.conf top portion
    Code (Text):
    location ~ [^/]\.php(/|$) {
      include /usr/local/nginx/conf/503include-only.conf;
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return 404;
        }
        fastcgi_pass   127.0.0.1:9000;
     
    Last edited: Dec 25, 2016
  9. alan

    alan New Member

    15
    4
    3
    Dec 16, 2016
    Ratings:
    +5
    Local Time:
    10:57 PM
    ok, noted. problem solved.
    Thanks
     
    • Like Like x 1