配置apache密码认证
apache提供了一系列的认证,授权,访问控制模块,我们这里选用最方便的mod_auth_basic,mod_authn_file,mod_authz_user这三个模块实现目录或文件需要输入用户和密码认证。1、生成密码文件
示例:
[*]htpasswd -c /var/www/.htpasswd centos
/var/www/.htpasswd是密码文件的位置
centos是添加授权的用户
htpasswd工具详细使用说明:http://lamp.linux.gov.cn/Apache/ApacheMenu/programs/htpasswd.html
2、配置httpd.conf文件
[*]<directory /var/www/html/centos>
[*]AuthType basic
[*]AuthBasicProvider file
[*]AuthUserFile /var/www/.htpasswd
[*]Require valid-user
[*]</directory>
这里是当访问centos目录时需要认证。
我妈常说,我们家要是没有电话就不会这么穷。 在一辆拥挤的公车上,一位女郎忽然叫了起来:别挤啦!别挤啦!把人家的奶都挤出来啦!(她拿着酸奶呢)。 我本非随便的人,但如果你想随便,那我就随你的便好啦! 床上运动也可以减肥的,你们都不知道吗? 我是个凑数的。。。
页:
[1]