在httpd.conf写入
vi httpd.conf
AuthType Basic #注意一点,Basic认证方法并不加密来自用户浏览器的密码
AuthName "mrtg access"
AuthUserFile /data/apache2/passwd/htpasswd #密码文件,也就是
建立的文件
Options Indexes FollowSymLinks
AllowOverride AuthConfig
Order allow,deny
Allow from all
Require valid-user
执行命令建立密码文件
htpasswd -c /data/apache2/passwd/htpasswd username
重新启动apache即可
阅读(924) | 评论(0) | 转发(0) |