PHPMyAdmin Logging In Issue using Ubuntu 20.04 Perfect Server Instructions

Discussion in 'Installation/Configuration' started by koltz, Jul 21, 2021.

  1. koltz

    koltz Member

    I set up three different servers using the method and everything seems to work fine except when trying to go to the URL of phpmyadmin, I get this error, "Failed to set session cookie. Maybe you are using HTTP instead of HTTPS to access phpMyAdmin."

    I can only get to phpMyAdmin via HTTP and not HTTPS and wondering how I can change that. I would actually like to have it assigned to port 8080 like ISPConfig does if possible so I can restrict access to it from IP addresses other than those set in the server firewall.

    So currently, I can only get to phpMyAdmin via http://domainname.com/phpmyadmin and when I try to log in, I get the following error, "Failed to set session cookie. Maybe you are using HTTP instead of HTTPS to access phpMyAdmin."

    I would like to change it to https or better yet, :8080/phpmyadmin if possible.
     
  2. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    What tutorial did you follow? (eg. what webserver do you use?) I have restricted access to phpmyadmin (on a dedicated control panel node in our case) by creating an apache config file (/etc/apache2/conf-enabled/local.conf):
    Code:
    # local (to this server) config snippets
    
    # This is cp.domain.com, phpmyadmin is useful but we restrict access to only admin ip addrs
    # (restrictions are under <Files> because ispconfig grants access in later config file)
    <Directory /usr/share/phpmyadmin>
            <Files '*'>
                    <RequireAny>
                            Require host my.hostname.tld
                            Require ip 11.22.33.44
                            Require ip 1.2.3.4/27
                            Require all denied
                    </RequireAny>
            </Files>
    </Directory>
    
    That doesn't change your non-https issue, but it's hard to troubleshoot that without more info.
     
  3. koltz

    koltz Member

    Ubuntu 20.04 Perfect Server is the tutorial on How to Forge. I use that How To with some modifications which aren't related to PHP/phpMyAdmin. It is the same on all of these servers though if it helps, the installation is on AWS version of Ubuntu 20.04. My first problem I want to resolve is getting the cookie login working. I can switch the auth_type in the config.inc.php from cookie to http and I can log in but it doesn't come up with the phpMyAdmin screen, but a pop-up window.
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Yes, sorry, there is usually one for apache and one for nginx, hence my question, but it looks like there is currently only an apache version for ubuntu 20.04 at the moment, so I'll go with that.
    This should work out of the box in apache. I believe nginx uses an alternate port (the "apps vhost"), but not apache.
    My guess is you already have secure cookies set for this cookie path, so accessing it via http refuses to overwrite those cookies. Try incognito mode or a different browser.
    What happens when you access https://whatevername.tld:8080/phpmyadmin/ ?
     
  5. koltz

    koltz Member

    Yeah, sorry, Apache. I never enjoyed using NGINX. For the URL, it doesn't load, I have to do http://phpmyadmin, no 8080, no https.
    I did research the issue on the internet and tried different browsers and incognito mode. All the same. Only thing I didn't try was an older browser as I don't have one. All recently updated.
     
  6. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Not sure what that means, the server drops the connection with no output or ?? Try the request from the command line or open your browser devtools window and see what the actual response from the server is. It should at least send HTTP headers, even if there is an error, unless I suppose it fails at the ssl level. You can use openssl from the cli to troubleshoot the ssl connection (eg. some clues will be in "openssl s_client -connect servername.tld:8080 -servername servername.tld")
     
  7. koltz

    koltz Member

    What I meant was I get the standard "This site can't be reached" message in Chrome.

    Well strangely what wasn't working yesterday is working today. So I either typed something in wrong or it magically started working.

    I can still get to phpMyAdmin via standard port 80/http, http://servername.tld/phpmyadmin. I can I disable this and have it only load via port 8080?
     
  8. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Sure. If I remember correctly you just have to disable it (phpmyadmin.conf) that you enabled after setting up PMA.
     

Share This Page