-

   rss_rss_hh_new

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 51

:


[ ] Squid Proxy

, 08 2017 . 19:05 +
image

%username%,

Squid proxy .

:

  1. Squid-hq
  2. Squid-br1
  3. Squid-br2
  4. Squid-br3
  5. Squid-br4
  6. Squid-db

, 5 squid proxy , 1 . OS CentOS 7.3, squid proxy 3.3.8 3.5.26, Squid-db mariadb 5.6

, :

  1. squid proxy:
    yum install perl perl-Readonly* perl-URI perl-YAML perl-DBI perl-Carp perl-DBD-mysql
  2. :

    cp log_mysql_daemon.pl /usr/libexec/squid/log_mysql_daemon.pl

    :

    chmod +x /usr/libexec/squid/log_mysql_daemon.pl
    chown squid:squid /usr/libexec/squid/log_mysql_daemon.pl


  3. :

    vi /etc/squid/log_mysql_daemon.conf

    host: ""
    database: "squid_log"
    table: "access_log"
    user: "squid"
    pass: ""


  4. , :

    mysql -p
    create database squid_log;
    CREATE USER 'squid'@'%' IDENTIFIED BY '';
    GRANT ALL PRIVILEGES ON squid_log.* TO 'squid'@'';
    GRANT ALL PRIVILEGES ON squid_log.* TO 'squid'@'';
    GRANT ALL PRIVILEGES ON squid_log.* TO 'squid'@'';
    GRANT ALL PRIVILEGES ON squid_log.* TO 'squid'@'';
    GRANT ALL PRIVILEGES ON squid_log.* TO 'squid'@'';
    exit

    cat log_mysql_daemon-table.sql log_mysql_daemon-views.sql | mysql -p squid_log



  5. squid proxy



    vi /etc/squid/squid.conf
    acl dontLog http_status 403 407
    logformat squid_mysql %ts.%03tu %6tr %>a %Ss %03Hs % access_log /var/log/squid/access.log squid
    access_log daemon:/etc/squid/log_mysql_daemon.conf squid_mysql !dontLog
    logfile_daemon /usr/libexec/squid/log_mysql_daemon.pl


    :
    acl dontLog http_status 403 407 , 403, 407. ,

    logformat squid_mysql %ts.%03tu %6tr %>a %Ss %03Hs %b> , squid . :

    /usr/libexec/squid/log_mysql_daemon.pl squid-server

    # fields that we should have in the database table
    # this list depends on the log format configuration
    my @required_fields = qw(
    id
    time_since_epoch
    response_time
    client_src_ip_addr
    squid_request_status
    http_status_code
    reply_size
    request_method
    request_url
    username
    squid_hier_status
    server_ip_addr
    mime_type
    squid_server
    );


    access_log /var/log/squid/access.log squid ,

    access_log daemon:/etc/squid/log_mysql_daemon.conf squid_mysql !dontLog . !dontLog 403,407 ,

    logfile_daemon /usr/libexec/squid/log_mysql_daemon.pl

  6. squid proxy

    squid reconfigure
    squid -k reconfigure


    :
    image

    :
    image

:


, . (). , , .

Squid Proxy?
Original source: habrahabr.ru (comments, light).

https://habrahabr.ru/post/335204/

:  

: [1] []
 

:
: 

: ( )

:

  URL