Question

I am attempting to set up my first Varnish Cache server and I have a couple questions for any person(s) experienced.

1.) I am running Varnish as a stand alone server. Do I need Apache also installed on the same server. Ultimately the actual site that will be behind Varnish is not on this server.

2.) Do I point the domain to Varnish and then set the config to point to the ip address of the server that is hosting the site? If so, how do you point it to the right site?

3.) If Varnish is standalone and I have an Apache content server, can they both be port 80 and just change the ip address in the default.vcl

backend default { .host = "198.221.134.235"; .port = "80"; }

Sorry for the basic questions. I have been on Google all weekend and I found plenty of information on how to install and config Varnish but it seems like the site you want to Cache is on the same server since all of them are changing the port Apache listens to and that seems like it would mean the site is living on the same server.

And if you have any good sites with information, please feel free to share them! Thanks again!

Was it helpful?

Solution

  1. No, Varnish and Apache (or any other HTTP/webserver) can run on a separate server.
  2. Indeed, point the domain to the IP of Varnish and setup a backend as described in the documentation: https://www.varnish-cache.org/docs/3.0/tutorial/backend_servers.html. The IP of your webserver will be the IP of the backend.
  3. Correct, as long as Apache and Varnish are on separate servers they both can listen on port 80

If I am not mistaken you will have the following setup:

DNS example.com => 1.1.1.1 IP 1.1.1.1:80: Varnish (backend: 1.1.1.2:80) IP 1.1.1.2:80: Apache

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top