问题:
在httpd.conf配置文件中开启了UserDir配置项,并且在系统中创建了一个hadoop用户,在hadoop的家目录下需要创建一个public_html目录,并在目录中创建一个index.html文件,访问时报错,

<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
#UserDir disabled
#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disabled" line above, and uncomment
# the following line instead:
#
UserDir public_html
</IfModule>
解决方法:
最开始一直怀疑是文件权限问题(用户家目录至少要有711权限,用户家目录下的public_html目录至少要有755权限),但是修改文件权限后仍然不行,最后发现是selinux没有关闭造成的,通过setforce 0修改了selinux配置后,问题解决,页面可以正常访问。

在Apache httpd服务器中,启用UserDir配置并尝试访问用户hadoop的public_html目录时遇到权限问题。尽管已设置正确权限,但问题依旧存在。最终发现是由于SELinux未关闭导致,通过修改SELinux配置(setenforce 0)成功解决了访问错误,现在可以正常访问index.html页面。
1503

被折叠的 条评论
为什么被折叠?



