Link to home
Start Free TrialLog in
Avatar of sharingsunshine
sharingsunshineFlag for United States of America

asked on

PHP MyAdmin Problem

I am trying to access PHPMyAdmin and I get this in the error logs when ever I try to open it.  This is a new install so it has never worked.

client denied by server configuration: /usr/share/phpMyAdmin/setup/index.php and it is referencing my IP.

This is the permissions that are on phpmyadmin

drwxr-sr-x 10 ec2-user daemon 4096 Apr 28 20:38 phpmyadmin

PHPMyAdmin is located at /var/www/html/phpmyadmin

I need to be able to get this working so please tell me how to fix the problem.

Thanks,

Randal
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

What Linux distribution are you using?  And which version of phpMyAdmin are you trying to install?
Why dont you install RPM package
having phpmyadmin in /phpmyadmin opens you to all sorts of evils of the net
Check within phpmyadmin for a .htaccess file.

My guess is that the error relates to the database connection configuration.
Look at /var/log/httpd or /var/log/apache2 in access and error log files to see whether they shed light on the issue.

Did you go through phpmyadmin config?
Avatar of xterm
xterm

As arnold mentioned, there is an htaccess file in your phpmyadmin folder in your web tree, or a <Directory> directive in your httpd.conf referencing that path, and one of them will have a block that looks something like this in it:

<Limit GET>
order deny,allow
deny from all
allow from 127.0.0.1
allow from 10.0.0.1
</Limit>

Open in new window

Be sure that your IP address(es) appear in one of the allow from lines, and if not present add a new line.  BTW, if you have a line that says something like "require valid-user" then you will need to add your username and encrypted password to the file referenced by the AuthUserFile directive in .htaccess
Avatar of sharingsunshine

ASKER

The linux distribution is Amazon Linux AMI release 2014.03
Kernel \r on an \m - that's what I get when I cat /etc/issue

The PHPMyAdmin is from yum the epel repository -
phpMyAdmin - Readme
===================

Version 4.1.14

I thought having it installed there was wrong so glad you pointed it out.  I am not familiar with an RPM installation.  

This message is from /var/log/httpd/error_logs
client denied by server configuration: /usr/share/phpMyAdmin/setup/index.php and it is referencing my IP.

I don't see a .htaccess in the phpmyadmin folder

Arnold - don't understand this statement - Did you go through phpmyadmin config?

I went through httpd.conf looking for <Limit, allow from and require valid with the search option in nano.  But none of those are to be found in httpd.conf
The restriction might be in /etc/httpd/conf.d
See if your httpd.conf file has an include directive at the bottom of the file
include /etc/httpd/conf.d/*.conf
If it does look within this conf.d directory.
A file here such as phpmyadmin.conf
grep -il phpmy

Phpmyadmin has a configuration file where the login options and the mysql server/s that it can administer are defined.  Look in index.php and it should point to agile using include directive. This may manifest once you correct the access issues.

Presumably you have a centos/redhat .... See if you have /etc/release*
SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Note the error reflects the path not in /var/www/html/phpmyadmin but in /usr/share/phpmyadmin

You could copy the phpmyadmin from the share location to the HTML directory as phpmyadmin2 to test.  The links within are relative and will work, but I think manual modification might still be needed.
The new versions of phpMyAdmin that I have manually installed require you to have a writeable directory for the setup procedure after which you are supposed to copy a 'config' file to the main phpMyAdmin directory and make the setup directory un-writeable.  I'm wondering that is what is causing the problem.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks everyone for your assistance.  Adding in the allow from didn't do it all until I changed the alias.  Now it can be accessed via http://my_ip/phpmyadmin