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.

目录
相关文章
|
关系型数据库 MySQL 数据库连接
关于WordPress建立数据库连接错误的解决方法
自己在调整自己的WordPress网站(APP兼职网)时,刷新页面是突然出现建立数据库连接错误。 按照页面的提示,主要原因可能有几下几种: 1、数据库配置文件被篡改。 2、数据库服务器的问题,服务未启动或者其他的一些数据库故障。
1647 0
关于WordPress建立数据库连接错误的解决方法
|
关系型数据库 MySQL 数据库连接
WordPress安装后出现,浏览器访问服务器 IP 出现`建立数据库连接时出错`,错误信息
WordPress安装后出现,浏览器访问服务器 IP 出现`建立数据库连接时出错`,错误信息
WordPress安装后出现,浏览器访问服务器 IP 出现`建立数据库连接时出错`,错误信息
|
.NET 开发框架
IIS7错误“Web服务器被配置为不列出此目录的内容”的解决办法
用IIS7调试ASP程序,出现“Web服务器被配置为不列出此目录的内容”这个错误提示,解决方法如下; 打开 控制面板 - 管理工具 - Internet 信息服务(IIS)管理器 - 目录浏览 选择启用即可。
3682 0

热门文章

最新文章