Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpMyAdmin SSL configuration

I have 2 MySQL users, a regular 'tommy' and a control user 'tommy_ctl'
The Apache httpd 2.4.7 runs on 9090 for http and 9080 for https

phpMyAdmin (v4.1.6) config.inc.php file has user/password for 'tommy_ctl'
I am logging into phpMyAdmin home page as 'tommy'

Now
a) In config.inc.php
with

$cfg['Servers'][$i]['ssl'] = false;  
$cfg['ForceSSL'] = false;

I can logon to

http://linuxboxA:9090/phpMyAdmin/index.php  
https://linuxboxA:9080/phpMyAdmin/index.php

b) When I set

$cfg['Servers'][$i]['ssl'] = true; 

why does

https://linuxboxA:9080/phpMyAdmin/index.php 

on logon give the error ?:

 #1043 Cannot log in to the MySQL server  
 Connection for controluser as defined in your configuration failed  

Is this SSL option not for communication over Apache?

c) When i set

$cfg['Servers'][$i]['ssl'] = true;  
$cfg['ForceSSL'] = true;  

The https 9080 url takes many many seconds to open

https://lnappd201.hphc.org:9080/phpMyAdmin/index.php  

and on logon becomes

https://lnappd201.hphc.org/phpMyAdmin/index.php?token=23771cb3b3851979903c6eb233465fd8  

Note, that there's no port# in the redirected url

Also,

http://lnappd201.hphc.org:9090/phpMyAdmin/index.php 

becomes immediately (without any logon)

https://lnappd201.hphc.org/phpMyAdmin/?SID  

When 'ForceSSL' is set, phpMyAdmin apparently doesn't know that apache SSL is on port 9080,
so how does the ForceSSL option work?

My intention is, even if Apache is running on both the ports, I want phpMyAdmin to use SSL and ForceSSL (to Apache SSL)

like image 912
srinivas yelamanchili Avatar asked Sep 13 '26 16:09

srinivas yelamanchili


1 Answers

$cfg['Servers'][$i]['ssl'] is for communication between the web server and MySQL server.

$cfg['ForceSSL'] should force your web browser connection to phpMyAdmin to be over HTTPS.

As noted in the documentation for ForceSSL, enabling it in certain configurations (I suspect a nonstandard https port may apply) will require you to set $cfg['PmaAbsoluteUri'] so phpMyAdmin knows what port to use.

Hope that helps!

like image 107
Isaac Bennetch Avatar answered Sep 16 '26 06:09

Isaac Bennetch