开发者社区> 天飞> 正文

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.

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
今日所遇到的问题+解决方法
今日在阿里云轻量应用服务器部署LNMP时所遇问题
39 0
Mysql5.7登录错误1045和1130的解决方法,亲测有用,希望能帮助到你们。
Mysql5.7登录错误1045和1130的解决方法,亲测有用,希望能帮助到你们。Mysql(针对Mysql5.7版本,其他版本可能略有不同)错误:1045解决方法:以管理员身份运行cmd(win8系统:win+x 键 ,再按 A键 ),进入Mysql安装目录下的bin目录下(如下图所示,根据自己...
2074 0
IIS7错误“Web服务器被配置为不列出此目录的内容”的解决办法
用IIS7调试ASP程序,出现“Web服务器被配置为不列出此目录的内容”这个错误提示,解决方法如下; 打开 控制面板 - 管理工具 - Internet 信息服务(IIS)管理器 - 目录浏览 选择启用即可。
2504 0
IIS7错误:“Web服务器被配置为不列出此目录的内容”的解决办法
IIS7错误:“Web服务器被配置为不列出此目录的内容”的解决方法: 在"操作"下,点启用,此按钮将变成禁用,则可消除此错误
769 0
+关注
天飞
一个运维老同志
文章
问答
文章排行榜
最热
最新
相关电子书
更多
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载
冬季实战营第三期:MySQL数据库进阶实战
立即下载