Advertisement
Guest User

Squid Conf

a guest
Jul 7th, 2014
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.29 KB | None | 0 0
  1. # PORT and Transparent Option [GK]
  2. http_port 4524
  3. http_port 4525 tproxy
  4. httpd_suppress_version_string on
  5.  
  6. # PID File location, we can use it for various functions later, like for squid status (JZ)
  7. pid_filename /var/run/squid.pid
  8.  
  9. # Using 10 GB in this example per drive
  10. store_dir_select_algorithm round-robin
  11.  
  12. cache_dir aufs /squid/cache 10240 16 256
  13.  
  14. # Cache Replacement Policies [GK]
  15. cache_replacement_policy heap GDSF
  16. memory_replacement_policy heap GDSF
  17.  
  18. # If you want to enable DATE time n SQUID Logs,use following [GK]
  19. emulate_httpd_log on
  20. logformat squid %tl %6tr %>a %Ss/%03>Hs %<st %rm %ru %un %Sh/%<A %mt
  21. log_fqdn off
  22.  
  23. # How much days to keep users access web logs [GK]
  24. # You need to rotate your log files with a cron job. For example:
  25. # 0 0 * * * /usr/local/squid/bin/squid -k rotate
  26. logfile_rotate 14
  27. debug_options ALL,9
  28.  
  29. # Squid Logs Section
  30. # access_log none # To disable Squid access log, enable this option
  31.  
  32. cache_access_log /var/log/squid/access.log
  33. cache_log /var/log/squid/cache.log
  34. cache_store_log /var/log/squid/store.log
  35. #referer_log /var/log/squid/referer.log
  36. #mime_table /etc/squid/mime.conf
  37. log_mime_hdrs off
  38.  
  39. # I used DNSAMSQ service for fast dns resolving
  40. # so install by using "apt-get install dnsmasq" first / GK
  41. dns_nameservers 127.0.0.1
  42.  
  43. ftp_user anonymous@
  44. ftp_list_width 32
  45. ftp_passive on
  46. ftp_sanitycheck on
  47.  
  48. #ACL Section
  49. acl admin src 10.5.7.0/24 # Allow Admins
  50. acl client src 172.16.0.0/16 # Allow Clients
  51. acl localhost src 127.0.0.1/32
  52. acl to_localhost dst 127.0.0.0/8
  53.  
  54. ###### cache manager section start, You can remote it if not required ####
  55. # install following
  56. # apt-get install squid-cgi
  57. # add following entry in /etc/squid/cachemgr.conf
  58. # localhost:8080
  59. # then you can access it via http://squid_ip/cgi-bin/cachemgr.cgi
  60.  
  61. acl manager url_regex -i ^cache_object:// /squid-internal-mgr/
  62. acl managerAdmin src 10.5.7.0/24 # Change it to your management pc ip
  63. cachemgr_passwd xxxx all
  64. http_access allow manager localhost
  65. http_access allow manager managerAdmin
  66. http_access deny manager
  67. #http_access allow localhost
  68. ####### CACHGEMGR END #########
  69.  
  70. acl SSL_ports port 443 563 # https, snews
  71. acl SSL_ports port 873 # rsync
  72. acl Safe_ports port 80 # http
  73. acl Safe_ports port 21 # ftp
  74. acl Safe_ports port 53 # dns
  75. acl Safe_ports port 443 563 # https, snews
  76. acl Safe_ports port 70 # gopher
  77. acl Safe_ports port 210 # wais
  78. acl Safe_ports port 1025-65535 # unregistered ports
  79. acl Safe_ports port 280 # http-mgmt
  80. acl Safe_ports port 488 # gss-http
  81. acl Safe_ports port 591 # filemaker
  82. acl Safe_ports port 777 # multiling http
  83. acl Safe_ports port 631 # cups
  84. acl Safe_ports port 873 # rsync
  85. acl Safe_ports port 901 # SWAT
  86. acl purge method PURGE
  87. acl CONNECT method CONNECT
  88. http_access allow purge localhost
  89. http_access deny purge
  90. http_access deny !Safe_ports
  91. http_access deny CONNECT !SSL_ports
  92. http_access allow localhost
  93.  
  94. #===============================
  95. # Allow HTTP Access to Admin
  96. #===============================
  97.  
  98. http_access allow admin
  99. http_reply_access allow admin
  100. icp_access allow admin
  101.  
  102. #===============================
  103. # Allow HTTP Access to Client
  104. #===============================
  105.  
  106. http_access allow client
  107. http_reply_access allow client
  108. icp_access allow client
  109.  
  110. #===============================
  111. # Administrative Parameters [GK]
  112. #===============================
  113.  
  114. # User to run squid in Centos is squid, Group squid
  115.  
  116. cache_effective_user squid
  117. cache_effective_group squid
  118. cache_mgr xxxxx
  119. visible_hostname [email protected]
  120. unique_hostname [email protected]
  121.  
  122. #=================
  123. # ACCELERATOR [GK]
  124. #=================
  125. half_closed_clients off
  126. quick_abort_min 0 KB
  127. quick_abort_max 0 KB
  128. vary_ignore_expire on
  129. reload_into_ims on
  130. log_fqdn off
  131. memory_pools off
  132. cache_swap_low 90
  133. cache_swap_high 95
  134. max_filedescriptors 65536
  135. fqdncache_size 16384
  136. retry_on_error on
  137. offline_mode off
  138. pipeline_prefetch on
  139. check_hostnames off
  140. client_db on
  141. #range_offset_limit 128 KB
  142. #max_stale 1 week
  143. read_ahead_gap 1 KB
  144. forwarded_for off
  145. minimum_expiry_time 1960 seconds
  146. vary_ignore_expire on
  147.  
  148. # If you want to hide your proxy machine from being detected at various site use following [GK]
  149. via off
  150.  
  151. #==========================
  152. # Squid Memory Tunning [GK]
  153. #==========================
  154. # If you have 4GB memory in Squid box, we will use formula of 1/3
  155. # You can adjust it according to your need. IF squid is taking too much of RAM
  156. # Then decrease it to 512 MB or even less.
  157.  
  158. cache_mem 512 MB
  159. minimum_object_size 0 bytes
  160. maximum_object_size 500 MB
  161.  
  162. # Lower it down if your squid taking to much memory, e.g: 512 KB or even less
  163. maximum_object_size_in_memory 2 MB
  164.  
  165. #============================================================$
  166. # SNMP , if you want to generate graphs for SQUID via MRTG [GK]
  167. #============================================================$
  168. #acl snmppublic snmp_community gl
  169. #snmp_port 3401
  170. #snmp_access allow snmppublic all
  171. #snmp_access allow all
  172.  
  173. #===========================================================================
  174. To enable cache content to be delivered at full lan speed,
  175. # OR To bypass the queue at MT for cached contents / [GK]
  176. #===========================================================================
  177. tcp_outgoing_tos 0x30 admin
  178. tcp_outgoing_tos 0x30 client
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement