[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

phpmyadmin

Posted on 2014-08-30
30
Medium Priority
?
428 Views
Last Modified: 2014-09-03
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
0
Comment
Question by:Starquest321
  • 15
  • 8
  • 4
  • +1
29 Comments
 
LVL 29

Assisted Solution

by:becraig
becraig earned 500 total points
ID: 40294997
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
 
LVL 62

Assisted Solution

by:gheist
gheist earned 1000 total points
ID: 40295151
You forgot to restart httpd

# apachectl graceful
0
 

Author Comment

by:Starquest321
ID: 40295444
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
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 36

Assisted Solution

by:Seth Simmons
Seth Simmons earned 500 total points
ID: 40295603
folder names in linux are case-sensitive
any edits in your config file should show phpMyAdmin ; phpmyadmin will fail
0
 
LVL 29

Expert Comment

by:becraig
ID: 40295634
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
 

Author Comment

by:Starquest321
ID: 40298741
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
 
LVL 36

Expert Comment

by:Seth Simmons
ID: 40298774
phpMyAdmin.conf
i think the first one was a typo
0
 

Author Comment

by:Starquest321
ID: 40298789
so I need to delete the changes made in httpd.conf?
0
 
LVL 62

Expert Comment

by:gheist
ID: 40298817
remove that broken conf file and "yum reinstall phpMyAdmin" package
It will place default conf back
0
 

Author Comment

by:Starquest321
ID: 40299021
/etc/httpd/conf/httpd.conf

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

And the reinstall will reset that one?
0
 
LVL 36

Expert Comment

by:Seth Simmons
ID: 40299055
httpd.conf is the configuration file for apache; don't delete that
reinstalling phpMyAdmin package should replace the phpMyAdmin.conf with the default
0
 

Author Comment

by:Starquest321
ID: 40299060
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
 
LVL 36

Expert Comment

by:Seth Simmons
ID: 40299084
the phpMyAdmin Directory directive  - move to phpMyAdmin.conf and remove those 4 lines from httpd.conf
0
 

Author Comment

by:Starquest321
ID: 40299088
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
 

Author Comment

by:Starquest321
ID: 40299187
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
 
LVL 62

Expert Comment

by:gheist
ID: 40299306
Yes, you are blocked by them.
Just add lines to apache 2.2 section:
Allow from your_ip
and reload apache
0
 

Author Comment

by:Starquest321
ID: 40299312
gheist: Can you detail the exact steps?
0
 

Author Comment

by:Starquest321
ID: 40299334
How do I know where section 2.2 is?
0
 
LVL 62

Expert Comment

by:gheist
ID: 40299344
Add one line to text file and reload apache service?
0
 

Author Comment

by:Starquest321
ID: 40299348
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
 
LVL 62

Expert Comment

by:gheist
ID: 40299357
No, you dont want. Thats why config file is clamped, so that people dont start something stupid.
0
 

Author Comment

by:Starquest321
ID: 40299378
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
 
LVL 62

Expert Comment

by:gheist
ID: 40299390
Last time you mentioned phpMyAdmin.conf that has Apache 2.2 section. So edit that and undo changes in httpd.conf.
0
 

Author Comment

by:Starquest321
ID: 40299427
<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
 
LVL 62

Expert Comment

by:gheist
ID: 40299437
You forgot the reload part
0
 

Author Comment

by:Starquest321
ID: 40299453
I reboot the whole machine . . .
0
 

Author Comment

by:Starquest321
ID: 40299589
Also just so I am accessing the right link:

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

right?
0
 

Author Comment

by:Starquest321
ID: 40299605
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
 
LVL 62

Accepted Solution

by:
gheist earned 1000 total points
ID: 40300195
"apachectl configtest"
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
It is possible to boost certain documents at query time in Solr. Query time boosting can be a powerful resource for finding the most relevant and "best" content. Of course the more information you index, the more fields you will be able to use for y…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses
Course of the Month18 days, 10 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question