...
Run these commands
Code Block sudo apt-get install apt-transport-https curl http://repo.varnish-cache.org/debian/GPG-key.txt | sudo apt-key add - sudo sh -c 'echo "deb https://repo.varnish-cache.org/ubuntu/ trusty varnish-4.0" >> /etc/apt/sources.list.d/varnish-cache.list' sudo apt-get update sudo apt-get install varnish
Now edit the varnish setup
Code Block sudo nano /etc/default/varnish
- Change the line DAEMON_OPTS="-a :6081 \
- to DAEMON_OPTS="-a :80 \
- to DAEMON_OPTS="-a :80 \
- Change the line DAEMON_OPTS="-a :6081 \
LEMP + Drupal
Edit the default vcl
Code Block sudo nano /etc/varnish/default.vcl
- Copy this file into it: https://gist.github.com/labboy0276/cae7f121e1abe2321926cdf699702cd0
- Copy this file into it: https://gist.github.com/labboy0276/cae7f121e1abe2321926cdf699702cd0
Edit your hosts file
Code Block sudo nano /etc/nginx/sites-available/drupal
- Change the listen port from 80 to 8008
- Change the listen port from 80 to 8008
- LAMP + Wordpress
Edit the default vcl
Code Block sudo nano /etc/varnish/default.vcl
- Copy this file into it: https://gist.github.com/labboy0276/cae7f121e1abe2321926cdf699702cd0
- Copy this file into it: https://gist.github.com/labboy0276/cae7f121e1abe2321926cdf699702cd0
Edit the config:
Code Block sudo nano /etc/apache2/ports.conf
Add or change what is there for these values:
NameVirtualHost 127.0.0.1:8008 Listen 127.0.0.1:Code Block Change the Listen port to 8008
Edit your hosts file:
Code Block sudo nano /etc/apache2/sites-available/000-default.conf
- Change the listen port from 80 to 8008
- reboot the server