-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL.varnish
75 lines (42 loc) · 2.2 KB
/
INSTALL.varnish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
= Setting up Varnish for your Noosfero site
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.
Varnish can be set up to use with Noosfero with the following steps:
1) setup Noosfero with apache according to the INSTALL file.
2) install Varnish
# apt-get install varnish
Noosfero was tested with Varnish 2.x. If you are using a Debian Lenny (and you
should, unless Debian already released Squeeze by now), make sure you install
varnish from the lenny-backports suite.
3) Enable varnish logging:
3a) Edit /etc/default/varnishncsa and uncomment the line that contains:
VARNISHNCSA_ENABLED=1
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.
3b) Restart Varnish Logging service
# invoke-rc.d varnishncsa start
4) Change Apache to listen on port 8080 instead of 80
4a) Edit /etc/apache2/ports.conf, and:
* change 'Listen 80' to 'Listen 127.0.0.1:8080'
* change 'NameVirtualHost *:80' to 'NameVirtualHost *:8080'
4b) Edit /etc/apache2/sites-enabled/*, and change '<VirtualHost *:80>' to '<VirtualHost *:8080>'
4c) Restart apache
# invoke-rc.d apache2 restart
5) Change Varnish to listen on port 80
5a) Edit /etc/default/varnish and change '-a :6081' to '-a :80'
5b) Restart Varnish
# invoke-rc.d varnish restart
6) Configure varnish to fit noosfero
(assuming Noosfero is installed in /var/lib/noosfero)
6a) Configure noosfero to do specific routines to varnish
Add the following line to your /etc/varnish/default.vcl file:
include "/var/lib/noosfero/etc/noosfero/varnish-noosfero.vcl";
6b) Configure varnish to store separate caches for each language
Add the following line to your /etc/varnish/default.vcl file:
include "/var/lib/noosfero/etc/noosfero/varnish-accept-language.vcl";
7) Restart Varnish
# invoke-rc.d varnish restart
Thanks to Cosimo Streppone for varnish-accept-language. See
http://github.com/cosimo/varnish-accept-language for more information.
-- Antonio Terceiro <[email protected]> Sat, 04 Sep 2010 17:29:27 -0300