Posted by bibstha1 on April 23, 2010 at 6:22am
The concept on including reverse proxy seems very interesting. However it allows one to use it only one application at a time.
Has anyone used this setup to multiple websites using virtualhosts?
The concept on including reverse proxy seems very interesting. However it allows one to use it only one application at a time.
Has anyone used this setup to multiple websites using virtualhosts?
Comments
Well other than supposedly
Well other than supposedly all the varnish caches flushing when you flush cache on one of the sites but that shouldn't cause too much trouble for just a few sites... or at least Ive not noticed any trouble myself. Perhaps that "may" be fixed now & thats why ive not noticed anything.
I installed Mercury in Linode
I installed Mercury in Linode and I tried to configure a few virtualhosts but I just couldn't, I had all kind of problems with apache. It would be good if anyone publish a guide or a link on how to do it.
Luis
You can setup several sites
You can setup several sites on one server by using port based virtual hosts with apache and multiple backends with varnish. Let's say you have two sites and you use this syntax in your apache config:
<VirtualHost aaa.bbb.ccc.ddd:9001>
--- config of site A goes here ---
</VirtualHost>
<VirtualHost aaa.bbb.ccc.ddd:9002>
--- config of site A goes here ---
</VirtualHost>
Don't forget to add these lines to you apache config, usually done in ports.conf:
Listen 9001Listen 9002
Check if everything's up and running by requesting your websites A and B over their ports in your browser.
After this you have to add something like this to the beginning of your varnish config file, where aaa.bbb.ccc.ddd refers to the site's ip address used in the apache vhost configuration:
backend siteA {
.host = "aaa.bbb.ccc.ddd";
.port = "9001";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}
backend siteB {
.host = "aaa.bbb.ccc.ddd";
.port = "9002";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}
And put this in first place of "sub vcl_recv {" in your varnish config:
if (req.http.host ~ "^domainA.tld$") {set req.backend = siteA;
} else if (req.http.host ~ "^domainB.tld$") {
set req.backend = siteB;
}
Replace domainA and domainB with the domain names of your sites A and B.
I have drupal multisite up
I have drupal multisite up without any problems. Didn't have to the ports in the vhost config or anything.