Error 403 for phpmyadmin [Solved]

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Error 403 for phpmyadmin [Solved]

Postby dookan » 04. July 2012 23:55

Hello everyone!
I'm a user of XAMPP for about 3 years now, without any problem or difficulties for configuring. Almostly all the time, a Windows-only user, but recently I had to start using Linux in my job.
But, after SO many tries in Linux to access phpmyadmin I can't see why Apache always returns me to an Error 403 page!

I did all the basic configuration, as usual. I've also removed the "phpmyadmin" string from that "new security concept" in httpd-xampp.conf... It's worth to note here that I'm using XAMPP for locally testing purposes only - and within that check, I'm returned to XAMPP's "security concept" 403 page. WIthout, I get the default Apache 403 error.

Thanks in advance and sorry for my bad english.

Edit: I'm using latest XAMPP version with Mint 13.
dookan
 
Posts: 9
Joined: 04. July 2012 23:41
Operating System: Linux Mint 13 Cinnamon

Re: Error 403 for phpmyadmin

Postby JonB » 05. July 2012 14:22

I've also removed the "phpmyadmin" string from that "new security concept" in httpd-xampp.conf...


That only affects access from IP's that are 'routable' (not on your Local network)

what happens when you go to these URL's:

http://localhost/phpmyadmin

http://localhosr/xampp

Did you change ownership or permissions on any of the folders under '/opt/lampp/' ???

:?:
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Error 403 for phpmyadmin

Postby dookan » 05. July 2012 15:05

Hello JonB,
It's always Error 403 for phpmyadmin. Anything under DocumentRoot seems to work perfectly :)
I tried changing the owner of the "phpmyadmin" folder to nobody:root, nobody:nobody, root:root, myuser:myuser, myuser:root. Nothing seems to work... I tried also to modify the phpmyadmin code, but PHP is currently unreachable.

My logs/access_log contain entries like this:
Code: Select all
127.0.0.1 - - [05/Jul/2012:10:16:01 -0300] "GET /phpmyadmin/ HTTP/1.1" 403 1119
dookan
 
Posts: 9
Joined: 04. July 2012 23:41
Operating System: Linux Mint 13 Cinnamon

Re: Error 403 for phpmyadmin

Postby JonB » 05. July 2012 15:11

In term, as su or via sudo

Code: Select all
cd /opt/lampp
ls -l


what does 'your version' of this line look like:

drwxr-xr-x. 10 nobody root 4096 May 8 17:20 phpmyadmin

:?:

What do you mean by 'unreachable'

I tried also to modify the phpmyadmin code, but PHP is currently unreachable
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Error 403 for phpmyadmin

Postby dookan » 05. July 2012 15:19

Code: Select all
gustavo@gustavo-note /opt/lampp $ sudo ls -l
[sudo] password for gustavo:
total 164
drwxr-xr-x  2 root root 12288 Jun 15 11:40 bin
drwxr-xr-x  2 root root  4096 Jul 14  2004 cgi-bin
drwxr-xr-x  3 root root  4096 Mar 15 08:15 error
drwxr-xr-x  8 root root  4096 Jun 15 11:35 etc
lrwxrwxrwx  1 root root    21 Jul  4 19:40 htdocs -> /home/gustavo/Dev/PHP
drwxr-xr-x  3 root root  4096 Mai 30  2003 icons
-rwxr-xr-x  1 root root 15325 Jun 15 11:39 lampp
drwxr-xr-x 15 root root 12288 Jun 15 11:40 lib
drwxr-xr-x  2 root root  4096 Abr 26  2006 libexec
drwxr-xr-x 36 root root  4096 Ago 24  2009 licenses
drwxr-xr-x  2 root root  4096 Jul  5 10:27 logs
drwxr-xr-x  2 root root  4096 Jun 15 11:40 modules
drwxr-xr-x  3 root root  4096 Mar 13 12:34 php
drwxr-xr-x  8 root root  4096 Jul  5 10:14 phpmyadmin
-rw-rw-r--  1 root root 66898 Jun 15 10:57 RELEASENOTES
drwxr-xr-x  2 root root  4096 Jun 15 11:40 sbin
drwxr-xr-x 39 root root  4096 Jun 15 11:39 share
drwxr-xr-x  3 root root  4096 Jan 18  2005 tmp
drwxr-xr-x  6 root root  4096 Jul  5 10:24 var


by "unreachable" I mean that it's not an HTTP header sent by PHP as I thought it could be.
dookan
 
Posts: 9
Joined: 04. July 2012 23:41
Operating System: Linux Mint 13 Cinnamon

Re: Error 403 for phpmyadmin

Postby JonB » 05. July 2012 15:34

LAMPP will only work correctly when it is owned by nobody:root

Your problem is that the Apache listener process isn't owned by 'root'.
Code: Select all
[root@localhost opt]# ls -l
total 8
drwxr-xr-x.  3 root   root 4096 May  8 15:31 google
drwxr-xr-x. 18 nobody root 4096 May  8 17:21 lampp
[root@localhost opt]# chown -Rv nobody:root ./lampp/*
[root@localhost opt]#


Good Luck
8)

Note I have to work on projects now, so I may not be able to check till later in the day if this does not work
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Error 403 for phpmyadmin

Postby dookan » 05. July 2012 15:47

Yep, didn't worked =(
ALL files under /opt/lampp are now owned by nobody:root.
Maybe I'll try to change the folder where I'm working lampp... see if it works.
dookan
 
Posts: 9
Joined: 04. July 2012 23:41
Operating System: Linux Mint 13 Cinnamon

Re: Error 403 for phpmyadmin

Postby JonB » 05. July 2012 16:08

