
1 vim /etc/httpd/conf.d/userdir.conf
<IfModule mod_userdir.c> #UserDir Disabled UserDir public ##指定共享目录的名称</IfModule>## Control access to UserDir directorIEs. The following is an example# for a site where these directorIEs are restricted to read-only.##<Directory "/home/*/public_HTML"># AllowOverrIDe fileInfo AuthConfig limit Indexes# Options multiviews Indexes SymlinksIfOwnerMatch IncludesNoExec# Require method GET POST OPTIONS#</Directory><directory /home/wang/public> #目录授权allowoverrIDe authconfig #启用目录.htacces配置文件 </directory>
2 vim /home/wang/public/.htaccess
authtype basic #启用basic验证Authname "admin Page" #主页名字AuthUserfile "/etc/httpd/conf.d/.httpuser" #用户名单AuthGroupfile "/etc/httpd/conf.d/.httpgroup" #用户组 Require group g1 g2 #授权的用户组
3
htpasswd -c /etc/httpd/conf.d/.httpuser tom root:~ # cat /etc/httpd/conf.d/.httpuserbob:$apr1$uiGJnnta$malpOQNXO1H6PXkSFBQLp.tom:$apr1$G3CLOH6uazhfaSvBcQKnd2sHrYdo1alice:$apr1$TMnblcB2$ui69X.78BLx.yYg9igwAW0
4
mkdir ~wang/publicecho ‘test1\‘ > /~wang/public/index.HTMLsetfacl -m u:apache:x ~wang/
4测试
访问 http://YOU-ip/~wang/总结
以上是内存溢出为你收集整理的linux实现家目录的web共享,并基于basic验证全部内容,希望文章能够帮你解决linux实现家目录的web共享,并基于basic验证所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)