Dodany przez: Torrentow, 14:49 02-07-2013

Nowy Pobierz
  1. [root@centos ~]# cat /etc/squid/squid.conf
  2. # ACCESS CONTROLS
  3. # -----------------------------------------------------------------------------
  4. #  TAG: acl
  5.  
  6. acl manager proto cache_object
  7. acl localhost src 127.0.0.1/32 ::1
  8. acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
  9.  
  10. # acl allow local network
  11.  
  12. acl lan src 10.4.4.0/24
  13.  
  14. # acl safe ports
  15.  
  16. acl SSL_ports port 443
  17. acl Safe_ports port 80          # http
  18. acl Safe_ports port 21          # ftp
  19. acl Safe_ports port 443         # https
  20. acl Safe_ports port 70          # gopher
  21. acl Safe_ports port 210         # wais
  22. acl Safe_ports port 1025-65535  # unregistered ports
  23. acl Safe_ports port 280         # http-mgmt
  24. acl Safe_ports port 488         # gss-http
  25. acl Safe_ports port 591         # filemaker
  26. acl Safe_ports port 777         # multiling http
  27. acl CONNECT method CONNECT
  28.  
  29. #  TAG: http_access
  30. #       Allowing or Denying access based on defined access lists
  31.  
  32. # Recommended minimum Access Permission configuration:
  33. #
  34. # Only allow cachemgr access from localhost
  35. http_access allow manager localhost
  36. http_access deny manager
  37.  
  38. # Deny requests to certain unsafe ports
  39. http_access deny !Safe_ports
  40.  
  41. # Deny CONNECT to other than secure SSL ports
  42. #http_access deny CONNECT !SSL_ports
  43.  
  44. # We strongly recommend the following be uncommented to protect innocent
  45. # web applications running on the proxy server who think the only
  46. # one who can access services on "localhost" is a local user
  47. #http_access deny to_localhost
  48. http_access deny to_localhost
  49.  
  50. #
  51. # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
  52. #
  53. http_access allow lan
  54. #http_access allow wlan
  55. #http_access allow vpn
  56.  
  57. # Example rule allowing access from your local networks.
  58. # Adapt localnet in the ACL section to list your (internal) IP networks
  59. # from where browsing should be allowed
  60. #http_access allow localnet
  61. http_access allow localhost
  62.  
  63. # And finally deny all other access to this proxy
  64. #http_access deny all
  65.  
  66. # NETWORK OPTIONS
  67. # -----------------------------------------------------------------------------
  68. #  TAG: http_port
  69. # Squid normally listens to port 3128
  70. http_port 3128 transparent
  71.  
  72. # MEMORY CACHE OPTIONS
  73. # -----------------------------------------------------------------------------
  74. #  TAG: cache_mem       (bytes)
  75. #       NOTE: THIS PARAMETER DOES NOT SPECIFY THE MAXIMUM PROCESS SIZE.
  76. #       IT ONLY PLACES A LIMIT ON HOW MUCH ADDITIONAL MEMORY SQUID WILL
  77. #       USE AS A MEMORY CACHE OF OBJECTS. SQUID USES MEMORY FOR OTHER
  78. #       THINGS AS WELL. SEE THE SQUID FAQ SECTION 8 FOR DETAILS.
  79. #Default:
  80. cache_mem 512 MB
  81.  
  82. #  TAG: maximum_object_size_in_memory   (bytes)
  83. #       Objects greater than this size will not be attempted to kept in
  84. #       the memory cache. This should be set high enough to keep objects
  85. #       accessed frequently in memory to improve performance whilst low
  86. #       enough to keep larger objects from hoarding cache_mem.
  87. #Default:
  88. # maximum_object_size_in_memory 512 KB
  89. maximum_object_size_in_memory 2048 KB
  90.  
  91. # DISK CACHE OPTIONS
  92. # -----------------------------------------------------------------------------
  93. #  TAG: cache_dir
  94. # Uncomment and adjust the following to add a disk cache directory.
  95. #cache_dir ufs /var/spool/squid3 2048 16 256
  96. cache_dir ufs /var/spool/squid 5120 16 256
  97.  
  98. #  TAG: maximum_object_size_in_memory   (bytes)
  99. #       Objects greater than this size will not be attempted to kept in
  100. #       the memory cache. This should be set high enough to keep objects
  101. #       accessed frequently in memory to improve performance whilst low
  102. #       enough to keep larger objects from hoarding cache_mem.
  103. maximum_object_size 512 MB
  104.  
  105. # LOGFILE OPTIONS
  106. # -----------------------------------------------------------------------------
  107. #  TAG: access_log
  108. #Default:
  109. # std log with ervey request
  110. access_log /var/log/squid/access.log squid
  111.  
  112. #  TAG: cache_log
  113. cache_log /var/log/squid/cache.log
  114. #cache_log /dev/null
  115.  
  116. cache_store_log /var/log/squid/store.log
  117.  
  118. logfile_rotate 5
  119. log_icp_queries off
  120.  
  121. # OPTIONS FOR TROUBLESHOOTING
  122. # -----------------------------------------------------------------------------
  123. #  TAG: coredump_dir
  124. #       By default Squid leaves core files in the directory from where
  125. #       it was started. If you set 'coredump_dir' to a directory
  126. #       that exists, Squid will chdir() to that directory at startup
  127. #       and coredump files will be left there.
  128. #
  129. #Default:
  130. # coredump_dir none
  131. #
  132.  
  133. # Leave coredumps in the first cache dir
  134. coredump_dir /var/spool/squid
  135.  
  136. # OPTIONS FOR TUNING THE CACHE
  137. # -----------------------------------------------------------------------------
  138. #  TAG: cache
  139. # Add any of your own refresh_pattern entries above these.
  140. refresh_pattern ^ftp:           1440    20%     10080
  141. refresh_pattern ^gopher:        1440    0%      1440
  142. refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
  143. refresh_pattern (Release|Packages(.gz)*)$      0       20%     2880
  144. # example lin deb packages
  145.  
  146. #refresh_pattern (\.deb|\.udeb)$   129600 100% 129600
  147. refresh_pattern .               0       20%     4320
  148.  
  149. # HTTP OPTIONS
  150. # -----------------------------------------------------------------------------
  151. request_header_access Referer deny all
  152. request_header_access X-Forwarded-For deny all
  153. request_header_access Via deny all
  154. request_header_access Cache-control allow all
  155.  
  156. # ADMINISTRATIVE PARAMETERS
  157. # -----------------------------------------------------------------------------
  158. #  TAG: visible_hostname
  159. #Default:
  160. visible_hostname labolatory
  161.  
  162. # ICAP OPTIONS
  163. # -----------------------------------------------------------------------------
  164.  
  165. #icap_enable on
  166. #icap_preview_enable  on
  167. #icap_preview_size    128
  168. #icap_send_client_ip  on
  169. #icap_client_username_header X-Authenticated-User
  170.  
  171. #icap_service service_req  reqmod_precache bypass=1 icap://127.0.0.1:1344/squidclamav
  172. #icap_service service_resp respmod_precache bypass=0  icap://127.0.0.1:1344/squidclamav
  173.  
  174. adaptation_access service_req deny CONNECT
  175. adaptation_access service_req allow all
  176. adaptation_access service_resp deny CONNECT
  177. adaptation_access service_resp allow all
  178.  
  179. # MISCELLANEOUS
  180.  
  181.  
  182. # -----------------------------------------------------------------------------
  183.  
  184. #icap_enable on
  185. #icap_preview_enable  on
  186. #icap_preview_size    128
  187. #icap_send_client_ip  on
  188. #icap_client_username_header X-Authenticated-User
  189.  
  190. #icap_service service_req  reqmod_precache bypass=1 icap://127.0.0.1:1344/squidclamav
  191. #icap_service service_resp respmod_precache bypass=0  icap://127.0.0.1:1344/squidclamav
  192.  
  193. #adaptation_access service_req deny CONNECT
  194. #adaptation_access service_req allow all
  195. #adaptation_access service_resp deny CONNECT
  196. #adaptation_access service_resp allow all
  197.  
  198. # MISCELLANEOUS
  199. # -----------------------------------------------------------------------------
  200.  
  201. #  TAG: forwarded_for   on|off|transparent|truncate|delete
  202. #       If set to "on", Squid will append your client's IP address
  203. #       in the HTTP requests it forwards.
  204. #forwarded_for transparent
  205. forwarded_for on
  206.  
  207. #url_rewrite_program /usr/bin/adzapper.wrapper
  208. #  TAG: redirect_program
  209. #       Redirect squidguard configuration directory
  210. #url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf
  211. #url_rewrite_children 5
  212. #url_rewrite_concurrency 0
  213. #url_rewrite_program
  214. #url_rewrite_program /usr/bin/adzapper.wrapper "/usr/bin/squidGuard -c /etc/squid/squidGuard.conf" "/usr/bin/python /usr/share/videocac
  215. #he/videocache.py"
  216. #url_rewrite_children 10
  217.  

Źródło:

Ostatnie wpisy

Linki

Funkcje