Differences
This shows you the differences between two versions of the page.
linux_wiki:squid_proxy [2015/10/08 23:05] billdozor |
linux_wiki:squid_proxy [2019/05/25 23:50] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Squid Proxy ====== | ||
- | **General Information** | ||
- | |||
- | Squid is "a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages." | ||
- | |||
- | Official Site: http:// | ||
- | |||
- | **Checklist** | ||
- | * Distro: Enterprise Linux 6.x | ||
- | |||
- | ---- | ||
- | |||
- | ====== Install Squid ====== | ||
- | |||
- | Squid is available in CentOS base repos. | ||
- | <code bash> | ||
- | yum install squid | ||
- | </ | ||
- | |||
- | * Main Config: / | ||
- | * Log file: / | ||
- | |||
- | ---- | ||
- | |||
- | ====== Configure ====== | ||
- | |||
- | Config: / | ||
- | |||
- | Modify " | ||
- | <code bash> | ||
- | acl localnet src 10.1.2.0/24 # my network | ||
- | </ | ||
- | |||
- | Delete/Add to the " | ||
- | <code bash> | ||
- | acl SSL_ports port 443 | ||
- | acl Safe_ports port 80 | ||
- | acl Safe_ports port 443 | ||
- | </ | ||
- | |||
- | Change Squid listening port (if needed) | ||
- | <code bash> | ||
- | # Default Squid listen port 3128 | ||
- | http_port 3128 | ||
- | </ | ||
- | |||
- | Uncomment the " | ||
- | <code bash> | ||
- | cache_dir ufs / | ||
- | </ | ||
- | * The " | ||
- | |||
- | ---- | ||
- | |||
- | ====== Run Squid ====== | ||
- | |||
- | Start squid | ||
- | <code bash> | ||
- | service squid start | ||
- | </ | ||
- | |||
- | Enable on boot | ||
- | <code bash> | ||
- | chkconfig squid on | ||
- | </ | ||
- | |||
- | View Access Log for proxy TCP Hits and Misses | ||
- | <code bash> | ||
- | tail -f / | ||
- | </ | ||
- | |||
- | ---- | ||
- | |||
- | ====== Point Clients to Squid ====== | ||
- | |||
- | You can configure web browsers to go through Squid to take advantage of cached content. | ||
- | |||
- | * Firefox | ||
- | * Options > Preferences > Advanced > Network tab > Connection Settings | ||
- | * Select " | ||
- | * HTTP Proxy: < | ||
- | * Port: < | ||
- | * Click Ok | ||
- | |||
- | ---- | ||
- | |||
- | ====== Web Filter ====== | ||
- | |||
- | Squid can also be used as a web filter. | ||
- | |||
- | ===== Block Domains ===== | ||
- | - Create a file of sites to reference | ||
- | - <code bash>vim / | ||
- | |||
- | # Blocked Websites | ||
- | www.google.com</ | ||
- | - Create a new acl in the main squid config | ||
- | - <code bash>vim / | ||
- | |||
- | ## Blocked Sites ## | ||
- | acl blockedsites dstdomain "/ | ||
- | http_access deny blockedsites</ | ||
- | - Reload Squid for changes to take affect | ||
- | - <code bash> | ||
- | |||
- | ===== Block Key Words ===== | ||
- | * Create file of key words | ||
- | * <code bash>vim / | ||
- | |||
- | # Blocked key words | ||
- | gaming</ | ||
- | * Create a new ACL in the main squid config | ||
- | * <code bash>vim / | ||
- | ## Block keywords ## | ||
- | acl blockedkeywords url_regex -i "/ | ||
- | http_access deny blockedkeywords</ | ||
- | |||
- | ---- |