Jump to content

Alteração de caminho do PHPMyAdmin


Thiago Santos

Recommended Posts

Olá pessoal, estou precisando de uma luz.

Estou tentando alterar a URL do PHPMyAdmin, uma configuração simples que sempre executei, mas tenho um servidor que não me deixa em paz, por mais que eu tente encontrar o problema, ele não altera.

Pra resumir, preciso alterar a URL de ip-do-server/phpmayadmin para ip-do-server/outracoisa

Eu segui arrisca o tutorial: https://www.tecmint.com/change-secure-phpmyadmin-login-url-page/ Não surtiu efeito.

O servidor roda nginx, então também alterei o arquivo default, veja como está agora:

server {
    listen   80;

    root /var/www/html;
    index index.html index.htm index.php;

    server_name   domain.com;

    location / {
            try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
      fastcgi_pass unix:/run/php/php7.0-fpm.sock;
      #fastcgi_pass 127.0.0.1:9002;
      include         fastcgi_params;
      fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
      fastcgi_param   SCRIPT_NAME        $fastcgi_script_name;

    }

    location ~ /\.ht {
            deny all;
    }

    location /phpmyadmin {
          root /usr/share/;
          index index.php;
          try_files $uri $uri/ =404;
location ~ ^/phpmyadmin/(doc|sql|setup)/ {
            deny all;
         }

         location ~ /phpmyadmin/(.+\.php)$ {
           fastcgi_pass unix:/run/php/php7.0-fpm.sock;
           fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
           include fastcgi_params;
           include snippets/fastcgi-php.conf;
        }
    }

    location /base {
    alias   /usr/share/phpmyadmin/;
    index index.php;
    location ~ /([^/]+\.php)$ {
        try_files /$1 =404;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        location ~ /phpmyadmin/js/([^/]+\.php)$ {
            try_files /phpmyadmin/js/$1 =404;
            fastcgi_pass unix:/run/php/php7.0-fpm.sock;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }
    }
}

}

Qualquer alteração que eu faça nos "location" para o /qualquercoisa ele dá erro 404 ou "File not found". Sabem me dar uma luz onde eu estou errando?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Do you agree with our terms?