Re: Frontend caching to multiple sites

2008-11-05 Thread Alecs Henry
Hi Espen,

Thanks for the answer!

Is there a way to accomplish this using different VCLs?
I ask it because I'm trying to figure out a way to make it automatic. As in
if I have a new customer, I'd just fill out a form (with the customer
details like domain name, backend server, other configuration) and a little
system working under the hood would generate the VCL file, send it to the
varnish server and load it.

If I use one VCL file for everybody, how do I reload this VCL when I need to
change it? Is it necessary to reload varnish? Would it present downtime?

Thanks!!

Alecs



On Wed, Nov 5, 2008 at 5:58 AM, Espen Braastad [EMAIL PROTECTED] wrote:

 Alecs Henry wrote:

 I want to set up varnish as a reverse proxy/cache to multiple customer
 sites.
 As in, I have 10 different customers, each with its own web site (domains)
 with their own necessities, compression, cookie, authentication, etc; each
 customer is a different setup from the other, so I thought OK! Let's use
 a
 different VCL for each customer and all will be fine.

 Bear with me here, I've just started playing with varnish, but it seems
 that
 I can't create a different VCL file for each customer and load it in
 varnish
 (vcl.use ...) as varnish will stop responding for the previous site and
 start responding only to the new one (active configuration). Meaning, the
 content that is served is only the content from the new site, even if
 using
 the correct domain.

 How can I go about setting this up?
 I'm using Varnish 2.0.1, just downloaded and compiled it today.


 Hi,

 You can try something like this in one VCL:

 sub vcl_recv {
  if (req.http.host ~ ^(www\.)site1\.com$){
   # foo
  }

  if (req.http.host ~ ^(www\.)site2\.com$){
   # bar
  }

  if (req.http.host ~ ^(www\.)site3\.com$){
   # baz
  }

  # Unknown host
  error 403;
 }

 --
 mvh
 Espen Braastad,
 +47 21 54 41 37
 [EMAIL PROTECTED]
 Linpro AS - Ledende på Linux



___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Frontend caching to multiple sites

2008-11-05 Thread rafailowski
Hi,
For change vcl on the fly, just do:
# varnishadm -T 127.0.0.1:33222 vcl.load vcl_name 
/path/to/your/vcl/varnish.vcl
also look at :
vcl.load configname filename
vcl.inline configname quoted_VCLstring
vcl.use configname
vcl.discard configname
vcl.list
vcl.show configname

or if you want : telnet 127.0.0.1 33222
For the downtime, i don't know exactly but it's very quick.


Alecs Henry wrote:
 Hi Espen,
 
 Thanks for the answer!
 
 Is there a way to accomplish this using different VCLs?
 I ask it because I'm trying to figure out a way to make it automatic. As 
 in if I have a new customer, I'd just fill out a form (with the customer 
 details like domain name, backend server, other configuration) and a 
 little system working under the hood would generate the VCL file, send 
 it to the varnish server and load it.
 
 If I use one VCL file for everybody, how do I reload this VCL when I 
 need to change it? Is it necessary to reload varnish? Would it present 
 downtime?
 
 Thanks!!
 
 Alecs
 
 
 
 On Wed, Nov 5, 2008 at 5:58 AM, Espen Braastad [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:
 
 Alecs Henry wrote:
 
 I want to set up varnish as a reverse proxy/cache to multiple
 customer
 sites.
 As in, I have 10 different customers, each with its own web site
 (domains)
 with their own necessities, compression, cookie, authentication,
 etc; each
 customer is a different setup from the other, so I thought OK!
 Let's use a
 different VCL for each customer and all will be fine.
 
 Bear with me here, I've just started playing with varnish, but
 it seems that
 I can't create a different VCL file for each customer and load
 it in varnish
 (vcl.use ...) as varnish will stop responding for the previous
 site and
 start responding only to the new one (active configuration).
 Meaning, the
 content that is served is only the content from the new site,
 even if using
 the correct domain.
 
 How can I go about setting this up?
 I'm using Varnish 2.0.1, just downloaded and compiled it today.
  
 
 Hi,
 
 You can try something like this in one VCL:
 
 sub vcl_recv {
  if (req.http.host ~ ^(www\.)site1\.com$){
   # foo
  }
 
  if (req.http.host ~ ^(www\.)site2\.com$){
   # bar
  }
 
  if (req.http.host ~ ^(www\.)site3\.com$){
   # baz
  }
 
  # Unknown host
  error 403;
 }
 
 -- 
 mvh
 Espen Braastad,
 +47 21 54 41 37
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 Linpro AS - Ledende på Linux
 
 
 
 
 
 
 ___
 varnish-misc mailing list
 varnish-misc@projects.linpro.no
 http://projects.linpro.no/mailman/listinfo/varnish-misc

___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc


Re: Frontend caching to multiple sites

2008-11-04 Thread Espen Braastad
Alecs Henry wrote:
 I want to set up varnish as a reverse proxy/cache to multiple customer
 sites.
 As in, I have 10 different customers, each with its own web site (domains)
 with their own necessities, compression, cookie, authentication, etc; each
 customer is a different setup from the other, so I thought OK! Let's use a
 different VCL for each customer and all will be fine.

 Bear with me here, I've just started playing with varnish, but it seems that
 I can't create a different VCL file for each customer and load it in varnish
 (vcl.use ...) as varnish will stop responding for the previous site and
 start responding only to the new one (active configuration). Meaning, the
 content that is served is only the content from the new site, even if using
 the correct domain.

 How can I go about setting this up?
 I'm using Varnish 2.0.1, just downloaded and compiled it today.
   
Hi,

You can try something like this in one VCL:

sub vcl_recv {
  if (req.http.host ~ ^(www\.)site1\.com$){
# foo
  }

  if (req.http.host ~ ^(www\.)site2\.com$){
# bar
  }

  if (req.http.host ~ ^(www\.)site3\.com$){
# baz
  }

  # Unknown host
  error 403;
}

-- 
mvh
Espen Braastad,
+47 21 54 41 37
[EMAIL PROTECTED]
Linpro AS - Ledende på Linux


___
varnish-misc mailing list
varnish-misc@projects.linpro.no
http://projects.linpro.no/mailman/listinfo/varnish-misc