server_configuration:squid

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revisionBoth sides next revision
server_configuration:squid [2021/04/15 07:29] davidserver_configuration:squid [2021/04/15 07:41] david
Line 1: Line 1:
 +====== Squid Proxy ======
 +
 ''squid'' is a popular proxy server, if one wishes to access the outside world pretending to be the droplet in wherever it is... Handy for various things. ''squid'' is a popular proxy server, if one wishes to access the outside world pretending to be the droplet in wherever it is... Handy for various things.
   - [[http://etutorials.org/Server+Administration/Squid.+The+definitive+guide/|Squid. The definitive guide - etutorials.org]]   - [[http://etutorials.org/Server+Administration/Squid.+The+definitive+guide/|Squid. The definitive guide - etutorials.org]]
 +
 +===== Install =====
  
 <code> <code>
Line 6: Line 10:
 apt-get install squid3 apt-get install squid3
  
 +# Backup original configuration to file named squid.conf.factory
 cp -v /etc/squid/squid.conf{,.factory} cp -v /etc/squid/squid.conf{,.factory}
- 
- 
 </code> </code>
  
-Firewall+===== Firewall Configuration =====
  
 See notes under: [[server_configuration:firewall|Firewall]] See notes under: [[server_configuration:firewall|Firewall]]
 +
 <code> <code>
 ufw status ufw status
 ufw allow squid ufw allow squid
-ufw reload 
 ufw status ufw status
 +</code>
 +
 +
 +===== Configure Squid =====
 +
 +View the existing squid conf (with comments/documentation cut out)
 +<code>
 +cat /etc/squid/squid.conf | grep -v -e '^\#' -e '^$'
 </code> </code>
  
Line 27: Line 38:
   403  ls -l /etc/squid/passwd   403  ls -l /etc/squid/passwd
   405  htpasswd /etc/squid/passwd david   405  htpasswd /etc/squid/passwd david
-</code> 
- 
-View the existing squid conf (with comments/documentation cut out) 
-<code> 
-cat /etc/squid/squid.conf | grep -v -e '^\#' -e '^$' 
 </code> </code>
  
Line 43: Line 49:
  
 <code> <code>
-# Add rule (before line matching sed pattern)+# Add rule (BEFORE line matching sed pattern)
 sed -i '/http_access deny all/i http_access allow xxx.xxx.xxx.xxx' /etc/squid/squid.conf sed -i '/http_access deny all/i http_access allow xxx.xxx.xxx.xxx' /etc/squid/squid.conf
 +
 +# Add rule (AFTER line matching sed pattern)
 +sed -i '/http_access deny all/a http_access allow xxx.xxx.xxx.xxx' /etc/squid/squid.conf
  
 # Delete rule by sed pattern # Delete rule by sed pattern
Line 73: Line 82:
 </code> </code>
  
 +Check cache usage:
 +<code>
 +sudo du -h /var/spool/
 +</code>
  • server_configuration/squid.txt
  • Last modified: 2021/04/15 13:13
  • by david