Troubleshoot - by Hostrare
Varnish Cache is a web accelerator, sometimes attributed to as an HTTP accelerator or a reversed HTTP proxy, that will significantly enhance your web performance.
Varnish speeds up a website by saving a copy of the page served by the webserver the first time a user visits that page. The next time a user requests the same page, Varnish will serve the copy instead of requesting the page from the webserver.
This means that your web server requires to handle less traffic and your website’s administration and scalability go through the roof. Varnish Cache is often the single most critical piece of software in a web-based business.
First, you need to change the Apache listening port to a different port 82 or anything else.
vi /etc/httpd/conf/httpd.conf
or you can change via WHM -> Tweak Settings -> set value of field Apache non-SSL IP/port to 82.
You can install varnish over YUM or manually download varnish RPM.
yum install varnish
or
for EL6
wget https://repo.varnish-cache.org/redhat/varnish-3.0/el6/noarch/varnish-release/varnish-release-3.0-1.el6.noarch.rpm
rpm ivh varnish-release-3.0-1.el6.noarch.rpm
Once installation completed, Edit the configuration file and change the listening port to 80
vi /etc/sysconfig/varnish
VARNISH_LISTEN_PORT=80
Edit proxy settings in varnish
vi /etc/varnish/default.vcl or check with /usr/local/varnish/etc/varnish/vhost.vcl
backend default {.host = "184.82.165.4";.port = "82";}sub vcl_recv {if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") {return(lookup);}}# strip the cookie before the image is inserted into cache.sub vcl_fetch {if (req.url ~ "\.(png|gif|jpg|swf|css|js)$") {unset beresp.http.set-cookie;}}
Enable chkconfig and restart varnish service
chkconfig varnish on
service varnish start
Thats all… You can monitor varnish cache through this monitoring tool.
varnishstat
Varnish Cache Integration in cPanel
This opensource w3tools will switch previous varnish installation. Please backup your apache configuration file httpd.conf before proceed.
Installation:
# cd /usr/local/src# wget "https://raw.githubusercontent.com/itseasy21/w3tools-varnish/master/install.sh" -O /usr/local/src/varnish-install.sh# chmod +x varnish-install.sh# ./varnish-install.sh
our suuport team here for you 24/7
+8801977507015support@hostrare.comsend a leter Whether you are looking for a personal website hosting plan or a business website hosting plan, We are the perfect solution for you. Our powerful website hosting services will not only help you achieve your overall website goals, but will also provide you with the confidence you need in knowing that you are partnered with a reliable and secure website hosting platform.