Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to run phpmyadmin using my SSL certificate.

I read that if I placed the following within the file: /etc/phpmyadmin/, it would force it to use SSL. And now it does...

$cfg['ForceSSL'] =true;

However, my issue is when I did this, now I get an error stating "cannot connect to server."

I do a port scan and my port 443 is closed for one, but I am connecting via https:// for my secure web based email admin panel. This tells me this may not be the issue. Second, is that I have a SSL certificate I purchased but I am not sure how to apply this cert. is sitting on my desktop, how should I be utilizing this?

I remember creating a self signed cert for my web-email access. Do I have to do this for phpmyadmin as well? At least this way, since I am the only one who will ever access the DB, it will never expire.

Also the phpmyadmin used to come up as: http://mydomain/phpmyadmin/ however, I do not have any pages on my website that requires https:// .

share|improve this question
This is not a problem with phpMyAdmin but with your webserver. What webserver are you using? – Lekensteyn Mar 17 '11 at 22:25
I am running Apache 2.x on Ubuntu 10.04 lts – Ubuntu User Mar 17 '11 at 22:40
up vote 0 down vote accepted

Ok I found the answer to this question.

  1. I had to turn on ssl by typing in on command line: sudo a2enmod ssl
  2. Then type in sudo a2ensite default-ssl
  3. go to /etc/apache2/sites-available/defaultssl file and put in the pointer to the site I want the SSL to run. In my case it was /var/www/mydomain/phpmyadmin, then I had to make sure the following was also enabled in the file (but using my own location where my certificate resided). Use only 1 certificate for the server to avoid conflict (so I copied the same cert I am using for my webmail to another directory and used that path/files

SSLEngine on

SSLOptions +StrictRequire

SSLCertificateFile /etc/ssl/myfolder/mycert.csr

SSLCertificateKeyFile /etc/ssl/myfolder/mycert.key

Then restarted apache2 with sudo /etc/init.d/apache2 restart

Then it worked. But one thing to also add. I am using my own private certificate, so anyone who tries to go to my site by https:// they will get a message stating that the certificate is not signed and cannot be trusted. Once I decide to go to a valid certificate, I will need to figure out how to port my current 5 year SSL cert I purchased from godaddy (which I already CSR'd into a crt file for my new server and put it to use. That is another thing I need to do next.

Additional resource for help: here is a good link where I read up on getting it to work.

share|improve this answer
csr is a request file. This is not the file you need. You need the certificate file, probably ending on .crt. – danger89 Jul 20 '15 at 14:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.