Difference between revisions of "SquidConfiguration"
Spatialguru (talk | contribs) m (add initial notes) |
Spatialguru (talk | contribs) m (add initial notes) |
||
Line 2: | Line 2: | ||
Getting basic Squid running wasn't too hard at all: | Getting basic Squid running wasn't too hard at all: | ||
As root user edit: | As root user edit: | ||
− | < | + | <pre> |
/etc/squid/squid.conf | /etc/squid/squid.conf | ||
− | </ | + | </pre> |
Add to the top: | Add to the top: | ||
− | < | + | <pre> |
visible_hostname hda.local | visible_hostname hda.local | ||
http_port 3128 transparent accel vport | http_port 3128 transparent accel vport | ||
Line 15: | Line 15: | ||
acl intranet src 192.168.0.0/24 | acl intranet src 192.168.0.0/24 | ||
http_access allow intranet | http_access allow intranet | ||
− | </ | + | </pre> |
Referred to [http://www.redhatmagazine.com/2007/04/11/squid-in-5-minutes/ this article] for the approach. But note that there is a correction to the ''acl intranet src 192.168.0.0/24'' line, included above. He was missing ''src'' in that line. | Referred to [http://www.redhatmagazine.com/2007/04/11/squid-in-5-minutes/ this article] for the approach. But note that there is a correction to the ''acl intranet src 192.168.0.0/24'' line, included above. He was missing ''src'' in that line. | ||
Line 21: | Line 21: | ||
== Start Up == | == Start Up == | ||
Start Squid: | Start Squid: | ||
− | < | + | <pre> |
service squid start | service squid start | ||
− | </ | + | </pre> |
== Set Up Clients == | == Set Up Clients == |
Revision as of 18:46, 24 September 2008
Configuration
Getting basic Squid running wasn't too hard at all: As root user edit:
/etc/squid/squid.conf
Add to the top:
visible_hostname hda.local http_port 3128 transparent accel vport cache_dir ufs /var/spool/squid 1000 16 256 cache_access_log /var/log/squid/access.log acl intranet src 192.168.0.0/24 http_access allow intranet
Referred to this article for the approach. But note that there is a correction to the acl intranet src 192.168.0.0/24 line, included above. He was missing src in that line.
Start Up
Start Squid:
service squid start
Set Up Clients
In web browser, goto its settings or preferences and enter a Proxy Server using host/server URL as: hda. No username or password required.
Now when you view a web page, it stores a cached copy on the server. Then when you look at it again, it uses the cache instead of downloading it all again.
Monitor
To see if it is working watch the log file expand while browsing to new pages:
tail -f /var/log/squid/access.log
Issues
Browsing to our custom HDA domains doesn't work, e.g. http://wiki or http://calendar. There are various approaches to fixing this, but I don't know how to do them so far.
Making it transparent, so clients don't need any web browser proxy server settings, is also very possible. You use iptables (also already installed and running) to forward port 80 traffic to the squid server port 3128. I tried but didn't get it working. I was sure how to remove the iptables entries, so I just turned that service off and all was back to normal.