LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-21-2011, 12:32 PM   #1
User-N@me
Member
 
Registered: May 2011
Distribution: Cent0S, Fedora, Ubuntu, Debian
Posts: 32

Rep: Reputation: 0
Arrow PhpMyAdmin : 403 forbidden. You don't have permission to access [...] on this server.


Hello,

Prior to configuration/hardening of apache2, I could access phpmyadmin, but since then I have done a few modifications in conf.d/security like "uncommenting" the following :

<Directory />
AllowOverride None
Order Deny,Allow
Deny from all
</Directory>

But I tried commenting it out again and it didn't solve the problem.

I also chrooted Apache2 with mod_chroot ( like this http://www.howtoforge.com/chrooting-...n-ubuntu-10.04 ).

And now like said in the title I've got the Forbidden error.

The phpmyadmin.conf looks fine to me and probably is since it was working before.


So I believe the problem occurred because of the chrooting with mod_chroot. What should I do to fix this problem ?

( phpmyadmin is in /usr/share/phpmyadmin )
 
Old 06-21-2011, 01:44 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
it is in the order of things
Quote:
<Directory />
AllowOverride None
Deny from all
</Directory>
this says to DENY first
then DENY from ALL
-- no one has access --

you might want to have a second look as the hppd.conf documentation
http://httpd.apache.org/docs/2.2/mis...rity_tips.html


try
.........
Order Deny,Allow
Allow from 123.456.789.012 ( your ip )
.......
 
Old 06-21-2011, 02:06 PM   #3
User-N@me
Member
 
Registered: May 2011
Distribution: Cent0S, Fedora, Ubuntu, Debian
Posts: 32

Original Poster
Rep: Reputation: 0
Hi,

Thanks for your help, I tried but it didn't change anything.

I'm already allowing access to phpmyadmin so it shouldn't be the problem.

<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php

<IfModule mod_php5.c>
AddType application/x-httpd-php .php

php_flag magic_quotes_gpc Off
php_flag track_vars On
php_flag register_globals Off
php_value include_path .
</IfModule>

</Directory>
 
Old 06-21-2011, 03:25 PM   #4
User-N@me
Member
 
Registered: May 2011
Distribution: Cent0S, Fedora, Ubuntu, Debian
Posts: 32

Original Poster
Rep: Reputation: 0
File does not exist: /usr
or
client denied by server configuration: /usr

Are two different errors I can get (trying different conf) in /var/log/apache2/error.log

Should I do something like create a symlink to /usr/share/phpmyadmin in /var/www ?

Edit : Done but now it complains about symlinks "Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin" but shouldn't it work since I've got : Options FollowSymLinks ?

Last edited by User-N@me; 06-21-2011 at 03:53 PM.
 
Old 06-21-2011, 05:01 PM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
this is a good example of why i have people install the Apache stack from source for the first 12 or so installs
that way you LEARN how to configure everything

i would re go over the
Apache, MySQL, php,and PhpMyAdmin documentation.

make 100% sure that apache is set up right . Files have the correct permissions , and the httpd set up right
then make sure that mysql is up and running with a NEW non default ( user=user , password=password)
that php is set up and configured and the apache php_mod is running
then that the `myadmin config file is set up correctly.

-- edit ---
for convenience you might also want to install mysql,php,phpmyadmin,and the rest
into /var/www
that way Apache docroot /var/www/http
mysql root is /var/www/mysql
and phpmyadmin is /var/www/phpmyadmin

everything is in one place and there is on digging around for files scattered all over the place .

Last edited by John VV; 06-21-2011 at 05:06 PM.
 
Old 06-21-2011, 06:56 PM   #6
User-N@me
Member
 
Registered: May 2011
Distribution: Cent0S, Fedora, Ubuntu, Debian
Posts: 32

Original Poster
Rep: Reputation: 0
After a long google session I come to the conclusion that symlinks are not allowed with mod_chroot. I'm going to try to revert this mod_chroot thing now ...
 
Old 06-23-2011, 12:04 AM   #7
hhh123
Member
 
Registered: Jul 2009
Location: /
Distribution: centos
Posts: 47

Rep: Reputation: 1
please provide logs from /var/log/httpd/error.log
 
Old 06-23-2011, 07:30 PM   #8
User-N@me
Member
 
Registered: May 2011
Distribution: Cent0S, Fedora, Ubuntu, Debian
Posts: 32

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by hhh123 View Post
please provide logs from /var/log/httpd/error.log
"Symbolic link not allowed or link target not accessible: /var/www/phpmyadmin"

I think that's what I had. As far as I know symlinks are not allowed with mod_chroot so I would advise people to install phpmyadmin and everything needed inside the jail ... or just give up on chrooting apache.

(the phpmyadmin.conf that I posted earlier was wrong too btw ... but now that's good)
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Forbidden You don't have permission to access / on this server. dav_y2k Linux - Server 4 10-25-2010 09:47 AM
You don't have permission to access /phpmyadmin/ on this server. jonaskellens Linux - Newbie 5 12-19-2009 02:25 PM
Forbidden You don't have permission to access / on this server tekmann33 Linux - Software 4 06-16-2009 03:17 AM
403 forbidden :You don't have permission to access /hi.html on this server. av.dubey Linux - Newbie 3 12-21-2007 12:10 AM
Apache: 403 Forbidden, You don't have permission baosheng Linux - Server 1 03-23-2007 03:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration