phpMyAdmin with Cloudflare - problem

Having some problems using phpMyAdmin through Cloudflare.

Got Cloudflare’s “Dedicated certificate” and set the SSL to “Full (strict)”.
I have a site (www.mydomain.com) and a subdomain (https://subdomain.mydomain.com). Both work fine.

phpMyAdmin is installed in a separate directory on my host. It used to be accessed via:
http://phpmyadmin.mydomain.com

That no longer works. :frowning:
When I copy the phpMyAdmin directory inside a website directory, it can be accessed like this:
https://www.mydomain.com/phpmyadmin

However, I don’t like this setup, for some reason - would prefer to keep using it from a separate directory.

What I tried was setting up Cloudflare DNS:
A phpmyadmin - pointing to the IP address of the host, just like other DNS records in Cloudflare (mydomain, subdomain etc.).

Bought the SSL certificate AFTER setting up all these DNS records in Cloudflare, and it says the cert covers *.mydomain.com.

I can access phpMyadmin when I switch off “Always use HTTPS” in Crypto options, but then I’m accessing phpMyadmin without https - don’t like that too much. If that’s on, I can’t. It shows Error 526 - invalid certificate.

I can also access it, with https when it’s copied in the folder of the website (mydomain.com/phpmyadmin).

Something seems to be wrong with the redirect on your server.

How ever. Create a page rule like this

Yes, correct.

Means that Cloudflare can’t validate your origin certificate.
Ensure your server has a valid certificate for your domain (issued through trusted CA, not expired…)
I can imagine that the vHost for phpMyAdimin uses a different cert

You can verify this quickly by setting SSL from Full(Strict) to Full. If you diont’ want to change it for your entire zone use a… page rule for it :wink:

1 Like

Thanks for the reply.

I’m out of the (three free) page rules. :frowning:
Used two rules to stop caching when updating the (wordpress) site, and the third one is for the mess with the change of the subdomain address - to enable old links to still work.

Not that I’d be happy solving it that way even if I had some left.

mydomain.com/phpmyadmin works.
However, correct me if I’m wrong, that means it has to be coppied inside the mydomain.com directory. Don’t like that.

phpmyadmin.mydomain.com exists as a directory and works without the Cloudflare. I want to enable it to work with the Cloudflare. And to point at that same location.

Did I explain my problem clearly - new to this, not sure yet with all the terms. :confused:

I’ll check if I have a server with PHPMyAdmin running. Usually I don’t use it. IIRC it’s not installed to the web root. I may be wrong.

I’ll edit this post when I found one. Or not ^^

1 Like

Thinking out loud - and guessing.

I set the phpmyadmin in Cloudflare DNS section.
After that i bougth the Cloudflare SSL “Dedicated SSL certificate”.
Was it stupid not to have waited a few days for the DNS to “start working”? Thinking if that could be the cause - can’t figure any other reason why it would work, but not with https and give the “invalid certificate” error with https. :confused:

I had thought - it’s a DNS “rule” in Cloudflare’s DNS field, and I’m requesting a SSL from Cloudflare, so it will work right away - maybe that was a mistake.

Like said, just thinking out loud, really not sure what the cause of the problem is. From this point of view and the (little) knowledge I have - don’t see why else it won’t work.

Oh, some more info, if it helps:

There’s no SSL on my host server. The only cert. is the Cloudflare’s one. And it works fine for the

https://subdomain.mydomain.com

It also works when phpMyAdmin is copied inside mydomain.com - like:
www.mydomain.com/phpmyadmin

Just won’t give me
https://phpmyadmin.mydomain.com,
except when I turn off “Always use HTTPS” in Cloudflare. Then I can access it through:
http://phpmyadmin.mydomain.com

Then SSL should not work at all on "Full (Strict). It has to be “Flexible”

1 Like

But it does work - with strict. At least for the webiste and the subdomain.
I guess Cloudflare could be using host provider’s SSL to communicate wit the server, although I didn’t buy, nor install any SSL on the host for my site - just at the Cloudflare? :confused:

If host cert were the problem, even the website wouldn’t work with “Full (strict)” setting, would it?

A bit wiser now. Not 100% sure it will work - not until it is tested. Anyway:

My host gives free SSL to all the registered domains and subdomains. That SSL is recognized by Cloudflare. That is why Full (strict) encryption setting works.

The reason why newly added subdomains won’t work is because the host renews certificates in 30 (or 90, not sure) day intervals. At the next host certificate renewal, newly created subdomains will get their certificates, so they too should work too.

I hope.

That just doesn’t sound right. Usually, new additions get a certificate provisioned upon creation. And then they fall into the periodic renewal. Have you asked them about SSL provisioning delays?

1 Like

As for the host - checked. No certs after creation.

However, when checking that, I saw that an old “test” domain, had been previously created. It has a valid certificate at the host. It’s also set up with Cloudflare as well.

When I upload a simple, test index.html, or test.html, it won’t work.
Not like: https://test_subdomain.domain.com,
nor like: https://test_subdomain.domain.com/test.html

Returns Error 526 - invalid SSL certificate.

When I set SSL/TLS to Full (not strict), it returns a “c-panel” error "contact the administrator of test_subdomain.domain.com - site has been moved, or server is not configured correctly.

When I set SSL/TLS to off - then it returns 404. page not found error.

:frowning:

You should back up a step and go to Cloudflare DNS and set that domain to :grey: while you sort it out. With :grey:, it goes straight to the server, so you can get a better idea of what your server’s SSL configuration is.

With it set to :grey:, try HTTPS in your browser, and also try HTTP. Let us know how that goes.

1 Like

phpMyAdmin uses their own Self-Signed Cert, and when you have Crypto set to Full Cloudflare says invalid as it is SelfSigned (not trusted by Cloudflare).

Not sure your server setup but find the phpMyAdmin config file and point the SSL settings to your Cloudflare cert.

go here: Configuration — phpMyAdmin 5.1.4 documentation
and search for SSL it will show you how

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.