manuales:servidor_squid
Diferencias
Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previaPróxima revisiónAmbos lados, revisión siguiente | ||
manuales:servidor_squid [2011/04/15 15:21] – cayu | manuales:servidor_squid [2011/04/29 18:52] – cayu | ||
---|---|---|---|
Línea 306: | Línea 306: | ||
# / | # / | ||
</ | </ | ||
+ | |||
+ | |||
+ | Ejemplo de configuración mínima para que arranque el servicio : | ||
+ | |||
+ | < | ||
+ | http_port 3128 | ||
+ | |||
+ | hierarchy_stoplist cgi-bin ? | ||
+ | |||
+ | refresh_pattern ^ftp: | ||
+ | refresh_pattern ^gopher: | ||
+ | refresh_pattern -i (/ | ||
+ | refresh_pattern . | ||
+ | |||
+ | acl all src 0.0.0.0/ | ||
+ | acl manager proto cache_object | ||
+ | acl localhost src 127.0.0.1/ | ||
+ | acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1 | ||
+ | |||
+ | acl localnet src 10.0.0.0/ | ||
+ | acl localnet src 172.16.0.0/ | ||
+ | acl localnet src 192.168.0.0/ | ||
+ | acl localnet src fc00::/ | ||
+ | acl localnet src fe80::/ | ||
+ | |||
+ | acl SSL_ports port 443 | ||
+ | acl Safe_ports port 80 # http | ||
+ | acl Safe_ports port 21 # ftp | ||
+ | acl Safe_ports port 443 # https | ||
+ | acl Safe_ports port 70 # gopher | ||
+ | acl Safe_ports port 210 # wais | ||
+ | acl Safe_ports port 1025-65535 | ||
+ | acl Safe_ports port 280 # http-mgmt | ||
+ | acl Safe_ports port 488 # gss-http | ||
+ | acl Safe_ports port 591 # filemaker | ||
+ | acl Safe_ports port 777 # multiling http | ||
+ | acl CONNECT method CONNECT | ||
+ | |||
+ | http_access allow manager localhost | ||
+ | http_access deny manager | ||
+ | http_access deny !Safe_ports | ||
+ | http_access deny CONNECT !SSL_ports | ||
+ | http_access allow localhost | ||
+ | http_access allow localnet | ||
+ | http_access deny all | ||
+ | </ | ||
+ | |||
+ | ==== Información de Squid ==== | ||
+ | |||
+ | Si queremos ver los mensajes de error de Squid traducidos | ||
+ | |||
+ | < | ||
+ | error_directory / | ||
+ | </ | ||
+ | |||
+ | |||
+ | Si queremos ocultar la versión del Squid a mostrar | ||
+ | |||
+ | < | ||
+ | httpd_suppress_version_string on | ||
+ | </ | ||
+ | |||
+ | Si queremos modificar el nombre del host a mostrar en el mensaje de error | ||
+ | |||
+ | < | ||
+ | visible_hostname mihostproxy | ||
+ | </ | ||
+ | |||
+ | Enlace interesante: | ||
Línea 471: | Línea 540: | ||
==== Autenticacion ==== | ==== Autenticacion ==== | ||
+ | Squid puede utilizar diferentes métodos de validación de usuarios, los mismo pueden ser independientes de Squid y se llamados por un helper. | ||
+ | |||
+ | |||
+ | |||
+ | Básicamente el helper nos devolvera **OK** ó **ERR** en base a la información que le hayamos proporcionado | ||
+ | |||
+ | === LDAP === | ||
+ | |||
+ | Ejemplo de configuración para un LDAP común | ||
+ | < | ||
+ | auth_param basic program / | ||
+ | |||
+ | auth_param basic children 5 | ||
+ | auth_param basic realm Web-Proxy | ||
+ | auth_param basic credentialsttl 1 minute | ||
+ | |||
+ | acl ldap-auth proxy_auth REQUIRED | ||
+ | |||
+ | http_access allow ldap-auth | ||
+ | http_access allow localhost | ||
+ | http_access deny all | ||
+ | </ | ||
+ | |||
+ | === ActiveDirectory W2003 - LDAP === | ||
+ | |||
+ | < | ||
+ | auth_param basic program / | ||
+ | </ | ||
==== Permisos ==== | ==== Permisos ==== | ||
+ | |||
+ | === Permisos especiales === | ||
+ | |||
+ | |||
+ | == Bloquear MSN apto para 7 y 8 == | ||
+ | |||
+ | MSN Messenger 7 y MSN 8 tienen a buscar por todo lados como conectarse, entonces esto se vuelve algo medio problematico con Squid y mas cuando tenemos muchos grupos LDAP configurados y queremos que algunos si puedan acceder etc. Mi solución por el momento es : | ||
+ | |||
+ | < | ||
+ | acl MSN_Method method POST | ||
+ | acl MSN_Agent browser ^Mozilla.compatible; | ||
+ | acl MSN_Agent browser ^Mozilla/ | ||
+ | acl MSN_Mime req_mime_type ^application/ | ||
+ | acl MSN_Port port 1863 | ||
+ | acl MSN_Dom dstdom_regex -i messenger.hotmail.com 207.46.110.40 gateway.messenger.hotmail.com msn.com local-bay.contacts.msn.com messenger.live.com proxy-sn.contacts.msn.com proxy-bay.contacts.msn.com gateway.edge.messenger.live.com bay.messenger.services.live.com geo.messenger.services.live.com | ||
+ | acl MSN_Url url_regex -i gateway.dll sqmserver.dll ADSAdClient31.dll gateway.dll? | ||
+ | acl MSN_Usr | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | http_access | ||
+ | http_reply_access deny MSN_Agent MSN_Mime MSN_Dom MSN_Url !MSN_Usr | ||
+ | |||
+ | http_access | ||
+ | http_reply_access deny MSN_Method MSN_Url !MSN_Usr | ||
+ | |||
+ | http_access | ||
+ | http_reply_access deny CONNECT MSN_Port !MSN_Usr | ||
+ | </ | ||
+ | |||
+ | El reply acces es para forzar a que si o si se cumpla dicha condición, ya que podemos tener una gran cantidad de ACL's y algunas se pueden superponer, entonces con esto las forzamos. | ||
+ | |||
+ | |||
+ | |||
+ | == Delay pools == | ||
+ | |||
+ | Por ejemplo si tengo usuarios que abusan del uso de internet, dado el caso de que bajan una iso y la dejan horas agotando el ancho de banda, lo que podemos hacer con Squid, es que cuando llegen a un tope, por ejemplo 15MB el ancho de banda baje considerablemente para todo el segmento de red que pasa por squid. | ||
+ | |||
+ | |||
+ | |||
+ | Ejemplo si un usuario baja un archivo ISO, cuando llega a los 15MB la velocidad baja a 16k/s para todo el segmento | ||
+ | < | ||
+ | delay_pools | ||
+ | delay_class | ||
+ | delay_parameters | ||
+ | acl ficheros_iso | ||
+ | delay_access | ||
+ | </ | ||
+ | |||
+ | Se puede hacer tambien | ||
+ | |||
+ | **acl restringir url_regex -i "/ | ||
+ | < | ||
+ | \.ace$ | ||
+ | |||
+ | \.af$ | ||
+ | |||
+ | \.afx$ | ||
+ | |||
+ | \.arj$ | ||
+ | |||
+ | \.asf$ | ||
+ | |||
+ | \.asx$ | ||
+ | |||
+ | \.au$ | ||
+ | |||
+ | [...] | ||
+ | |||
+ | \.xla$ | ||
+ | |||
+ | \.xls$ | ||
+ | |||
+ | \.xlt$ | ||
+ | |||
+ | \.xlw$ | ||
+ | |||
+ | \.z$ | ||
+ | |||
+ | \.zip$ | ||
+ | |||
+ | youtube.com | ||
+ | </ | ||
+ | |||
+ | |||
+ | Delay pool clase 2 para afectar a usuarios individuales | ||
+ | |||
+ | < | ||
+ | delay_pools | ||
+ | delay_class | ||
+ | delay_parameters | ||
+ | delay_access | ||
+ | </ | ||
+ | |||
+ | Ejemplo de Delay pool por horarios | ||
+ | |||
+ | < | ||
+ | acl winupdate dstdomain .windowsupdate.com | ||
+ | acl peakperiod time 10:00-16:00 | ||
+ | delay_pools 1 | ||
+ | delay_class 1 1 | ||
+ | # 64 Kbit/s | ||
+ | delay_parameters 1 8000/8000 | ||
+ | delay_access 1 allow winupdate peakperiod | ||
+ | </ | ||
+ | |||
+ | Sacado de : http:// | ||
+ | |||
+ | |||
+ | Otros ejemplos de delay pools | ||
+ | |||
+ | < | ||
+ | # 157 kB/s | ||
+ | delay_pools 1 | ||
+ | delay_class 1 2 | ||
+ | delay_parameters 1 98304/ | ||
+ | delay_access 1 allow all ancho_de_banda | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | # 8 kB/s | ||
+ | delay_pools 1 | ||
+ | delay_class 1 1 | ||
+ | delay_parameters 1 8192/8192 | ||
+ | delay_access 1 allow all ancho_de_banda | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | # 32 kB/s | ||
+ | delay_pools 1 | ||
+ | delay_class | ||
+ | delay_parameters 1 32768/ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | # 50 kB/s | ||
+ | delay_pools 1 | ||
+ | delay_class | ||
+ | delay_parameters 1 65536/ | ||
+ | delay_access 1 allow all ancho_de_banda | ||
+ | </ | ||
+ | |||
+ | |||
+ | === Filtrado === | ||
+ | |||
+ | Dentro del archivo **/ | ||
+ | |||
+ | < | ||
+ | redirect_program / | ||
+ | redirect_children 6 | ||
+ | </ | ||
+ | |||
+ | |||
+ | == Configuración de SquidGuard == | ||
+ | |||
+ | **/ | ||
+ | < | ||
+ | dbhome / | ||
+ | logdir / | ||
+ | |||
+ | destination bl_homerepair { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_gardening { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_culinary { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_porn { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | expressionlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_ringtones { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_whitelist { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_weapons { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_kidstimewasting { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_spyware { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_audio-video { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_webmail { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_financial { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_weather { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_childcare { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_virusinfected { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_chat { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_desktopsillies { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_searchengines { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_naturism { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_aggressive { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_clothing { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_ecommerce { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_marketingware { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_astrology { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_jobsearch { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_gambling { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_updatesites { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_ads { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | expressionlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_entertainment { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_cleaning { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_artnudes { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_vacation { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_sports { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_blog { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_religion { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_mixed_adult { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_frencheducation { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_pets { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_mobile-phone { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_mail { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_dating { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_guns { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_verisign { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_cellphones { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_beerliquorinfo { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_onlinepayment { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_government { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_drugs { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_beerliquorsale { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_hygiene { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_onlineauctions { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_warez { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_dialers { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_antispyware { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_adult { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_instantmessaging { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_news { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_socialnetworking { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_jewelry { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_filehosting { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_reaffected { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_phishing { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_medical { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_violence { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_personalfinance { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_sportnews { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_banking { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_sexuality { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_games { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_sect { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_onlinegames { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_hacking { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_shopping { | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_radio { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination bl_proxy { | ||
+ | urllist blacklists/ | ||
+ | domainlist blacklists/ | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | destination excepciones { | ||
+ | expressionlist excepciones.destexprlist | ||
+ | urllist excepciones.desturllist | ||
+ | domainlist excepciones.destdomainlist | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | destination Restricciones_a_mano { | ||
+ | urllist Restricciones_a_mano.desturllist | ||
+ | domainlist Restricciones_a_mano.destdomainlist | ||
+ | expressionlist Restricciones_a_mano.destexprlist | ||
+ | logfile squidguard.log | ||
+ | } | ||
+ | |||
+ | src admin { | ||
+ | ip | ||
+ | } | ||
+ | | ||
+ | |||
+ | acl { | ||
+ | default { | ||
+ | pass excepciones !denegados_a_mano !bl_audio-video !bl_proxy !bl_warez !bl_porn !bl_filehosting !bl_adult | ||
+ | redirect http:// | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | En el apartado **redirect** indicamos al squidGuard que nos muestre un contenido especial cuando intentamos acceder a ubicaciones filtradas. Cuando vemos **%u** nos referimos a la variable de url, y podemos obtenerla por medio de los datos GET | ||
+ | |||
+ | Otras variables que podemos exportar por GET son : | ||
+ | * **%a** La dirección IP del cliente | ||
+ | * **%i** El nombre de usuario del cliente | ||
+ | * **%n** Dominio al que se intento acceder | ||
+ | * **%p** Variable that holds the REQUEST_URI, | ||
+ | * **%s** Variable that holds the matched source group (client group) or " | ||
+ | * **%t** Variable that holds the matched destination group (target group) or " | ||
+ | * **%u** Variable that holds the requested URL. | ||
+ | |||
+ | |||
+ | |||
+ | == Blacklist == | ||
+ | |||
+ | |||
+ | Listado de sitios prohibidos organizados por categorias. A continuacion describimos cada unas de las mismas: | ||
+ | |||
+ | ^^Categoria^Descripcion^^ | ||
+ | |ads | ||
+ | |adult | ||
+ | |aggressive | ||
+ | |antispyware | ||
+ | |artnudes | ||
+ | |astrology | ||
+ | |audio-video | ||
+ | |banking | ||
+ | |beerliquorinfo | ||
+ | |beerliquorsale | ||
+ | |Blog | ||
+ | |cellphones | ||
+ | |chat | ||
+ | |childcare | ||
+ | |cleaning | ||
+ | |clothing | ||
+ | |culnary | ||
+ | |dating | ||
+ | |desktopsillies | ||
+ | |dialers | ||
+ | |drugs | ||
+ | |ecommerce | ||
+ | |entertainment | ||
+ | |filehosting | ||
+ | |frencheducation | ||
+ | |gambling | ||
+ | |games | ||
+ | |gardening | ||
+ | |government | ||
+ | |guns | ||
+ | |hacking | ||
+ | |homerepair | ||
+ | |hygiene | ||
+ | |instantmessaging | ||
+ | |jewelry | ||
+ | |jobsearch | ||
+ | |kidstimewasting | ||
+ | |mail | ||
+ | |marketingware | ||
+ | |medical | ||
+ | |mixed_adult | ||
+ | |naturism | ||
+ | |news | ||
+ | |onlineauctions | ||
+ | |onlinegames | ||
+ | |onlinepayment | ||
+ | |personalfinance | ||
+ | |pets | ||
+ | |phishing | ||
+ | |porn | ||
+ | |proxy | ||
+ | |radio | ||
+ | |religion | ||
+ | |ringtones | ||
+ | |searchengines | ||
+ | |sect | ||
+ | |sexuality | ||
+ | |shopping | ||
+ | |socialnetworking | ||
+ | |sportnews | ||
+ | |sports | ||
+ | |spyware | ||
+ | |updatesites | ||
+ | |vacation | ||
+ | |violence | ||
+ | |virusinfected | ||
+ | |warez | ||
+ | |weather | ||
+ | |weapons | ||
+ | |webmail | ||
+ | |whitelist | ||
+ | |||
+ | === Referencias === | ||
+ | |||
+ | ^^URL^Descripción^^ | ||
+ | |http:// | ||
+ | |http:// | ||
+ | |http:// | ||
+ | |http:// | ||
+ | |||
+ | ===== Balanceo de Carga ===== | ||
+ | |||
+ | ==== Squid + Red Hat Cluster Suite ==== | ||
+ | |||
+ | Supongamos que tenemos dos servidores proxy 10.1.2.103 y 10.1.2.105 y ambos atienden por una ip virtual 10.1.2.106 | ||
+ | |||
+ | === LVS === | ||
+ | |||
+ | Configuracion de la utilidad IPVS de Linux Virtual Server | ||
+ | |||
+ | |||
+ | == / | ||
+ | |||
+ | |||
+ | < | ||
+ | -A -t 10.1.2.106: | ||
+ | -a -t 10.1.2.106: | ||
+ | -a -t 10.1.2.106: | ||
+ | </ | ||
+ | |||
+ | |||
+ | == ipvsadm -L == | ||
+ | |||
+ | < | ||
+ | IP Virtual Server version 1.2.1 (size=4096) | ||
+ | Prot LocalAddress: | ||
+ | -> RemoteAddress: | ||
+ | TCP lvs-proxy.cayu.com.ar: | ||
+ | -> proxy2.cayu.com.ar: | ||
+ | -> proxy1.cayu.com.ar: | ||
+ | </ | ||
+ | |||
+ | El sistema balancea por medio del algoritmo wlc. | ||
+ | |||
+ | === Piranha === | ||
+ | |||
+ | Piranha es un producto de clustering de Red Hat, incluye el demonio de control de LVS de Red Hat, y una herramienta de configuracion web del cluster. | ||
+ | |||
+ | La herramienta de monitoreo de piranha tiene dos caracteristicas principales : | ||
+ | |||
+ | |||
+ | * Soporte integrado de Heartbeat. | ||
+ | * Chequeo de disponibilidad de servicios en los servidores. | ||
+ | |||
+ | |||
+ | La herramienta de monitoreo de piranha usa el proceso heartbeat por medio de mensajes UDP entre los nodos balanceados y un servicio que se encarga de monitorear que ciertos procesos esten corriendo. | ||
+ | |||
+ | Configuracion de Piranha en el servidor primario | ||
+ | |||
+ | == / | ||
+ | |||
+ | |||
+ | <code java> | ||
+ | serial_no = 69 | ||
+ | primary = 10.1.2.103 | ||
+ | service = lvs | ||
+ | backup_active = 1 | ||
+ | backup = 10.1.2.105 | ||
+ | heartbeat = 1 | ||
+ | heartbeat_port = 539 | ||
+ | keepalive = 4 | ||
+ | deadtime = 18 | ||
+ | network = direct | ||
+ | debug_level = NONE | ||
+ | monitor_links = 0 | ||
+ | virtual proxy { | ||
+ | | ||
+ | | ||
+ | | ||
+ | port = 8080 | ||
+ | pmask = 255.255.255.0 | ||
+ | send = "GET cache_object:// | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | Configuracion de Piranha en el servidor secundario | ||
+ | |||
+ | == / | ||
+ | |||
+ | |||
+ | <code java> | ||
+ | serial_no = 55 | ||
+ | primary = 10.1.2.103 | ||
+ | service = lvs | ||
+ | backup_active = 1 | ||
+ | backup = 10.1.2.105 | ||
+ | heartbeat = 1 | ||
+ | heartbeat_port = 539 | ||
+ | keepalive = 4 | ||
+ | deadtime = 18 | ||
+ | network = direct | ||
+ | debug_level = NONE | ||
+ | monitor_links = 0 | ||
+ | virtual proxy { | ||
+ | | ||
+ | | ||
+ | | ||
+ | port = 8080 | ||
+ | pmask = 255.255.255.0 | ||
+ | send = "GET cache_object:// | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | Se agrego la configuracion para la interface virtual lo:0 / | ||
+ | < | ||
+ | DEVICE=lo:0 | ||
+ | IPADDR=10.1.2.106 | ||
+ | NETMASK=255.255.255.255 | ||
+ | # | ||
+ | # If you're having problems with gated making 127.0.0.0/8 a martian, | ||
+ | # you can change this to something else (255.255.255.255, | ||
+ | # | ||
+ | ONBOOT=yes | ||
+ | NAME=lvsIP | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
===== Referencias ===== | ===== Referencias ===== | ||
- | http:// | + | http:// |
- | http:// | + | http:// |
- | http://es.wikipedia.org/wiki/Squid_(programa) | + | http://wiki.squid-cache.org/ |
+ | http://wiki.squid-cache.org/ | ||
+ | |||
+ | http:// | ||
+ | --- // | ||
manuales/servidor_squid.txt · Última modificación: 2012/04/16 15:39 por cayu