VM Config
VM Specifications:
- CPU: 1vCPU (2 cores)
- RAM: 2 GB
- HD: 100 GB
Change the hostname:
Update the IP:
Install
Update the system
Install the Pre-Reqs
During the install, you will prompted for the following:
"Allow HTTP tunnels through Apt-Cacher NG?"
Select Yes
Configure Apache services
Make the following changes:
ExThreshold represents the number of days after a package expires.
Verify the changes.
After the above changes, restart the service.
Use the followoing link to get a report of the packages that have been used:
http://apt01.domain.local:3142/acng-report.html
Firewall Changes
IPv6 is disabled in the template.
UFW is enabled in the template with a default policy todeny incoming, allow outgoing, and allow ssh.
Add firewall rules:
Restart UFW.Show the policies in a numbered order.
Secure Apt-Cacher-NG
To add login crednetials to the reporting pageTest to see if active directory group name could be usedsudo vi /etc/apt-cacher-ng/security.confAdminAuth: localadmin:keyPass
Secure the apt-cacher-ng login.
Access Control
Access to the cache server can be controlled by using the hosts.allow or hosts deny. If you want to block alllocal traffic execpt specific hosts, use the following:
Verify the changes:
Client Setup
OPTION 01:
Create the file and instert the following content.
OPTION 02:
Option 1 is the preferred method.
Troubleshooting
The default directory where bits are stored is: /var/cache/apt-cacher-ng/
Local Cache Cleanup
If the drive fills up, you can clean it by logging intothe web interface and click "Start Scan and/or Expiration." This will purge packages based on expiration.
Alternativley, the directory could be cleared manually.
Log files are located here:
References
- https://linuxconfig.org/quick-debian-ubuntu-package-caching-proxy-setup-with-apt-cacher-ng
- https://linuxhint.com/ubuntu_package_cache_server
- https://www.xmodulo.com/apt-caching-server-ubuntu-debian.html
- https://www.linuxsysadmins.com/setup-apt-cache-server-on-ubuntu
- https://www.tecmint.com/apt-cache-server-in-ubuntu
- https://fabianlee.org/2018/02/11/ubuntu-a-centralized-apt-package-cache-using-apt-cacher-ng