This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
misc:2015brainstormpress [2015/02/20 15:19] tschulz [Other Squid configs] |
misc:2015brainstormpress [2015/02/20 15:41] tschulz [Detailed Caching Install Notes] |
||
---|---|---|---|
Line 12: | Line 12: | ||
* Debian/Ubuntu updates (apt-get) | * Debian/Ubuntu updates (apt-get) | ||
* Steam game updates (storeid will be need to handle CDNS) | * Steam game updates (storeid will be need to handle CDNS) | ||
+ | * adobe (flash/shockwave/reader) | ||
+ | * Oracle (java) | ||
===== What updates can't be cached ===== | ===== What updates can't be cached ===== | ||
Line 21: | Line 23: | ||
* Squid 3.4 or higher (3.5.1 compiled/sorry no package:)) | * Squid 3.4 or higher (3.5.1 compiled/sorry no package:)) | ||
* recommend setting up cache server as transparent proxy (enable IPv4 packet forwarding, forward port 80 to squid) | * recommend setting up cache server as transparent proxy (enable IPv4 packet forwarding, forward port 80 to squid) | ||
+ | * ZFS raidz works really well for cache store | ||
===== Squid notable config changes ===== | ===== Squid notable config changes ===== | ||
- | * <file>http_port 3129 intercept</file> | + | * Enable Transparent Proxying<file>http_port 3129 intercept</file> |
- | * <file>maximum_object_size 5000 MB | + | * Set Max Object Size to something large<file>maximum_object_size 5000 MB |
range_offset_limit -1 | range_offset_limit -1 | ||
quick_abort_min -1 KB | quick_abort_min -1 KB | ||
</file> | </file> | ||
- | * <file>cache_dir ufs /var/spool/squid 50000 16 256</file> | + | * Set a large cache store<file>cache_dir ufs /var/spool/squid 50000 16 256</file> |
- | * <file>acl updatesites dstdom_regex "/etc/squid/updatesites.txt" | + | * Only allow caching from update sites<file>acl updatesites dstdom_regex "/etc/squid/updatesites.txt" |
cache allow updatesites | cache allow updatesites | ||
cache deny all</file> | cache deny all</file> | ||
- | * <file>store_id_access allow updatesites | + | * Setup store_id for CDN Matching<file>store_id_access allow updatesites |
#store_id_access allow steamcdn | #store_id_access allow steamcdn | ||
store_id_access deny all | store_id_access deny all | ||
store_id_program /usr/lib/squid/storeid_file_rewrite /etc/squid/storeid_rewrite.conf | store_id_program /usr/lib/squid/storeid_file_rewrite /etc/squid/storeid_rewrite.conf | ||
store_id_children 10 startup=3 idle=1 concurrency=0</file> | store_id_children 10 startup=3 idle=1 concurrency=0</file> | ||
- | * <file>refresh_pattern ([^.]+.|)adobe.com/.*\.(zip|exe) 43200 100% 43200 reload-into-ims ignore-reload ignore-no-store override-expire overr | + | * Override Cache timeouts and other cache HTTP headers<file>refresh_pattern ([^.]+.|)adobe.com/.*\.(zip|exe) 43200 100% 43200 reload-into-ims ignore-reload ignore-no-store override-expire overr |
refresh_pattern ([^.]+.|)java.com/.*\.(zip|exe) 43200 100% 43200 reload-into-ims ignore-reload ignore-no-store override-expire overri | refresh_pattern ([^.]+.|)java.com/.*\.(zip|exe) 43200 100% 43200 reload-into-ims ignore-reload ignore-no-store override-expire overri | ||
refresh_pattern ([^.]+.|)sun.com/.*\.(zip|exe) 43200 100% 43200 reload-into-ims ignore-reload ignore-no-store override-expire overrid | refresh_pattern ([^.]+.|)sun.com/.*\.(zip|exe) 43200 100% 43200 reload-into-ims ignore-reload ignore-no-store override-expire overrid | ||
Line 65: | Line 68: | ||
^http:\/\/[^\.]+\.phobos\.apple\.com\/(.*) http://appupdates.apple.squid.internal/$1 | ^http:\/\/[^\.]+\.phobos\.apple\.com\/(.*) http://appupdates.apple.squid.internal/$1 | ||
</file> | </file> | ||
- | * <file>([^.]+.|)adobe.com | + | * <file config updatesites.txt>([^.]+.|)adobe.com |
([^.]+.|)java.com | ([^.]+.|)java.com | ||
([^.]+.|)sun.com | ([^.]+.|)sun.com | ||
Line 77: | Line 80: | ||
([^.]+.|)gstatic.com | ([^.]+.|)gstatic.com | ||
</file> | </file> | ||
+ | * <file bash rc.local>iptables -t nat -A PREROUTING -p tcp --dport 80 -j DNAT --to 10.1.0.21:3129 | ||
+ | exit 0 | ||
+ | </file> | ||
+ | * <file bash sysctl.conf>... | ||
+ | net.ipv4.ip_forward=1 | ||
+ | ...</file> | ||
+ | |||
+ | |||
+ | ===== Detailed Caching Install Notes ===== | ||
+ | * [[web_services:squid_update_cache|Squid Based Update Cache (Ubuntu 14.04)]] | ||
+ | * [[fileservices:zfs_ubuntu|ZFS on Ubuntu]] | ||