removido
(usa Nenhuma)
Enviado em 06/07/2012 - 00:14h
Acabei de compilar o squid aqui.
Dá uma olhada...
# cd /usr/local/src
# wget
http://www.squid-cache.org/Versions/v3/3.1/squid-3.1.20-20120705-r10457.tar.gz
# tar xvfz squid-3.1.20-20120705-r10457.tar.gz
# cd squid-3.1.20-20120705-r10457
# ./configure --prefix=/usr --sysconfdir=/etc/squid --localstatedir=/var/squid --libdir=/usr/lib --mandir=/usr/man --docdir=/usr/doc/squid --enable-dependency-tracking --enable-shared --disable-static --enable-icmp --enable-delay-pools --enable-kill-parent-hack --enable-ssl --enable-cache-digests --enable-default-err-language=Portuguese --enable-linux-netfilter --enable-auth="basic,digest,negotiate,ntlm" --enable-basic-auth-helpers="LDAP,NCSA,SMB" --enable-digest-auth-helpers="ldap" --enable-external-acl-helpers="ip_user" --with-gnu-ld --with-default-user=squid --with-pthreads --with-large-files
# make
# make install
===> Instalado! Agora vamos aos detalhes. <===
# groupadd squid
# chmod 775 /var/squid/*
# useradd -g squid -s /bin/ash -m -d /var/squid -p squid squid
# chown squid.squid /var/squid -R
# vim /etc/squid/squid.conf
acrescente para teste:
cache_dir ufs /var/squid/cache 1024 16 256
# cd /var/squid/cache/
# /usr/sbin/squid -z
2012/07/05 23:49:35| Creating Swap Directories
2012/07/05 23:49:35| /var/squid/cache exists
2012/07/05 23:49:35| Making directories in /var/squid/cache/00
2012/07/05 23:49:35| Making directories in /var/squid/cache/01
2012/07/05 23:49:35| Making directories in /var/squid/cache/02
2012/07/05 23:49:35| Making directories in /var/squid/cache/03
2012/07/05 23:49:35| Making directories in /var/squid/cache/04
2012/07/05 23:49:35| Making directories in /var/squid/cache/05
2012/07/05 23:49:35| Making directories in /var/squid/cache/06
2012/07/05 23:49:35| Making directories in /var/squid/cache/07
2012/07/05 23:49:35| Making directories in /var/squid/cache/08
2012/07/05 23:49:35| Making directories in /var/squid/cache/09
2012/07/05 23:49:35| Making directories in /var/squid/cache/0A
2012/07/05 23:49:35| Making directories in /var/squid/cache/0B
2012/07/05 23:49:35| Making directories in /var/squid/cache/0C
2012/07/05 23:49:35| Making directories in /var/squid/cache/0D
2012/07/05 23:49:35| Making directories in /var/squid/cache/0E
2012/07/05 23:49:35| Making directories in /var/squid/cache/0F
# ls
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
# /usr/sbin/squid start
* Processo iniciado:
# ps aux | grep squid
root 8526 0.0 0.0 43004 1676 ? Ss Jul05 0:00 /usr/sbin/squid start
squid 8528 0.0 0.2 48940 10172 ? S Jul05 0:00 (squid) start
squid 8530 0.0 0.0 15944 1020 ? S Jul05 0:00 (unlinkd)
root 8793 0.0 0.0 8980 868 pts/1 S+ 00:00 0:00 grep --color=auto squid
* Analisando o log do cache.log
# tail -100 /var/squid/logs/cache.log
* Testando o proxy - Configure o proxy do seu navegador
# tail -f /var/squid/logs/access.log
1341543315.763 11061 127.0.0.1 TCP_MISS/200 1149 CONNECT versioncheck.addons.mozilla.org:443 - DIRECT/63.245.217.161 -
1341543316.760 12057 127.0.0.1 TCP_MISS/200 1690 CONNECT versioncheck.addons.mozilla.org:443 - DIRECT/63.245.217.161 -
1341543316.763 17478 127.0.0.1 TCP_MISS/200 7090 CONNECT versioncheck.addons.mozilla.org:443 - DIRECT/63.245.217.161 -
1341543316.771 12068 127.0.0.1 TCP_MISS/200 669 CONNECT versioncheck.addons.mozilla.org:443 - DIRECT/63.245.217.161 -
1341543316.774 12072 127.0.0.1 TCP_MISS/200 670 CONNECT versioncheck.addons.mozilla.org:443 - DIRECT/63.245.217.161 -
1341543319.745 20436 127.0.0.1 TCP_MISS/200 48704 CONNECT services.addons.mozilla.org:443 - DIRECT/63.245.217.113 -
1341543330.921 116796 127.0.0.1 TCP_MISS/200 3398 CONNECT sb-ssl.google.com:443 - DIRECT/74.125.234.101 -
1341543421.154 1220 127.0.0.1 TCP_MISS/200 2215 POST http://ocsp.verisign.com/ - DIRECT/199.7.52.72 application/ocsp-response
1341543422.215 1053 127.0.0.1 TCP_MISS/200 2354 POST http://evsecure-ocsp.verisign.com/ - DIRECT/199.7.59.72 application/ocsp-response
1341543438.503 19213 127.0.0.1 TCP_MISS/200 30655 CONNECT addons.mozilla.org:443 - DIRECT/63.245.217.112 -
* Reconfigurando
# vim /etc/squid/squid.conf
Adiciona:
dns_nameservers 8.8.8.8 8.8.4.4
# /usr/sbin/squid -k reconfigure
* Vendo se a alteração entrou em vigor
# tail /var/squid/logs/cache.log
2012/07/06 00:09:14| Squid plugin modules loaded: 0
2012/07/06 00:09:14| Store logging disabled
2012/07/06 00:09:14| DNS Socket created at [::], FD 8
2012/07/06 00:09:14| DNS Socket created at 0.0.0.0, FD 9
2012/07/06 00:09:14| Adding nameserver 8.8.8.8 from squid.conf
2012/07/06 00:09:14| Adding nameserver 8.8.4.4 from squid.conf
2012/07/06 00:09:14| Accepting HTTP connections at [::]:3128, FD 11.
2012/07/06 00:09:14| HTCP Disabled.
2012/07/06 00:09:14| Loaded Icons.
2012/07/06 00:09:14| Ready to serve requests.
Beleza.... Agora é só adaptar seu squid.conf
Espero que esteja bem claro para o seu entendimento. Qualquer duvida estamos ai!
Abraço!