|
|
sudo apt-get install varnish
Also disable the varnish admin port
sudo cp -p /etc/default/varnish /etc/default/varnish.ORIG sudo vim /etc/default/varnish diff /etc/default/varnish /etc/default/varnish.ORIG 40c40,41 < DAEMON_OPTS="-a :80 \ --- > DAEMON_OPTS="-a :6081 \ > -T localhost:6082 \
cp -p /etc/apache2/ports.conf /etc/apache2/ports.conf.ORIG sudo vim /etc/apache2/ports.conf diff /etc/apache2/ports.conf /etc/apache2/ports.conf.ORIG 8c8 < NameVirtualHost *:8080 --- > NameVirtualHost *:80 10c10 < Listen 8080 --- > Listen 80
Now edit all the vhost files with two commands:
cd /etc/apache2/sites-available sudo perl -pi -w -e 's/\:80/\:8080/g;' *
The above command performs a search and replace on every file in the directory changing :80 to :8080
sudo service apache2 restart sudo service varnish restart
Source: https://foxhop.net/f3b10d0f-2f95-11f1-b9f1-e86a64d24d78/implementing-varnish-cache
Snapshot: 2026-05-25T00:28:31Z
Generator: Remarkbox 1527ef7