红联Linux门户
Linux帮助

linux配置Httpd授权

发布时间:2016-07-01 10:06:40来源:linux网站作者:love小仙
1、用yum装好httpd
 
2、用命令:vi /etc/httpd/conf/httpd.conf
配置好 DocumentRoot "/cpcnet/products/services/web"
写上:
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess
 
3、在/cpcnet/products/services/web目录下放.htpasswd 和 .htaccess文件
linux配置Httpd授权
 
4、htpasswd内容如下
netswofdrk:bc5qdfdgmu7pdmjYc22  
#(用户名:密码)  
 
5、.htaccess内容如下
AuthType Basic  
AuthUserFile /cpcnet/products/services/web/.htpasswd  
AuthName "ManagedCONNECT Revamp Configuration Page"  
require valid-user  
satisfy all  
 
6、访问效果
linux配置Httpd授权
 
本文永久更新地址:http://www.linuxdiyf.com/linux/21960.html