您的位置:首页 > 其它

构建系统用户的个人主页

2018-10-24 22:42 134 查看

构建系统用户的个人主页


续虚拟主机

1. 修改httpd的主配置文件

删除之前对httpd.conf所做操作,搜索UserDir,将UserDir disabled注释掉,它可能影响个人主页功能的开启,同时启用个人主页功能UserDir public_html)确认目录区域设置

vim /etc/httpd/conf/httpd.conf
#    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>
<Directory /home/cai/public_html>
AllowOverride none
Options none
Order allow,deny
Allow from all
</Directory>

2.创建对应用户,并设置密码

useradd cai
passwd cai

3.创建配置文件中的目录,并编辑主页内容

mkdir /home/cai/public_html
vim  /home/cai/public_html/index.html
hahahha

4.赋予用户目录权限

chmod 755 /home/cai

5.重启服务并在火狐浏览器验证

service httpd restart


成功!

阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: