以下为linuxAS4环境下apache的配置
# mkdir -p /webshare/benet
# vi /etc/httpd/conf/httpd.conf
1、增加以下选项,对/webshare/benet目录共享并采用SEOver="kwE(event,0, this)" onmousemove="kwM(0)" onmouseout="kwL(event,this)" onclick="kwC(event,0)" style="border-bottom: rgb(102,0,255) 1px dotted; background-color: transparent; color: rgb(102,0,255); text-decoration: underline">认证用户的访问
Alias /benet "/webshare/benet/" ;建立访问别名 benet
Options Indexes
AllowOverride None
AuthType Basic
AuthName "benet"
AuthUserFile /var/www/passwd/benet
require valid-user
Order allow,deny
Allow from all
2、建立认证文件和认证的用户
# cd /var/www/
# mkdir passwd
# cd passwd
# htpasswd -c benet aa ;创建认证文件benet,并添加aa用户
# htpasswd benet bb ;添加bb用户
# chown apache.apache benet
# service httpd restart
3、以组的方式进行认证
Alias /benet "/webshare/benet/"
Options Indexes
AllowOverride None
AuthType Basic
AuthName "admin"
AuthUserFile /var/www/passwd/benet
AuthGroupFile /var/www/passwd/admin
require group admin
# require valid-user
Order allow,deny
Allow from all
# cd /var/www/passwd
# vi admin ;创建组认证文件
4、验证。
"
Apache下的目录共享访问和认证"由
第二电脑网原创提供,转载请注明:
http://www.002pc.com/master/College/Server/Apache/17828.html