zoukankan      html  css  js  c++  java
  • centos7.3给squid搭建代理服务器添加认证apache

    证使用浏览器打开 然后输入用户名和密码的方式

    所以使用基于web服务的apache的 htpasswd

    1 创建用户 设置密码

    htpasswd -cd /etc/squid/passwords test # 提示输入密码,注意密码不要超过8位

    2 测试密码文件

    /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwords # 输入 用户名 密码提示OK说明成功,ERR是有问题,请检查一下之前步骤 OK

    空格的形式输入  test test123

    centos6.5用的是如下的
    
    /usr/lib64/squid/ncsa_auth /etc/squid/passwords # 输入 用户名 密码提示OK说明成功,ERR是有问题,请检查一下之前步骤 OK

    3 配置

    vim /etc/squid/squid.conf

     在最后追加

    auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwords
    auth_param basic credentialsttl 5 hours
    acl ncsa_users proxy_auth REQUIRED
    http_access allow ncsa_users

    centos6.5用如下

    auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/passwords
    auth_param basic credentialsttl 5 hours
    acl ncsa_users proxy_auth REQUIRED
    http_access allow ncsa_users
     

    注释其他代码

    #http_access allow localnet
    #http_access allow all

    4 重启squid

    service squid restart

    5 测试 输入用户名和密码

    6 成功 

  • 相关阅读:
    KVM切换声音关闭
    tmux 快捷键
    arp绑定网关MAC地址错误
    javascript的字符串模板
    cheerio, dom操作模块
    footable动态载入数据
    node-js访问rest api的方法
    重装eclipse要做的事
    爬虫(三):对requests、xpath模块
    Java-基础篇(类和对象)
  • 原文地址:https://www.cnblogs.com/baker95935/p/7761170.html
Copyright © 2011-2022 走看看