phpMyAdmin + CentOS 6.0 - 禁止 [英] phpMyAdmin + CentOS 6.0 - Forbidden

查看:10
本文介绍了phpMyAdmin + CentOS 6.0 - 禁止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我想访问我的 phpMyAdmin 时,我总是会收到此消息.

I always get this message when I would like access my phpMyAdmin.

w3m localhost/phpmyadmin

Forbidden

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

Apache/2.2.15 (CentOS) Server at localhost Port 80

安装步骤:

rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2- 2.el6.rf.x86_64.rpm
yum install phpmyadmin

添加别名

vi /etc/httpd/conf.d/phpmyadmin.conf
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin

从 cookie 更改为 http

Change from cookie to http

vi /usr/share/phpmyadmin/config.inc.php
[...]
 /* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';
[...]

重启

/etc/init.d/httpd restart

SELinux -/etc/httpd

SELinux - /etc/httpd

drwxr-xr-x. root root system_u:object_r:httpd_config_t:s0 .
drwxr-xr-x. root root system_u:object_r:etc_t:s0       ..
drwxr-xr-x. root root system_u:object_r:httpd_config_t:s0 conf
drwxr-xr-x. root root system_u:object_r:httpd_config_t:s0 conf.d
lrwxrwxrwx. root root system_u:object_r:httpd_log_t:s0 logs -> ../../var/log/httpd
lrwxrwxrwx. root root system_u:object_r:httpd_modules_t:s0 modules -> ../../usr/lib64/httpd/modules
lrwxrwxrwx. root root system_u:object_r:httpd_config_t:s0 run -> ../../var/run/httpd

SELinux -/usr/share/phpmyadmin

SELinux - /usr/share/phpmyadmin

drwxr-xr-x. root root   system_u:object_r:usr_t:s0       .
drwxr-xr-x. root root   system_u:object_r:usr_t:s0       ..
-rw-r--r--. root root   system_u:object_r:usr_t:s0       browse_foreigners.php
-rw-r--r--. root root   system_u:object_r:usr_t:s0       calendar.php
-rw-r--r--. root root   system_u:object_r:usr_t:s0       changelog.php
-rw-r--r--. root root   system_u:object_r:usr_t:s0       chk_rel.phph
.
.
.
-rw-r--r--. root root   system_u:object_r:usr_t:s0       view_create.php

操作系统

centos-release-6-0.el6.centos.5.x86_64

推荐答案

编辑你的 httpd.conf 文件如下:

Edit your httpd.conf file as follows:

# nano /etc/httpd/conf/httpd.conf

在此处添加以下行:

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

发出以下命令:

# service httpd restart

如果您的问题没有解决,请禁用您的 SELinux.

If your problem is not solved then disable your SELinux.

这篇关于phpMyAdmin + CentOS 6.0 - 禁止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