Squid: Difference between revisions
From Leo's Notes
This page was last edited on 24 June 2017, at 03:30.
Created page with "Squid is an open source caching and forwarding HTTP proxy server. == Quick Usage Guide == To quickly get Squid set up as a HTTP proxy server with caching enabled, install squ..." |
No edit summary |
||
| Line 35: | Line 35: | ||
}} | }} | ||
== Other == | |||
=== Force Yum/DNF to use Squid === | |||
Specify the {{code|proxy}} option in {{code|/etc/yum.conf}} or {{code|/etc/dnf/dnf.conf}} with the URL of the HTTP proxy. | |||
Eg: | |||
{{highlight|lang=text|code= | |||
proxy=http://squid.home.steamr.com:3128 | |||
}} | |||
Alternatively, set the {{code|http_proxy}} value in the environment. | |||
[[Category:Linux]] | [[Category:Linux]] | ||
Revision as of 03:30, 24 June 2017
Squid is an open source caching and forwarding HTTP proxy server.
Quick Usage Guide
To quickly get Squid set up as a HTTP proxy server with caching enabled, install squid and configure it like so:
## Install squid
# yum -y install squid
Configure squid. The configuration located at /etc/squid/squid.conf should have at least the following lines:
# Allow localhost and our local network
http_access allow localhost
http_access allow localnet
# Our local network IP subnet. Adjust this accordingly
acl localnetsrc 10.1.1.0/22
# Use DNS IPv4 lookups first
dns_v4_first on
# Amount of memory used for caching objects
cache_mem 1024 MB
# Maximum object size to cache
maximum_object_size 4096 MB
# Maximum size of cached objects in memory
maximum_object_size_in_memory 8192 KB
# Location of the cache directory
# 2nd parameter is the size of the cache. 10240 = 10 GB
cache_dir ufs /mnt/cache/squid 10240 16 256
Other
Force Yum/DNF to use Squid
Specify the proxy option in /etc/yum.conf or /etc/dnf/dnf.conf with the URL of the HTTP proxy.
Eg:
proxy=http://squid.home.steamr.com:3128
Alternatively, set the http_proxy value in the environment.