zoukankan      html  css  js  c++  java
  • apache 给个人网站设置密码

    1. 在服务器配置apache 用户名密码

    [root@test01 home]# htpasswd -c /etc/httpd/passwd test1
    New password: 
    Re-type new password: 
    Adding password for user usertest1
    

      

    2.配置apache,添加如下内容,目录根据各自需要进行配置

    [root@test01 home]# vim /etc/httpd/conf/httpd.conf
    
    <Directory "/var/www/html/fr/*">
      AllowOverride all
      authuserfile "/etc/httpd/passwd"
      authname "My privately website"
      authtype basic
      require user test1  
     </Directory>

    3. 重启 apache

    systemctl restart httpd
    

      

  • 相关阅读:
    【Python爬虫】:模拟登录QQ空间
    Docker
    Git
    DevOps
    DevOps
    gRPC 简介
    tcpdump的使用
    Raft
    go-micro 简介
    Node
  • 原文地址:https://www.cnblogs.com/royfans/p/14481540.html
Copyright © 2011-2022 走看看