免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6209 | 回复: 7
打印 上一主题 下一主题

[Web] Apache配用户目录后,403没权限访问? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-01-09 22:02 |只看该作者 |倒序浏览
配置在下面


  1. <IfModule mod_userdir.c>
  2.     #
  3.     # UserDir is disabled by default since it can confirm the presence
  4.     # of a username on the system (depending on home directory
  5.     # permissions).
  6.     #
  7.     #UserDir disabled
  8.     #UserDir enabled lab

  9.     #
  10.     # To enable requests to /~user/ to serve the user's public_html
  11.     # directory, remove the "UserDir disable" line above, and uncomment
  12.     # the following line instead:
  13.     #
  14.     UserDir "/home/labftp/upload/*/html"

  15. </IfModule>

  16. #
  17. # Control access to UserDir directories.  The following is an example
  18. # for a site where these directories are restricted to read-only.
  19. #
  20. <Directory /home/labftp/upload/*/html>
  21.     AllowOverride FileInfo AuthConfig Limit
  22.     Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
  23.     <Limit GET POST OPTIONS>
  24.         Order allow,deny
  25.         Allow from all
  26.     </Limit>
  27.     <LimitExcept GET POST OPTIONS>
  28.         Order deny,allow
  29.         Deny from all
  30.     </LimitExcept>
  31. </Directory>
复制代码


然后userdir目录的权限也设置成了755,selinux也关掉了,但是访问用户目录是还是报403 Forbidden。网上搜了很多,都是因为selinux的原因,但是我已经关了selinux,还是不行,大家有什么建议?今天弄了一晚上这个问题还没有解决。

[ 本帖最后由 diker007 于 2009-1-9 22:03 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2009-01-09 22:49 |只看该作者
forbidden by default.you need configure as follows

Order allow,deny
Allow from all

论坛徽章:
0
3 [报告]
发表于 2009-01-09 23:29 |只看该作者
设了index没?

论坛徽章:
0
4 [报告]
发表于 2009-01-10 09:54 |只看该作者
原帖由 todayhero 于 2009-1-9 22:49 发表
forbidden by default.you need configure as follows

Order allow,deny
Allow from all


我安装你说的改成这样,还是不行。

  1. <Directory /home/labftp/upload/*/html>
  2.    Order allow,deny
  3.    Allow from all
  4. </Directory>
复制代码

论坛徽章:
0
5 [报告]
发表于 2009-01-10 09:54 |只看该作者
原帖由 ttplay 于 2009-1-9 23:29 发表
设了index没?

设了的

论坛徽章:
0
6 [报告]
发表于 2009-01-10 10:52 |只看该作者
解决了,还是权限问题。除了/home/labftp/upload/*/html要设置成755外,labftp也要有x权限

论坛徽章:
39
白银圣斗士
日期:2015-11-24 10:40:40酉鸡
日期:2015-03-20 14:15:44寅虎
日期:2015-03-20 14:13:59午马
日期:2015-03-20 14:13:16白羊座
日期:2015-03-20 14:12:54金牛座
日期:2015-03-20 14:12:09双子座
日期:2015-03-20 14:11:57巨蟹座
日期:2015-03-20 14:11:44狮子座
日期:2015-03-20 14:11:29亥猪
日期:2015-03-20 14:16:24戌狗
日期:2015-03-20 14:16:40申猴
日期:2015-03-20 14:17:05
7 [报告]
发表于 2009-01-14 18:15 |只看该作者
/home/labftp/upload/*/html
首先要确保Apache用户对这个目录有可读可写权限

换个目录看下
我有次把目录放在 root 文件夹下,就是访问不了,郁闷死了,但是用默认的目录可以
后来改到 / 根下就能访问了

论坛徽章:
0
8 [报告]
发表于 2009-01-22 11:29 |只看该作者
原帖由 diker007 于 2009-1-10 10:52 发表
解决了,还是权限问题。除了/home/labftp/upload/*/html要设置成755外,labftp也要有x权限


此法正解.

把upload设置成755都没用
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP