varnish and apache like Facebook

pera

Verified User
Joined
Jul 29, 2004
Messages
97
Location
Sweden / Varberg
Varnish is a state-of-the-art, high-performance HTTP accelerator. It uses the advanced features in Linux 2.6, FreeBSD 6/7 and Solaris 10 to achieve its high performance.

Some of the features include

A modern design
VCL - a very flexible configuration language
Load balancing with health checking of backends
Partial support for ESI
URL rewriting
Graceful handling of "dead" backends
more features...
Varnish is free software and is licenced under a modified BSD licence.
..........................


I read this article:
http://royal.pingdom.com/2010/06/18/the-software-behind-facebook/
interesting article...

wondering what we can use on our servers?

varnish

interesting...
http://www.varnish-cache.org/

i went to the installation process..
Compiling Varnish from source
http://varnish-cache.org/docs/installation/install/
for svn use
svn co http://varnish-cache.org/svn/branches/2.1

had no problem compiling and installing varnish

varnish should work on port 80 and apache on port 8080

I changed the apache port in:
/etc/httpd/conf/httpd.conf

and one domain in
/usr/local/directadmin/data/users/site/httpd.conf

restarted httpd

and started varnish

but I am only able to see the apache default page, not the virtual host.

I do not have testing server.... so I'm not able to go on... and I'm not apache guru...

what I could read in
http://varnish-cache.org/wiki/FAQ

virtual hosts should not be problem...

hope someone can help with this?
 
Well, nice but looking over the Bug List, I wouldn't risk to run it on a Hosting ENV. There is mod_cache, mod_memcache, mod_deflate and in front of everything a powerfull webserver like NGINX.
Or you can spend some more dollars and get LiteSpeed WebServer and receive even more features.
 
You may try running Varnish on a different port (say, 81) and keep Apache on port 80, to avoid messing with DA's config. Then you forward all the traffic of port 80 to port 81. I'm using this for nginx.

Code:
iptables -t nat -A PREROUTING -p tcp -s ! __SERVER_IP__ --dport 80 -j REDIRECT --to-ports 81

Changing __SERVER_IP__ for your server's IP.
 
Back
Top