apache的userdir 403 Forbidden问题的解决办法

发布时间:2020-12-02编辑:脚本学堂
apache的userdir 403 Forbidden问题的解决办法

apache的userdir模块:http://httpd.apache.org/docs/2.2/howto/public_html.html

以前没用过,想用一下,可是就是很403,日志也是简单的
Permission denied: access to /~username denied

后来在另一台用yum安装的服务器上找到答案。
# The path to the end user account ‘public_html’ directory must be
# accessible to the webserver userid. This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a “403 Forbidden” message.

具体操作: 
 

复制代码 代码如下:
#chmod -R 711 /home/*
#cd /home/username/
#chmod 755 -R public_html