User Tools

Site Tools


public:squid_update_proxy

Differences

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

Link to this comparison view

Next revision
Previous revision
public:squid_update_proxy [2020/03/11 16:50] – created jehaverlackpublic:squid_update_proxy [2024/01/25 03:31] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Linux Update Proxy Server ====== ====== Linux Update Proxy Server ======
-A light weight squid proxy can be used to cached RPM and Deb packages for both Redhat and Debian based Linux systems.+A light weight Squid Proxy can be used to cached RPM and Deb packages for both RedHat (CentOS) and Debian based Linux systems.  The squid proxy server can be configured to require a login by proxy clients.  Both YUM and APT-GET can be configured to use the proxy server for downloading package updates.  Once one client has download a specific package it will be cached on the Squid Proxy server such that other hosts requesting the same package will not need to use Internet bandwidth to do so.  One caveat is that all YUM and APT clients need to use the same mirror for updates, otherwise if the same package is coming from different mirrors it will get downloaded from the Internet multiple times.
  
 +See: https://stackoverflow.com/questions/3297196/how-to-set-up-a-squid-proxy-with-basic-username-and-password-authentication
 ===== Serverside ===== ===== Serverside =====
 +
 +Add the following to the Squid Config:
 +
 +**/etc/squid/squid.conf**
 +<code>
 +...
 +
 +# Auth
 +auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd
 +auth_param basic children 5
 +auth_param basic realm Squid Basic Authentication
 +auth_param basic credentialsttl 2 hours
 +acl auth_users proxy_auth REQUIRED
 +http_access allow auth_users
 +
 +#
 +# Recommended minimum Access Permission configuration:
 +#
 +# Deny requests to certain unsafe ports
 +http_access deny !Safe_ports
 +
 +...
 +
 +# Uncomment and adjust the following to add a disk cache directory.
 +#cache_dir ufs /var/spool/squid 100 16 256
 +cache_dir ufs /squid-cache 45000 16 256
 +
 +</code>
 +
 +Use htpasswd to create the password file with the **update-user**:
 +<code>
 +sudo htpasswd -c /etc/squid3/passwd update-user
 +</code>
 +
 +==== Firewall ====
 +Be sure to open up firewall services for squid on port 3128.
 +
 +e.g. on CentOS 7,8
 +<code>
 +firewall-cmd --zone=public --add-service=squid --permanent
 +</code>
  
  
  
 ===== Clientside ===== ===== Clientside =====
 +
 +==== RedHat / CentOS ====
 +On YUM clients append the following lines to
 +
 +**/etc/yum.conf**
 +<code>
 +proxy=http://SQUID_SERVER_IP:3128
 +proxy_username=update-user
 +proxy_password=********
 +</code>
 +
 +==== Debian / Ubuntu / Raspbian ====
 +On apt-get Clients create the file:
 +
 +/etc/apt/apt.conf.d/apt.conf
 +<code>
 +Acquire::http::Proxy "http://update-user:********@SQUID_SERVER_IP:3128/";
 +</code>
 +
 +
 +Then run apt-get update or apt-get install a package
  
public/squid_update_proxy.1583945450.txt.gz · Last modified: 2024/01/25 03:32 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki