0

I am using plone.recipe.varnish 1.2.2 in my Plone application.

Below is a section of my buildout:

parts =
    ...
    instance
    paster
    varnish-build
    varnish
    plonesite  

...
[varnish-build]
recipe = zc.recipe.cmmi
url = http://downloads.sourceforge.net/project/varnish/varnish/2.1.3/varnish-2.1.3.tar.gz


[varnish]
recipe = plone.recipe.varnish
daemon = ${buildout:parts-directory}/varnish-build/sbin/varnishd
bind = 127.0.0.1:8000
backends = 127.0.0.1:9000
cache-size = 1G

I cannot conclusively determine if it works. My Plone application serves on port 9000. So I want to test if varnish really works by going to http://localhost:8000 but I get nothing. The browser says "Firefox can't establish a connection to the server at 127.0.0.1:8000."

Am I doing this wrong? I have followed the instructions provided here but no headway.

How does one really configure plone.recipe.varnish in Plone, and how do you actually test that it works in local development machine?

Frankline
  • 40,277
  • 8
  • 44
  • 75
  • "It is not working" is a very vague statement indeed. Do you get an error message from Varnish? Does `http://localhost:8000/Plone` get you anything? – Martijn Pieters Nov 26 '12 at 12:35
  • I do not get anything from the browser. `http://localhost:8000/Plone` gives the following: `"Firefox can't establish a connection to the server at 127.0.0.1:8000."` Is there some setting that I also need to tweak on the plone site-setup as well? – Frankline Nov 26 '12 at 13:05
  • Then varnish isn't running at all or bound to a different port or interface. Nothing is listening on port 8000 on the localhost interface. How do you start varnish? What log files are produced? – Martijn Pieters Nov 26 '12 at 13:07
  • I've just confirmed it and it is true that varnish was not running. I have started it manually from plone/bin/varnish and now I can access content from port 8000. I am not sure how to start it. I thought that by merely adding it to the buildout as specified [here](http://pypi.python.org/pypi/plone.recipe.varnish) it will be started automatically. Seems like this is not the case for me. – Frankline Nov 26 '12 at 13:18
  • No, the recipe builds and configures varnish, it doesn't start it. The Plone instance recipe doesn't start the plone server for you either, does it? :-) Use `supervisord` or something else to start and stop your daemons. – Martijn Pieters Nov 26 '12 at 13:19
  • Thanks again. Atleast I know where to look at now. If you don't mind, you may provide an answer to my question so that I can mark it as an accepted answer. – Frankline Nov 26 '12 at 13:24

1 Answers1

2

The recipe does not start your varnish server. It only configures it for you.

Use something like supervisord to manage the process, or start it by hand with bin/varnish.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343