phpmyadmin vhost issue

Discussion in 'General' started by Martin Berard, Oct 17, 2018.

  1. Martin Berard

    Martin Berard New Member

    Hi,
    I recently installed ispconfig and find out how amazing it is!

    I have my first issue which I'm unable to find a solution for. I have a followed the Debian 9 nginx perfect server tutorial. I din't find in it how to add a vhost for phpmyadmin but managed to find it in the ubuntu tutorial. So here is my added nginx configuration for phpmyadmin
    #phpMyAdmin
    location /phpmyadmin {
    root /usr/share/;
    index index.php index.html index.htm;
    location ~ ^/phpmyadmin/(.+\.php)$ {
    try_files $uri =404;
    root /usr/share/;
    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
    fastcgi_param HTTPS $https; # <-- add this line to serve both http and https
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    include /etc/nginx/fastcgi_params;
    fastcgi_param PATH_INFO $fastcgi_script_name;
    fastcgi_buffer_size 128k;
    fastcgi_buffers 256 4k;
    fastcgi_busy_buffers_size 256k;
    fastcgi_temp_file_write_size 256k;
    fastcgi_intercept_errors on;
    }
    location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
    root /usr/share/;
    }

    when I go to myhost.tld/phpmyadmin, I get the authentication prompt. But as soon as I log in, I'm been redirected to
    myhost.tld/index.php?token=9665e18fb7800e50867494e1813d1c0d which obviously give me an error 404. If I had manually myhost.tld/phpmyadmin/index.php?token=9665e18fb7800e50867494e1813d1c0d I'm fine during the seesion until I logout.

    Thanks for helping

    Martin
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. Catbodi

    Catbodi New Member

    I'm also using ISPConfig and Debian. Is it safe if we have phpmyadmin loading from nginx and a symlink? I didn't want the phpmyadmin to be on 8081 or have the name "phpmyadmin" so I closed 8081 in firewall and in the ispconfig.vhost I uncommented the /phpmyadmin section (commented by default) and changed the /usr/share/phpmyadmin to /usr/share/dbadmin (new symlink that i created). Everything is working perfectly. Is this procedure safe? (I also added the new ispconfig.vhost to the conf-custom/install folder under name nginx_ispconfig.vhost.master.

    One problem I'm getting is that I can't get phpmyadmin to showing error for blowfish secret, I tried two ways to fix:

    rename /usr/share/phpmyadmin/config.sample.inc.php to config.inc.php and inserted blowfish_secret still didn't work
    also I tried putting it in /var/lib/phpmyadmin/blowfish_secret.inc.php and it STILL is asking. what to do?
     
  4. webguyz

    webguyz Active Member HowtoForge Supporter

    PHP:
      location /phpmyadmin {
                   
    root /usr/share/;
                   
    index index.php index.html index.htm;
                   
    location ~ ^/phpmyadmin/(.+\.php)$ {
                           
    try_files $uri =404;
                           
    root /usr/share/;
                           
    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
                           
    fastcgi_param HTTPS $https# <-- add this line
                           
    fastcgi_index index.php;
                           
    fastcgi_param SCRIPT_FILENAME $request_filename;
                           include /
    etc/nginx/fastcgi_params;
                         
                   }
                   
    location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                           
    root /usr/share/;
                   }
            }
            
    location /phpMyAdmin {
                   
    rewrite ^/* /phpmyadmin last;
            }
    Had the same problem and removed this from my snippet:

    fastcgi_param PATH_INFO $fastcgi_script_name;
    fastcgi_buffer_size 128k;
    fastcgi_buffers 256 4k;
    fastcgi_busy_buffers_size 256k;
    fastcgi_temp_file_write_size 256k;
    fastcgi_intercept_errors on;

    Now it works when I login from one of my websites.
     
  5. Catbodi

    Catbodi New Member

    Does yours show the blowfish error?
     
  6. ahrasis

    ahrasis Well-Known Member

    Should be. I symlinked it to other name too and it works just fine.

    I always use the latest PMA and replacing the default install with it normally shows severral errors including that. Google around and you should find its solution.
     
  7. webguyz

    webguyz Active Member HowtoForge Supporter

    No Blowfish error.
     

Share This Page