Enviado em 23/08/2010 - 10:21h
Olá pessoal. Tenho um servidor configurado com squid, bastante gente jah deve ter visto isso por aqui, mas nao consigo fazer essa budega funcionar. Estou tentando fazer o squid funcionar com autenticação, fazendo com q ele peça usuario e senha na hora de conectar na internet, mas por cargas dagua nao está dando certo. os tutorias q pego, nao falam se precisa inserir regra no iptables, nao sei se isso é certo. mas já inseri tanta regra, que já deve estar uma zona. vou postar o squid.conf, se tiver alguma coisa errada por favor, me ajudem.
#----------------------------------#
# Arquivo de configuração do Squid
# Autor: Gleudson Junior
# gleudson.jr@gmail.com
# http://gleudson.blogspot.com
# Licença: GNU/GPL
#----------------------------------#
#-----------------------------------------#
# CONFIGURAÇÕES PARA AUTENTICAÇÃO DO PROXY
#-----------------------------------------#
# INFORMA O CAMINHO DO PROGRAMA DE AUTENTICAÇÃO E O ARQUIVO DE LOGINS E SENHAS
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
# PADRÃO
auth_param basic children 5
# DEFINE O TIMEOUT DE LOGON NO PROXY
auth_param basic credentialsttl 1 hour
# DEFINE O TEXTO QUE APARECERÁ NA CAIXA DE LOGIN
auth_param basic realm Digite seu Login e Sua Senha
# DESATIVA A VERIFICAÇÃO DE LETRAS MAIÚSCULAS E MINÚSCULAS
auth_param basic casesensitive off
#-----------------------#
# CONFIGURAÇÕES BASICAS
#-----------------------#
# PORTA DE ACESSO
http_port 3128
# DEFINE O NOME DO SERVIDOR (COMANDO hostname)
visible_hostname nome_do_servidor
# ATIVA A LINGUAGEM DAS PAGINAS DE ERRO PARA PORTUGUÊS
error_directory /usr/share/squid/errors/Portuguese/
# OPÇÕES DO CACHE
cache_dir ufs /var/cache/squid 5000 16 256
# LOG
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
# ACLS
acl manager proto cache_object
# LIBERA O ACESSO PARA O IP DE LOOPBACK
acl localhost src 127.0.0.1/32
acl SSL_ports port 443 563
acl Safe_ports port 80 21 70 210 888
acl CONNECT method CONNECT
# PEDE A AUTENTICAÇÃO NO PROXY
acl autenticados proxy_auth REQUIRED
# DEFINE O CAMINHO DO ARQUIVO DE SITES BLOQUEADOS
acl sitebloqueado url_regex -i "/etc/squid/sitebloqueado"
http_access deny sitebloqueado
# DEFINE O CAMINHO DO ARQUIVO DE PALAVRAS BLOQUEADAS
acl palavrabloq dstdom_regex "/etc/squid/palavrabloq"
http_access deny palavrabloq
# DEFINE O IP E MASCARA DA REDE INTERNA
acl permitidos src 192.168.1.0/24
acl all src 192.168.1.0/24
http_access allow autenticados permitidos
http_access deny all
grato pela ajuda!
#----------------------------------#
# Arquivo de configuração do Squid
# Autor: Gleudson Junior
# gleudson.jr@gmail.com
# http://gleudson.blogspot.com
# Licença: GNU/GPL
#----------------------------------#
#-----------------------------------------#
# CONFIGURAÇÕES PARA AUTENTICAÇÃO DO PROXY
#-----------------------------------------#
# INFORMA O CAMINHO DO PROGRAMA DE AUTENTICAÇÃO E O ARQUIVO DE LOGINS E SENHAS
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
# PADRÃO
auth_param basic children 5
# DEFINE O TIMEOUT DE LOGON NO PROXY
auth_param basic credentialsttl 1 hour
# DEFINE O TEXTO QUE APARECERÁ NA CAIXA DE LOGIN
auth_param basic realm Digite seu Login e Sua Senha
# DESATIVA A VERIFICAÇÃO DE LETRAS MAIÚSCULAS E MINÚSCULAS
auth_param basic casesensitive off
#-----------------------#
# CONFIGURAÇÕES BASICAS
#-----------------------#
# PORTA DE ACESSO
http_port 3128
# DEFINE O NOME DO SERVIDOR (COMANDO hostname)
visible_hostname nome_do_servidor
# ATIVA A LINGUAGEM DAS PAGINAS DE ERRO PARA PORTUGUÊS
error_directory /usr/share/squid/errors/Portuguese/
# OPÇÕES DO CACHE
cache_dir ufs /var/cache/squid 5000 16 256
# LOG
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
# ACLS
acl manager proto cache_object
# LIBERA O ACESSO PARA O IP DE LOOPBACK
acl localhost src 127.0.0.1/32
acl SSL_ports port 443 563
acl Safe_ports port 80 21 70 210 888
acl CONNECT method CONNECT
# PEDE A AUTENTICAÇÃO NO PROXY
acl autenticados proxy_auth REQUIRED
# DEFINE O CAMINHO DO ARQUIVO DE SITES BLOQUEADOS
acl sitebloqueado url_regex -i "/etc/squid/sitebloqueado"
http_access deny sitebloqueado
# DEFINE O CAMINHO DO ARQUIVO DE PALAVRAS BLOQUEADAS
acl palavrabloq dstdom_regex "/etc/squid/palavrabloq"
http_access deny palavrabloq
# DEFINE O IP E MASCARA DA REDE INTERNA
acl permitidos src 192.168.1.0/24
acl all src 192.168.1.0/24
http_access allow autenticados permitidos
http_access deny all
grato pela ajuda!