Link to home
Start Free TrialLog in
Avatar of Starquest321
Starquest321

asked on

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
SOLUTION
Avatar of becraig
becraig
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
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
Avatar of Starquest321
Starquest321

ASKER

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
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
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

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
phpMyAdmin.conf
i think the first one was a typo
so I need to delete the changes made in httpd.conf?
remove that broken conf file and "yum reinstall phpMyAdmin" package
It will place default conf back
/etc/httpd/conf/httpd.conf

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

And the reinstall will reset that one?
httpd.conf is the configuration file for apache; don't delete that
reinstalling phpMyAdmin package should replace the phpMyAdmin.conf with the default
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>
the phpMyAdmin Directory directive  - move to phpMyAdmin.conf and remove those 4 lines from httpd.conf
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
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>
Yes, you are blocked by them.
Just add lines to apache 2.2 section:
Allow from your_ip
and reload apache
gheist: Can you detail the exact steps?
How do I know where section 2.2 is?
Add one line to text file and reload apache service?
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?
No, you dont want. Thats why config file is clamped, so that people dont start something stupid.
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?
Last time you mentioned phpMyAdmin.conf that has Apache 2.2 section. So edit that and undo changes in httpd.conf.
<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.
You forgot the reload part
I reboot the whole machine . . .
Also just so I am accessing the right link:

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

right?
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?
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