phpmyadmin不能访问,APACEH报403错误的另外一种解决办法

简介:

Permission denied: access to /phpmyadmin/ denied

网络上有很多种解决办法,修改CONF文件,停用SELINUX等。

我试过,都解决得不太理想。

通过以下这个贴子,我解决了问题。

URL如下:

http://sanartisan.wordpress.com/2012/04/19/apache-on-centos-6-2-with-sub-directories/

The problem was that the phpmyadmin package that I copied via WinSCP took the wrong context, which therefore didn’t have the appropriate permissions for apache to display.

[root@sandbox html]# ls -Z
-rw-r--r--. root root unconfined_u:object_r:httpd_sys_content_t:s0 info.php
drwxr-xr-x. root root unconfined_u:object_r:user_tmp_t:s0 phpmyadmin

To fix this, I needed to do the following:

chcon -R -t httpd_sys_content_t phpmyadmin

Note: be sure to use the -R to recursively apply that context against all files. Otherwise you will get a server misconfiguration error.

[root@sandbox html]# ls -Z
-rw-r--r--. root root unconfined_u:object_r:httpd_sys_content_t:s0 info.php
drwxr-xr-x. root root unconfined_u:object_r:httpd_sys_content_t:s0 phpmyadmin

In retrospect, had I downloaded the file via wget directly into the /var/www/html directory, it would have already taken the proper context, and I would not have had the issue.

目录
相关文章
|
7月前
|
安全 网络架构
电脑维修常遇到等等相关问题及解决方法?
电脑维修常遇到等等相关问题及解决方法?
|
9月前
|
数据库
学生错误‘3704‘解决方法
学生错误‘3704‘解决方法
|
应用服务中间件 nginx
今日所遇到的问题+解决方法
今日在阿里云轻量应用服务器部署LNMP时所遇问题
|
关系型数据库 数据管理 MySQL
修改WordPress地址(URL)出现错误的解决方法。
在修改WordPress地址(URL)后,出现了无法访问管理页面的情况时,使用此方法可以解决该问题。
828 0
修改WordPress地址(URL)出现错误的解决方法。
|
关系型数据库 MySQL 数据库连接
关于WordPress建立数据库连接错误的解决方法
自己在调整自己的WordPress网站(APP兼职网)时,刷新页面是突然出现建立数据库连接错误。 按照页面的提示,主要原因可能有几下几种: 1、数据库配置文件被篡改。 2、数据库服务器的问题,服务未启动或者其他的一些数据库故障。
1574 0
关于WordPress建立数据库连接错误的解决方法
|
存储 关系型数据库 MySQL
Mysql5.7登录错误1045和1130的解决方法,亲测有用,希望能帮助到你们。
Mysql5.7登录错误1045和1130的解决方法,亲测有用,希望能帮助到你们。Mysql(针对Mysql5.7版本,其他版本可能略有不同)错误:1045解决方法:以管理员身份运行cmd(win8系统:win+x 键 ,再按 A键 ),进入Mysql安装目录下的bin目录下(如下图所示,根据自己...
2222 0