marcati
(usa Arch Linux)
Enviado em 11/10/2010 - 17:03h
Boa tarde,
Pessoal tenho 1 servidor Slackware 13.1 com squid-3.1.8 instalado, na hora do configure eu habilitei netfilter com o comando: ./configure --enable-linux-netfilter --prefix="/usr/local/squid/".
Na linha da porta do squid.conf coloquei: http_port 8080 transparent.
No meu rc.local coloquei as seguintes regras de iptables(meu servidor tem ip 172.16.111.98 para saida e 192.168.1.1(modem) para entrada de internet):
iptables -t nat -A PREROUTING -s 192.168.1.0/255.255.255.0 -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -s 172.16.111.0/255.255.252.0 -p tcp --dport 80 -j REDIRECT --to-port 8080
Com essas configurações não era pra estar rodando corretamente? Fiz um teste muito rapido (pq tive que re-ligar o servidor antigo da empresa pq o pessoal precisava da internet) e nele percebi que não estava funcionando como o esperado. Em um texto na internet li que quando da o comando squid -v precisaria constar alguma coisa sobre o "--enable-linux-netfilter" mais no meu caso foi este o resultado:
Squid Cache: Version 3.1.8
configure options: '--prefix=/usr/local/squid' --with-squid=/pkg/squid-3.1.8
meu cache.log:
2010/10/11 13:58:34| Preparing for shutdown after 0 requests
2010/10/11 13:58:34| Waiting 30 seconds for active connections to finish
2010/10/11 13:58:34| FD 16 Closing HTTP connection
2010/10/11 13:58:41| Starting Squid Cache version 3.1.8 for i686-pc-linux-gnu...
2010/10/11 13:58:41| Process ID 32228
2010/10/11 13:58:41| With 1024 file descriptors available
2010/10/11 13:58:41| Initializing IP Cache...
2010/10/11 13:58:41| DNS Socket created at [::], FD 7
2010/10/11 13:58:41| DNS Socket created at 0.0.0.0, FD 8
2010/10/11 13:58:41| Adding nameserver 200.204.0.10 from /etc/resolv.conf
2010/10/11 13:58:41| Adding nameserver 200.204.0.138 from /etc/resolv.conf
2010/10/11 13:58:41| Unlinkd pipe opened on FD 13
2010/10/11 13:58:41| Store logging disabled
2010/10/11 13:58:41| Swap maxSize 2097152 + 65536 KB, estimated 166360 objects
2010/10/11 13:58:41| Target number of buckets: 8318
2010/10/11 13:58:41| Using 16384 Store buckets
2010/10/11 13:58:41| Max Mem size: 65536 KB
2010/10/11 13:58:41| Max Swap size: 2097152 KB
2010/10/11 13:58:41| Version 1 of swap file with LFS support detected...
2010/10/11 13:58:41| Rebuilding storage in /usr/local/squid/cache (DIRTY)
2010/10/11 13:58:41| Using Least Load store dir selection
2010/10/11 13:58:41| Current Directory is /pkg/squid-3.1.8
2010/10/11 13:58:41| Loaded Icons.
2010/10/11 13:58:41| Accepting intercepted HTTP connections at 0.0.0.0:8080, FD 16.
2010/10/11 13:58:41| Accepting ICP messages at [::]:3130, FD 17.
2010/10/11 13:58:41| HTCP Disabled.
2010/10/11 13:58:41| Squid modules loaded: 0
2010/10/11 13:58:41| Ready to serve requests.
2010/10/11 13:58:41| Done reading /usr/local/squid/cache swaplog (0 entries)
2010/10/11 13:58:41| Finished rebuilding storage from disk.
2010/10/11 13:58:41| 0 Entries scanned
2010/10/11 13:58:41| 0 Invalid entries.
2010/10/11 13:58:41| 0 With invalid flags.
2010/10/11 13:58:41| 0 Objects loaded.
2010/10/11 13:58:41| 0 Objects expired.
2010/10/11 13:58:41| 0 Objects cancelled.
2010/10/11 13:58:41| 0 Duplicate URLs purged.
2010/10/11 13:58:41| 0 Swapfile clashes avoided.
2010/10/11 13:58:41| Took 0.01 seconds ( 0.00 objects/sec).
2010/10/11 13:58:41| Beginning Validation Procedure
2010/10/11 13:58:41| Completed Validation Procedure
2010/10/11 13:58:41| Validated 25 Entries
2010/10/11 13:58:41| store_swap_size = 0
2010/10/11 13:58:42| storeLateRelease: released 0 objects
Alguem pode me dar uma luz? hahah