Koozali.org: home of the SME Server

Obsolete Releases => SME 9.x Contribs => Topic started by: DanB35 on December 12, 2014, 11:37:50 PM

Title: [SOLVED] Can't log in to phpmyadmin
Post by: DanB35 on December 12, 2014, 11:37:50 PM
I've installed smeserver-phpmyadmin following http://wiki.contribs.org/PHPMyAdmin on my SME 9.0 server.  Installation went without issues, I did signal-event post-upgrade and signal-event reboot, and now I don't seem to be able to log in.  I have not changed any of the default settings.

When I browse to myserver/phpmyadmin, I first get a popup HTTP authentication window asking for a username and password.  I enter admin and the server's admin password.  I'm then taken to the phpMyAdmin login page, where it again asks for a username and password.  I again enter admin and the server admin password, and click Go.  The screen refreshes with a red box near the top saying "#1045 Cannot log in to the MySQL server."  There are no entries in /var/log/messages or /var/log/mysqld/current that seem related.

"config show phpmyadmin" shows a property of DbPassword with a lengthy, random value.  /root/.my.cnf has a lengthy random password as well, but it doesn't match the one shown for DbPassword.  When I do "mysql -u root -p" and enter the first password, it doesn't work; when I enter the password in /root/.my.cnf it does (as expected).  I suspect this is the source of the problem.

The simple answer, I think, is to do "config setprop phpmyadmin DbPassword <password from /root/.my.cnf>".  Is there a reason I shouldn't do this?
Title: Re: Can't log in to phpmyadmin
Post by: stephdl on December 13, 2014, 12:10:32 AM
not sure that phpmyadmin is in fault, check if the the group apache gets the correct ownership

here my output

[root@sme9 ~]# groups apache
apache : www backuppc
[root@sme9 ~]# id apache
uid=102(www) gid=102(www) groupes=102(www),393(backuppc)
[root@sme9 ~]# cat /etc/group|grep apache
apache:x:102:
backuppc:x:393:apache
[root@sme9 ~]# ll /usr/bin/pwauth
-rwsr-x--- 1 root www 7820  5 juin   2013 /usr/bin/pwauth

the correct password for the admin authentication is the admin password of your smeserver, but I have done a power user in phpmyadmin  'sqladmin' whose the password is registered in the db of phpmyadmin

the admin authentification is done with apache and pwauth
the sqladmin is a pure phpmyadmin authentication and needs to enable the multi-user access.

I suppose that your sme9 is restored from a backup of sme8 ?
Title: Re: Can't log in to phpmyadmin
Post by: DanB35 on December 13, 2014, 01:44:53 AM
Yes, my server was restored from SME 8.1.

Code: [Select]
[root@e-smith ~]# groups apache
apache : www
[root@e-smith ~]# id apache
uid=102(apache) gid=102(www) groups=102(www)
[root@e-smith ~]# grep apache /etc/group
apache:x:48:
[root@e-smith ~]# ll /usr/bin/pwauth
-rwsr-x--- 1 root www 11032 Jun  4  2013 /usr/bin/pwauth

Title: Re: Can't log in to phpmyadmin
Post by: sages on December 13, 2014, 06:27:26 AM
Same issue.
My server was restored from sme 8.1
Code: [Select]
[root@fwbox ~]# groups apache
apache : www
[root@fwbox ~]# id apache
uid=102(apache) gid=102(www) groups=102(www)
[root@fwbox ~]# cat /etc/group|grep apaches
[root@fwbox ~]# cat /etc/group|grep apache
apache:x:102:
[root@fwbox ~]# ll /usr/bin/pwauth
-rwsr-x--- 1 root www 11032 Jun  5  2013 /usr/bin/pwauth
If I used the password from /etc/phpMyAdmin/config.inc.php

Code: [Select]
# standalone login part
if ($scriptpath=="/phpmyadmin/" && $_SERVER['PHP_AUTH_USER']=='admin')
{
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password']  = 'this password worked';
}
# end of  standalone login part

then I could log in. It is as though either the config.inc.php isn't parsed by phpMyAdmin or the code isn't being executed for some reason.
Title: Re: Can't log in to phpmyadmin
Post by: stephdl on December 13, 2014, 09:51:42 AM
Yes, my server was restored from SME 8.1.

Code: [Select]
[root@e-smith ~]# groups apache
apache : www
[root@e-smith ~]# id apache
uid=102(apache) gid=102(www) groups=102(www)
[root@e-smith ~]# grep apache /etc/group
apache:x:48:
[root@e-smith ~]# ll /usr/bin/pwauth
-rwsr-x--- 1 root www 11032 Jun  4  2013 /usr/bin/pwauth

you have the bug http://bugs.contribs.org/show_bug.cgi?id=8549

Code: [Select]
groupmod -o -g 102 apacheif you have tricked the phpmyadmin db, please remove the rpm, remove the phpmyadmin mysql database, remove the phpmyadmin db and then reinstall phpmyadmin, else restart your server
Title: Re: Can't log in to phpmyadmin
Post by: stephdl on December 13, 2014, 10:08:32 AM
Same issue.
My server was restored from sme 8.1
Code: [Select]
[root@fwbox ~]# groups apache
apache : www
[root@fwbox ~]# id apache
uid=102(apache) gid=102(www) groups=102(www)
[root@fwbox ~]# cat /etc/group|grep apaches
[root@fwbox ~]# cat /etc/group|grep apache
apache:x:102:
[root@fwbox ~]# ll /usr/bin/pwauth
-rwsr-x--- 1 root www 11032 Jun  5  2013 /usr/bin/pwauth
If I used the password from /etc/phpMyAdmin/config.inc.php