Code: Select all
lrwxrwxrwx  1 root root    21 Jul  4 19:40 htdocs -> /home/gustavo/Dev/PHP


I missed this line before, you 'sorta' moved the DocumentRoot, And I have no idea if you also changed httpd.conf, nor if the necessary symlinks and the ownerships were fixed.

What you just suggested (move phpMyAdmin) will probably work, under the assumption you are logged in as the owner of that folder. Whoever owns "/home/gustavo/Dev/PHP" should also be the owner of the phpmyadmin folder.

Basically you are on your own in this kind of a situation.

:)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Error 403 for phpmyadmin

Postby dookan » 05. July 2012 18:09

Well... not even with a fresh install I can access phpmyadmin :)
dookan
 
Posts: 9
Joined: 04. July 2012 23:41
Operating System: Linux Mint 13 Cinnamon

Re: Error 403 for phpmyadmin

Postby JonB » 05. July 2012 18:40

A. - Did you follow the 'remove instructions' first, before re-installing?

B. - what is the 'exact' URL you are using to try to run phpMyAdmin??? Yes, case matters -

B-1 - have you tried to run it (phpmyadmin) from the left panel of http://localhost/xampp ???

C. - have you used the LAMPP security script on the new install? (don't do it, I just want to know if you did this time around)

D. - Is it the same 403 error???

E. - You might want to test if SELinux is causing your problem: Read this:

http://linuxtarget.com/2012/01/06/how-t ... tos-linux/

Try the 'getenforce' command, if it works - likely the 'setenforce' commands will also work, allowing your machine to run in permissive mode.

F: - Please paste the results of ls -l in /opt/lampp into your reply.

Good Luck
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Error 403 for phpmyadmin

Postby dookan » 05. July 2012 20:33

JonB,
I know case matters. I've tried acessing exactly http://localhost/phpmyadmin. I haven't run the security script, and my system not even have the SELinux programs.
I've also just did exactly the same thing as it's described in the XAMPP site to uninstall it.
And, finally, within a fresh install, I get the 403 error page exactly as the one inside the "error" folder. Acessing http://localhost/xampp I have no problems (doesn't it sound strange?).

Edit: removing the "phpmyadmin" from httpd-xampp.conf, I get another "generic" 403 page.
dookan
 
Posts: 9
Joined: 04. July 2012 23:41
Operating System: Linux Mint 13 Cinnamon

Re: Error 403 for phpmyadmin

Postby dookan » 05. July 2012 20:45

Forgot to mention the ls -l result.
Code: Select all
gustavo@gustavo-note /opt/lampp $ ls -l
total 168
drwxr-xr-x  2 root   root 12288 Jun 15 11:40 bin
drwxr-xr-x  2 root   root  4096 Jul 14  2004 cgi-bin
drwxr-xr-x  3 root   root  4096 Mar 15 08:15 error
drwxr-xr-x  8 root   root  4096 Jun 15 11:35 etc
drwxr-xr-x  4 nobody root  4096 Ago 27  2009 htdocs
drwxr-xr-x  3 root   root  4096 Mai 30  2003 icons
-rwxr-xr-x  1 root   root 15325 Jun 15 11:39 lampp
drwxr-xr-x 15 root   root 12288 Jun 15 11:40 lib
drwxr-xr-x  2 root   root  4096 Abr 26  2006 libexec
drwxr-xr-x 36 root   root  4096 Ago 24  2009 licenses
drwxr-xr-x  2 root   root  4096 Jul  5 16:37 logs
drwxr-xr-x  2 root   root  4096 Jun 15 11:40 modules
drwxr-xr-x  3 root   root  4096 Mar 13 12:34 php
drwxr-xr-x  8 root   root  4096 Mai 15 06:07 phpmyadmin
-rw-rw-r--  1 root   root 66898 Jun 15 10:57 RELEASENOTES
drwxr-xr-x  2 root   root  4096 Jun 15 11:40 sbin
drwxr-xr-x 39 root   root  4096 Jun 15 11:39 share
drwxr-xr-x  3 root   root  4096 Jan 18  2005 tmp
drwxr-xr-x  6 root   root  4096 Jul  5 16:37 var
dookan
 
Posts: 9
Joined: 04. July 2012 23:41
Operating System: Linux Mint 13 Cinnamon

Re: Error 403 for phpmyadmin

Postby JonB » 05. July 2012 23:28

Make this change (as root or with sudo):

Code: Select all
cd /opt/lampp
chown -Rv nobody:root ./phpmyadmin/*


Stop lampp
restart and test.

Good luck
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Error 403 for phpmyadmin

Postby dookan » 06. July 2012 02:30

Damn! After too much time spent on this, I had to follow the Apache documentation: http://httpd.apache.org/docs/current/mod/mod_alias.html
Adding "Require all granted" in the DIrectory section for phpmyadmin, IT WORKS!

JonB, if that wouldn't be a problem for XAMPP's nex version, I would recomend using this "Require all granted" for <Directory> sections like this one in phpmyadmin. Solved my problem, should solve others who also don't have root login :D
dookan
 
Posts: 9
Joined: 04. July 2012 23:41
Operating System: Linux Mint 13 Cinnamon

Re: Error 403 for phpmyadmin

Postby JonB » 06. July 2012 03:46

Well that is great!

Hmmm - I will have to get with the chief Wiz aka Oswald, and see what he thinks...

Even if it does not get changed, we can mark this as a fix (this is the first time I have run into it) I'll have to look at that, because this afternoon I was looking at the Alias and Directory settings for 'phpmyadmin', (and looking in Apache Docs, LOL) and changing them but I was unable to replicate your problem. I was only able to break it and get 404 (not found) errors.

Thanks for letting us know what worked for you.
8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Next

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 13 guests