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.

时间: 2025-01-27 04:27:08

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

WebSphere发布war包 访问JSP报403错误,访问HTM正常

问题描述 Struts2+Hibernate3+Spring的框架,在TOMCAT下面正常,打成war包发布上WebSphere后,访问jsp文件报403错误,而访问html文件却正常显示,不知道为什么.web.xml文件如下<?xmlversion="1.0"encoding="UTF-8"?><web-appversion="2.5"xmlns="http://java.sun.com/xml/ns/javaee&

get方式-$.ajax post报403错误

问题描述 $.ajax post报403错误 通过freemarker跳转到springmvc某个controller,如果是get方式则没什么问题.如果是post,这里表单制定的是post方式,controller制定的也是post,但是跳转不过去.并且报403错误 解决方案 发生原因:是因为配置domain域时 进行了自定义配置,或对原有的domain域进行过扩展现有的配置,并配置了应用程序的安全性所在在启动doamin域后,输入http://localhost:7001/console就会

ssl-tomcat6 http 能正常访问 https 报404错误

问题描述 tomcat6 http 能正常访问 https 报404错误 同url http能正常访问 https不能访问 报404错误 如:http://localhost/index.index 正常 https://localhost/index.html 为404 服务器环境:linux tomcat 6.0.36 jdk 1.6.0_37 64-Bit本机模拟配置一切正常.推断可能服务器环境存在问题,求大神指出server.xml<?xml version='1.0' encoding

request- Response 总是报403错误

问题描述 Response 总是报403错误 string rl; WebRequest Request = WebRequest.Create(url.Trim()); Encoding utf8 = Encoding.Unicode; WebResponse Response = Request.GetResponse(); Stream resStream = Response.GetResponseStream(); 为什么response总是出现The remote server re

JavaWeb报SQL错误,一直没有得到解决,请大神帮忙

问题描述 JavaWeb报SQL错误,一直没有得到解决,请大神帮忙 错误如下: java.lang.RuntimeException: java.sql.SQLException: Cannot set cid: incompatible types. Query: select * from t_book where 1=1 and cid = ? order by orderBy limit ?,? Parameters: [922E6E2DB04143D39C9DDB26365B3EE8,

ofbiz做一个小demo,配置好了之后,在页面上跑。报404错误,请问该怎么解决

问题描述 ofbiz做一个小demo,配置好了之后,在页面上跑.报404错误,请问该怎么解决 ofbiz做一个小demo,配置好了之后,在页面上跑.报404错误 求大神指点

集成环信UI报一下错误,求大森们解决

问题描述 集成环信UI报一下错误,求大森们解决 解决方案 #define NSEaseLocalizedString(key, comment) [[NSBundle bundleWithURL:[[NSBundle mainBundle] URLForResource:@"EaseUIResource" withExtension:@"bundle"]] localizedStringForKey:(key) value:@"" table:n

【DG】DG备库报ORA-28000: the account is locked的解决办法

[DG]DG备库报ORA-28000: the account is locked的解决办法 测试用户为lhr现象:主备库的lhr用户的状态都是OPEN,但是,备库连接的时候报ORA-28000: the account is locked错误.在主库执行"alter user lhr identified by lhr account unlock;"同步到备库也不能解决,在备库该命令不能执行. 解决:重启DG环境的备库实例即可 参考:ORA-28000 On Active Data

Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法_Mysql

Mybatis报错: org.apache.ibatis.exceptions.PersistenceException解决办法 一.问题描述 写好配置文件用JUnit进行测试,一运行就报错: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.apache.ibatis.reflection.ReflectionException: Error instantiat