Blame view

INSTALL.varnish.md 2.09 KB
af25d9e0   Aurélio A. Heckert   correct markdown ...
1
2
Setting up Varnish for your Noosfero site
=========================================
52e9c1ac   Antonio Terceiro   Documenting Varni...
3

af25d9e0   Aurélio A. Heckert   correct markdown ...
4
Varnish is a HTTP caching server, and using it together with Noosfero is highly recommended. See http://www.varnish-cache.org/ for more information on Varnish.
52e9c1ac   Antonio Terceiro   Documenting Varni...
5
6
7

Varnish can be set up to use with Noosfero with the following steps:

af25d9e0   Aurélio A. Heckert   correct markdown ...
8
1) setup Noosfero with apache according to the `INSTALL.md` file. If you used the Debian package to install noosfero, you don't need to do anything about this.
52e9c1ac   Antonio Terceiro   Documenting Varni...
9
10
11

2) install Varnish

af25d9e0   Aurélio A. Heckert   correct markdown ...
12
    # apt-get install varnish
52e9c1ac   Antonio Terceiro   Documenting Varni...
13

ad272fe1   Antonio Terceiro   [varnish] only to...
14
15
Install the RPAF apache module (or skip this step if not using apache):

af25d9e0   Aurélio A. Heckert   correct markdown ...
16
    # apt-get install libapache2-mod-rpaf
ad272fe1   Antonio Terceiro   [varnish] only to...
17

af25d9e0   Aurélio A. Heckert   correct markdown ...
18
3) Change Apache to listen on port `8080` instead of `80`
52e9c1ac   Antonio Terceiro   Documenting Varni...
19

af25d9e0   Aurélio A. Heckert   correct markdown ...
20
3a) Edit `/etc/apache2/ports.conf`, and:
52e9c1ac   Antonio Terceiro   Documenting Varni...
21

af25d9e0   Aurélio A. Heckert   correct markdown ...
22
  * change `Listen 80` to `Listen 127.0.0.1:8080`
52e9c1ac   Antonio Terceiro   Documenting Varni...
23

af25d9e0   Aurélio A. Heckert   correct markdown ...
24
3b) Edit `/etc/apache2/sites-enabled/*`, and change `<VirtualHost *:80>` to `<VirtualHost *:8080>`
52e9c1ac   Antonio Terceiro   Documenting Varni...
25

2e231b5e   Daniela Feitosa   Updated varnish d...
26
4) Varnish configuration
52e9c1ac   Antonio Terceiro   Documenting Varni...
27

af25d9e0   Aurélio A. Heckert   correct markdown ...
28
4a) Edit `/etc/default/varnish`
584d5a3f   Antonio Terceiro   Minor doc review
29

af25d9e0   Aurélio A. Heckert   correct markdown ...
30
31
   * change the line that says `START=no` to say `START=yes`
   * change `-a :6081` to `-a :80`
89227c17   Larissa Reis   Updates varnish c...
32
   * add parameter `-p vcc_allow_inline_c=on` on `DAEMON_OPTS`
52e9c1ac   Antonio Terceiro   Documenting Varni...
33

af25d9e0   Aurélio A. Heckert   correct markdown ...
34
4b) Edit `/etc/varnish/default.vcl` and add the following lines at the end:
ce6d678a   Aurelio A. Heckert   Create a noosfero...
35

af25d9e0   Aurélio A. Heckert   correct markdown ...
36
37
    include "/etc/noosfero/varnish-noosfero.vcl";
    include "/etc/noosfero/varnish-accept-language.vcl";
ce6d678a   Aurelio A. Heckert   Create a noosfero...
38

af25d9e0   Aurélio A. Heckert   correct markdown ...
39
On manual installations, change `/etc/noosfero/*` to `{Rails.root}/etc/noosfero/*`
ce6d678a   Aurelio A. Heckert   Create a noosfero...
40

af25d9e0   Aurélio A. Heckert   correct markdown ...
41
**NOTE**: it is very important that the `*.vcl` files are included in that order, i.e. *first* include `varnish-noosfero.vcl`, and *after* `noosfero-accept-language.cvl`.
785006ab   Antonio Terceiro   Document caveat w...
42

df85f779   Antonio Terceiro   Review varnish co...
43
5) Enable varnish logging:
52e9c1ac   Antonio Terceiro   Documenting Varni...
44

af25d9e0   Aurélio A. Heckert   correct markdown ...
45
5a) Edit `/etc/default/varnishncsa` and uncomment the line that contains:
52e9c1ac   Antonio Terceiro   Documenting Varni...
46

af25d9e0   Aurélio A. Heckert   correct markdown ...
47
    VARNISHNCSA_ENABLED=1
2e231b5e   Daniela Feitosa   Updated varnish d...
48

af25d9e0   Aurélio A. Heckert   correct markdown ...
49
The varnish log will be written to `/var/log/varnish/varnishncsa.log` in an apache-compatible format. You should change your statistics generation software (e.g. awstats) to use that instead of apache logs.
2e231b5e   Daniela Feitosa   Updated varnish d...
50

06d664a6   Joenio Costa   Documenting setup...
51
Thanks to Cosimo Streppone for varnish-accept-language. See http://github.com/cosimo/varnish-accept-language for more information.
2e231b5e   Daniela Feitosa   Updated varnish d...
52

06d664a6   Joenio Costa   Documenting setup...
53
6) Restart services
52e9c1ac   Antonio Terceiro   Documenting Varni...
54

06d664a6   Joenio Costa   Documenting setup...
55
56
57
    # service apache2 restart
    # service varnish restart
    # service varnishncsa restart