phpmyadmin

Seemed like I did everything correct in installing phpmyadmin on centos7...except the permissions:

Forbidden

You don't have permission to access /phpmyadmin/ on this server.

When I try to access from the web server.
I edited the file:

vi /etc/httpd/conf.d/phpMyAdmin.conf

And commented out as per instructions on:
http://www.howtoforge.com/apache_php_mysql_on_centos_7_lamp
Starquest321Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

becraigCommented:
you need to edit the httpd.conf file

 /etc/httpd/conf/httpd.conf

Add the entry below

<Directory "/usr/share/phpmyadmin">
    Order allow,deny
    Allow from all
</Directory>

Then restart the httpd service.
0
gheistCommented:
You forgot to restart httpd

# apachectl graceful
0
Starquest321Author Commented:
I think I did something wrong: I put what you said at the end of the file...but maybe I have to format somehow. Regarding server...simply reboot the whole thing
8-31-2014-8-56-38-AM.png
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Seth SimmonsSr. Systems AdministratorCommented:
folder names in linux are case-sensitive
any edits in your config file should show phpMyAdmin ; phpmyadmin will fail
0
becraigCommented:
yup Seth is correct I just put the modification there, but based on your edit in VI, it shows:
/etc/httpd/conf.d/phpMyAdmin.conf

so the entry should be:
<Directory "/usr/share/phpMyAdmin">
    Order allow,deny
    Allow from all
</Directory>

Open in new window

0
Starquest321Author Commented:
Just a small confusion: which file do I need to edit? On top it said:
 /etc/httpd/conf/httpd.conf

now I am reading:
/etc/httpd/conf.d/phpMyAdmin.conf
0
Seth SimmonsSr. Systems AdministratorCommented:
phpMyAdmin.conf
i think the first one was a typo
0
Starquest321Author Commented:
so I need to delete the changes made in httpd.conf?
0
gheistCommented:
remove that broken conf file and "yum reinstall phpMyAdmin" package
It will place default conf back
0
Starquest321Author Commented:
/etc/httpd/conf/httpd.conf

So how can I delete that file? What command to run?

And the reinstall will reset that one?
0
Seth SimmonsSr. Systems AdministratorCommented:
httpd.conf is the configuration file for apache; don't delete that
reinstalling phpMyAdmin package should replace the phpMyAdmin.conf with the default
0
Starquest321Author Commented:
Here is the exact file that I have: What did I do wrong?



 vi /etc/httpd/conf.d/phpMyAdmin.conf
    Deny from All
    Allow from None
</Directory>

<Directory /usr/share/phpMyAdmin/setup/frames/>
    Order Deny,Allow
    Deny from All
    Allow from None
</Directory>

# This configuration prevents mod_security at phpMyAdmin directories from
# filtering SQL etc.  This may break your mod_security implementation.
#
#<IfModule mod_security.c>
#    <Directory /usr/share/phpMyAdmin/>
#        SecRuleInheritance Off
#    </Directory>
#</IfModule>

<Directory "/usr/share/phpMyAdmin">
    Order allow,deny
    Allow from all
</Directory>
0
Seth SimmonsSr. Systems AdministratorCommented:
the phpMyAdmin Directory directive  - move to phpMyAdmin.conf and remove those 4 lines from httpd.conf
0
Starquest321Author Commented:
Seth: I am so new . . that you have completed steps in your head that I do not know how to do:

1. "the phpMyAdmin Directory directive" - what does that mean? is that a line?
2. How do I move? Move the file? Move the text?
3. How can I check those 4 lines removed from httpd.conf
0
Starquest321Author Commented:
I deleted that file . . .reinstalled...have a new copy of the phpMyAdmin.conf

I added these lines at the end:

<Directory "/usr/share/phpMyAdmin">
    Order allow,deny
    Allow from all
</Directory>

But realized that I maybe blocked by the default lines from the install:


<Directory /usr/share/phpMyAdmin/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
</Directory>
0
gheistCommented:
Yes, you are blocked by them.
Just add lines to apache 2.2 section:
Allow from your_ip
and reload apache
0
Starquest321Author Commented:
gheist: Can you detail the exact steps?
0
Starquest321Author Commented:
How do I know where section 2.2 is?
0
gheistCommented:
Add one line to text file and reload apache service?
0
Starquest321Author Commented:
Allow from your_ip . .
but I want from ALL ips . . not just my IP. .  .

And you mean at the end of this file:

/etc/httpd/conf/httpd.conf?
0
gheistCommented:
No, you dont want. Thats why config file is clamped, so that people dont start something stupid.
0
Starquest321Author Commented:
In /etc/httpd/conf/httpd.conf . . . I added the line:

Allow from xx.xx.xx.xx (My IP) and then saved . .restarted. Not working. Sorry I am so new that I need detailed steps. Where exact should I add this line?
0
gheistCommented:
Last time you mentioned phpMyAdmin.conf that has Apache 2.2 section. So edit that and undo changes in httpd.conf.
0
Starquest321Author Commented:
<Directory /usr/share/phpMyAdmin/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require ip 127.0.0.1
       Require ip ::1
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from xx.xx.xx.xx
     Allow from ::1
   </IfModule>
</Directory>

I have added that ALLOW FROM . . and at the end I have:


<Directory "/usr/share/phpMyAdmin">
    Order allow,deny
    Allow from all
</Directory>


Do I need to an IP there as well?

I still just keep getting that:

Forbidden

You don't have permission to access /phpMyAdmin on this server.
0
gheistCommented:
You forgot the reload part
0
Starquest321Author Commented:
I reboot the whole machine . . .
0
Starquest321Author Commented:
Also just so I am accessing the right link:

I need to be at:
http://domain,com/phpMyAdmin

right?
0
Starquest321Author Commented:
By the way:

apachectl graceful
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.

Is that any indication of errors?
0
gheistCommented:
"apachectl configtest"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.