After installing Varnish via sudo apt-get update && sudo apt-get install varnish
, and then:
sudo sed -i 's/Listen 80/Listen 8080/g' /etc/apache2/ports.conf
sudo sed -i 's/\*\:80/\*\:8080/g' /etc/apache2/sites-available/000-default.conf
sudo sed -i 's/DAEMON_OPTS="-a \:6081 \\/DAEMON_OPTS="-a \:80 \\/g' /etc/default/varnish
sudo systemctl restart apache2.service && sudo service varnish restart
If I go to a website that worked before this installation, I get:
ERR_CONNECTION_REFUSED.
This is wired because the backend default in /etc/varnish/default.vcl is .port = "8080";
.
- When executing either
varnishncsa
orvarnishlog
brings no output in Bash.
My question:
Why would this happen? Varnish is on port 80, Apache on 8080... What else could go wrong?
Notes:
I also tried to change 80 to 8080 in all of my website conf files. Besides the fact it didn't help, I already realized this was a mistake (the websites are accessed through port 80, hence in contrast to 000-default.conf their conf file port shouldn't change to 8080).