1. htpasswd命令:
    a. 生成加密密码文件:
    htpasswd  -c  /home/lee/.htpasswd  lee

    b. 修改密码:

    htpasswd  /home/lee/.htpasswd  lee

    c. 增加用户:

    htpasswd  /home/lee/.htpasswd  lee_01

    d. 删除用户:

    htpasswd  -D  /home/lee/.htpasswd  lee
  2. APACHE(在私密站点新建.htaccess文件):
    AuthType "Basic"  
    AuthName  "Password Required" #提示文字  
    AuthUserFile  "/home/lee/.htpasswd" #加密密码的文件  
    Require  valid-user  
  3. NGINX:
    apache使用htpasswd生成Basic私密站点
    auth_basic  "请输入密码"
    auth_basic_user_file  /home/lee/.htaccess
  4. 配置:
    setenforce  0
    chown  apache.apache  /home/lee/.htpasswd