Squid for freebsd. {thanks to MaUi}

Posted: July 17, 2010 in Freebsd

Thanks to SiXtoSiX Cyber Cafe.

If some want to use this squid.conf please use you “BRAIN” to reconfigure

This script is for guide only.

# Transparent Proxy : Squid 2.7 use “transparent”, Squid 3 use “intercept”.
http_port 44445 transparent
hierarchy_stoplist cgi-bin ?
cache_mem 8 MB
memory_replacement_policy heap GDSF
#memory_replacement_policy lru
cache_replacement_policy lru
maximum_object_size 4096 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 8 KB
cache_dir ufs /maui1/squid_cache 2500 16 256
cache_access_log /var/log/squid.log
#cache_log /var/log/squid.log
#cache_store_log /var/log/squid.log
#cache_access_log /dev/null
cache_log /dev/null
cache_store_log /dev/null
log_ip_on_direct off
pid_filename /usr/local/squid/logs/squid.pid
client_netmask 255.255.255.0
ftp_user XXXXXX
ftp_passive on
ftp_sanitycheck on
ftp_telnet_protocol on
dns_nameservers 127.0.0.1 83.170.64.2 8.8.8.8
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320
acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl localnet0 src 192.168.1.0/255.255.255.0
acl acsnet0 src 63.87.170.71/255.255.255.255
acl acsnet1 src 58.26.12.35/255.255.255.255
acl tmnet0 src 60.0.0.0/255.0.0.0
acl tmnet1 src 203.0.0.0/255.0.0.0
acl tmnet2 src 124.0.0.0/255.0.0.0
acl tmnet3 src 118.0.0.0/255.0.0.0
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563
acl Safe_ports port 80          # http
acl Safe_ports port 82          # torrent
acl Safe_ports port 83          # webui
acl Safe_ports port 21          # ftp
acl Safe_ports port 443 563     # https, snews
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
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 allow localhost
http_access allow localnet0
http_access allow acsnet0
http_access allow acsnet1
#http_access allow tmnet0
#http_access allow tmnet1
#http_access allow tmnet2
#http_access allow tmnet3
http_access deny all
http_access allow Safe_ports
http_access deny !Safe_ports
http_access allow SSL_ports
http_access deny CONNECT !SSL_ports
http_reply_access allow all
icp_access allow all
reply_header_max_size 20 KB
reply_body_max_size 0 allow all
# —– user-agent spoofing
# —– bypass tmnet international torrent tracker/seeder block
header_access User-Agent deny all
# —– Firefox 3 on X11 FreeBSD user-agent string
#header_replace User-Agent Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.0.10) Gecko/2009060215 Firefox/3.0.11
# —– Firefox 3.5 on X11 FreeBSD user-agent string
#header_replace User-Agent Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.0.10) Gecko/20090624 Firefox/3.5
# —– Firefox 3.5.5 on X11 FreeBSD user-agent string
header_replace User-Agent Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
# —– Firefox 3 on Windows XP
#header_replace User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1) Gecko/2009060215 Firefox/3.0.11 (.NET CLR 3.5.30729)
# —– Firefox 3.5 on Windows XP
#header_replace User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)
# —– Firefox 3.5 on Windows Vista
#header_replace User-Agent Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)
# —– IE7 on Windows XP
#header_replace User-Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
# —– IE7 on Windows Vista user-agent string
#header_replace User-Agent Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
# —– IE8 on Windows Vista user-agent string
#header_replace User-Agent Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; InfoPath.2; .NET CLR 3.5.30729; .NET CLR 3.0.30618)
# —– IE8 on Windows 7 user-agent string
#header_replace User-Agent Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
# —– end of user-agent spoofing
cache_mgr starbucks.mine.nu
cache_effective_user squid
cache_effective_group squid
client_db off
maximum_single_addr_tries 3
coredump_dir /usr/local/squid/cache
pipeline_prefetch off
request_entities off
request_body_max_size 0 KB
ie_refresh off
# to disable/bypass caching, only proxy.
# cache deny all

# Facebook cache { thanks to MaUi}

server_http11 on

Comments
  1. maui says:

    This is old config, but still working, just to add, for squid 2.7 need to add “server_http11 on” to enable the http/1.1 protocol, as facebook website already using that, or else it will you a blank page when enter facebook website.

    Squid 3.1 now natively support http/1.1 (but not fully yet), and the config file is different.

    Thanks. – maui.

  2. ahchai says:

    thanks Maui but if you have the Squid 3.1 and run smooth on freebsd, and if you want to share it ..
    it will be good …

  3. I would like to exchange links with your site panaharjuna.wordpress.com
    Is this possible?

  4. […] please see squid.conf on https://panaharjuna.wordpress.com/2010/07/17/squid-for-freebsd-thanks-to-maui/ […]

  5. mauix says:

    squid 3.1 config are here :

    http://azmawee.pbworks.com/f/squid.3.1.mauix.conf

    But I think squid 2.x were more fast as they (squid dev team) are focusing 2.X for speed/performance and 3.X are for more feature. By the way squid 3.x are http/1.1 protocol build-in! 😀

    most of my config files were shared on my works space at azmawee.pbworks.com

    Thanks.

  6. jane says:

    All these issues are important, and that’s why I just started blogging a while ago and it feels great

  7. mauix says:

    Hey, check out my new blog at http://azmawee.wordpress.com

    Finished up some howto’s and some squid conf for delay pool. 😀

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s