Code: [Select]
# standalone login part
if ($scriptpath=="/phpmyadmin/" && $_SERVER['PHP_AUTH_USER']=='admin')
{
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password']  = 'this password worked';
}
# end of  standalone login part

then I could log in. It is as though either the config.inc.php isn't parsed by phpMyAdmin or the code isn't being executed for some reason.

??

you are saying that in the prompt of apache authentication you gave the mysql password that you cant retrieve in /etc/openldap/ldap.pw with the user admin.

That's is not possible :/

where have you used this password, in the phpmyadmin prompt ?, what is the user you gave ?

here ownership of my configuration file

# ll /etc/phpMyAdmin/config.inc.php
-rw-r----- 1 root www 3224  8 déc.  20:43 /etc/phpMyAdmin/config.inc.php
Title: Re: Can't log in to phpmyadmin
Post by: sages on December 13, 2014, 10:41:42 AM
Initial logon at the apache prompt is:
username: admin
password: my servers admin password

This brings up the logon screen from myphpadmin
If I try and login to myphpadmin using the above credentials it fails as per the original post "#1045 Cannot log in to the MySQL server."

If I then logon onto the phpmyadmin using:
username: root
password: password from /etc/myphpadmin/config.inc.php $cfg['Servers'][$i]['password']  = 'this password worked';
I can login to myphpadmin

Code: [Select]
[root@fwbox ~]# ll /etc/phpMyAdmin/config.inc.php
-rw-r----- 1 root www 3091 Nov 24 17:35 /etc/phpMyAdmin/config.inc.php

Adding some debug around here:
Code: [Select]
if ($scriptpath=="/phpmyadmin/" && $_SERVER['PHP_AUTH_USER']=='admin')would help pinpoint if there is an issue with getting to this point where the authentication is translated from admin to root.
I had problems with my brute force logging debug and haven't progressed any further.
Title: Re: Can't log in to phpmyadmin
Post by: stephdl on December 13, 2014, 11:26:50 AM
no hints in

/var/log/messages
/var/log/httpd/error_log

it seems that the apache authentication fails
Title: Re: Can't log in to phpmyadmin
Post by: sages on December 13, 2014, 12:52:03 PM
No hints in either log.
admin logon works for server manager and phpvirtualbox.
Title: Re: Can't log in to phpmyadmin
Post by: DanB35 on December 13, 2014, 01:11:58 PM
Code: [Select]
groupmod -o -g 102 apacheif you have tricked the phpmyadmin db, please remove the rpm, remove the phpmyadmin mysql database, remove the phpmyadmin db and then reinstall phpmyadmin, else restart your server
I have not made any changes to the config db entries for phpmyadmin.  I issued the groupmod command, did signal-event post-upgrade && signal-event reboot, and tried to log in again.  Same result--the apache authentication appears to succeed (or at least, no error is reported), but the phpmyadmin authentication does not.  For both, I'm using admin/server admin password.

Next step was yum erase phpmyadmin smeserver-phpmyadmin, config delete phpmyadmin, yum --enablerepo=epel,stephdl install smeserver-phpmyadmin.  Followed with post-upgrade and reboot.  Now, success.

Is there anything I should check before I mark this solved?
Title: Re: Can't log in to phpmyadmin
Post by: stephdl on December 13, 2014, 01:45:40 PM
Please report in the bug report your issues, the output of commands related to group ownership and commands that you did for solving it

Please give all available details and add the mention that you did an upgrade from sme8 with the backup restoration
Title: Re: Can't log in to phpmyadmin
Post by: stephdl on December 13, 2014, 01:51:17 PM
No hints in either log.
admin logon works for server manager and phpvirtualbox.

If it works for phpvirtualbox, then it should work for phpmyadmin, pwauth is used also for the apache authentication

Try to do what dan did, remove all settings and reinstall
Title: Re: Can't log in to phpmyadmin
Post by: stephdl on December 13, 2014, 01:57:12 PM
By the way, 64 bit or 32 bit your sme9 ?
Title: Re: Can't log in to phpmyadmin
Post by: sages on December 13, 2014, 02:09:59 PM
64 bit.
Complete uninstall, reboot, new install, reboot and its now working as expected.
There have been a couple of updates over the last week or so the sme that have sorted out some issues since I last tried to debug this. Some combination of the above appears to have successfully resolved my issue.
Thanks for your help and efforts with the package.
Title: Re: Can't log in to phpmyadmin
Post by: stephdl on December 13, 2014, 03:40:00 PM
Are you saying that it worked and after a bunch of updates it stopped to work  ?

I'm happy that the issue can be solved but there is something odd....anyway if you want to thank someone....it is not me only, but a team....and you are welcome to join it.

Just need to  love working with others....all skill needed
Title: Re: [SOLVED] Can't log in to phpmyadmin
Post by: sages on December 14, 2014, 12:57:58 AM
Sequence of events:
sme 8.1 with phymyadmin working ok.
Backed up sme 8.1 via backup to usb
Clean install sme 9
restored backup
Had some LDAP issues.
Installed phpmyadmin and had problem described above.
applied various updates to sme 9
Still had problem with phpmyadmin.
Followed process above with complete uninstall of phpmyadmin
reinstalled phpmyadmin
all good
said thanks :)