|
|
| | | |
| | | |
| t | | t | Restart Daemons |
| | | ======================= |
| | | |
| | | .. code-block:: bash |
| | | |
| | | sudo service apache2 restart |
| | | sudo service varnish restart |
| | | |
| | | |
|
|
| f | Implementing Varnish Cache | f | Implementing Varnish Cache |
| =================================== | | =================================== |
| t | | t | |
| | | |
| | | .. contents:: |
| | | |
| Install varnish | | Install varnish |
|
|
| | | |
| Install varnish | | Install varnish |
| n | | n | -------------------- |
| | | |
| .. code-block:: bash | | .. code-block:: bash |
| | | |
| | | |
| n | Make varnish listen to port 80 and disable varnish admin port | n | Make varnish listen to port 80 |
| | | ----------------------------------------------- |
| | | |
| | | Also disable the varnish admin port |
| | | |
| .. code-block:: bash | | .. code-block:: bash |
| | | |
| | | |
| n | Make Apache2 vhosts listen to port 8080: | n | Make Apache2 vhosts listen to port 8080 |
| | | ---------------------------------------------- |
| | | |
| .. code-block:: bash | | .. code-block:: bash |
| > Listen 80 | | > Listen 80 |
| | | |
| t | | t | |
| | | Now edit all the vhost files with two commands: |
| | | |
| | | .. code-block:: bash |
| | | |
| | | 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 c |
| | | hanging :80 to :8080 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
|
|
| Install varnish | | Install varnish |
| | | |
| n | .. code-block:: bash | n | .. code-block:: bash |
| | | |
| n | sudo apt-get install varnish | n | sudo apt-get install varnish |
| | | |
| | | |
| n | Make varnish listen to port 80 | n | Make varnish listen to port 80 and disable varnish admin port |
| | | |
| n | .. code-block:: bash | n | .. code-block:: bash |
| | | |
| n | sudo cp -p /etc/default/varnish /etc/default/varnish.ORIG | n | sudo cp -p /etc/default/varnish /etc/default/varnish.ORIG |
| sudo vim /etc/default/varnish | | sudo vim /etc/default/varnish |
| | | |
| diff /etc/default/varnish /etc/default/varnish.ORIG | | diff /etc/default/varnish /etc/default/varnish.ORIG |
| | | 40c40,41 |
| | | < DAEMON_OPTS="-a :80 \ |
| | | --- |
| | | > DAEMON_OPTS="-a :6081 \ |
| | | > -T localhost:6082 \ |
| | | |
| | | |
| | | Make Apache2 vhosts listen to port 8080: |
| | | |
| | | .. code-block:: bash |
| | | |
| | | 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 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| t | | t | |
| | | |
| | | |
|
|
| t | | t | Implementing Varnish Cache |
| | | =================================== |
| | | |
| | | Install varnish |
| | | |
| | | .. code-block:: bash |
| | | |
| | | sudo apt-get install varnish |
| | | |
| | | |
| | | Make varnish listen to port 80 |
| | | |
| | | .. code-block:: bash |
| | | |
| | | sudo cp -p /etc/default/varnish /etc/default/varnish.ORIG |
| | | sudo vim /etc/default/varnish |
| | | diff /etc/default/varnish /etc/default/varnish.ORIG |
| | | |
| | | |
| | | |
| | | |
| | | |