Commit ad272fe18705cb141e51fe4913817183c68660f9

Authored by Antonio Terceiro
1 parent 247b1311

[varnish] only touch GET and HEAD requests

This fixes the recognition of the IP address from which comments were
made.

Besides, ammend varnish setup instructions to include the installation of
a required apache module to make sure IP address is correctly identified
when Apache is behind a proxy.

ActionItem2306
INSTALL.varnish
... ... @@ -15,6 +15,10 @@ Noosfero was tested with Varnish 2.x. If you are using a Debian Lenny (and you
15 15 should, unless Debian already released Squeeze by now), make sure you install
16 16 varnish from the lenny-backports suite.
17 17  
  18 +Install the RPAF apache module (or skip this step if not using apache):
  19 +
  20 + # apt-get install libapache2-mod-rpaf
  21 +
18 22 3) Enable varnish logging:
19 23  
20 24 3a) Edit /etc/default/varnishncsa and uncomment the line that contains:
... ...
etc/noosfero/varnish-noosfero.vcl
1 1 sub vcl_recv {
  2 + if (req.request == "GET" || req.request == "HEAD") {
2 3 if (req.http.Cookie) {
3   - # We only care about the "_noosfero_session.*" cookie, used for
4   - # authentication.
5   - if (req.http.Cookie ~ "_noosfero_session.*" ) {
6   - return (pass);
7   - }
8   - # Else strip all cookies
9   - unset req.http.Cookie;
  4 + # We only care about the "_noosfero_session.*" cookie, used for
  5 + # authentication.
  6 + if (req.http.Cookie ~ "_noosfero_session.*" ) {
  7 + return (pass);
  8 + }
  9 + # Else strip all cookies
  10 + unset req.http.Cookie;
10 11 }
  12 + }
11 13 }
12 14  
13 15 sub vcl_error {
... ...