🔔 🔔 🔔 Duyuru: 24. Yılımıza özel indirimler sizleri bekliyor ! Kampanya Kodu : TDATA2024 | Detaylı bilgi için tıklayınız.

How to install Varnish Cache


How to install Varnish Cache


Varnish Cache is a web accelerator, sometimes referred to as a HTTP accelerator or a reverse HTTP proxy, that will significantly enhance your web performance.

Varnish speeds up a website by storing a copy of the page served by the web server 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 web server.

This means that your web server needs to handle less traffic and your website’s performance and scalability go through the roof. In fact Varnish Cache is often the single most critical piece of software in a web based business.

How to install varnish cache on cpanel

First, you need to change Apache listening port to another 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 through YUM or manually download varnish RPM.

yum install varnish

or

for EL6

wget http://repo.varnish-cache.org/redhat/varnish-3.0/el6/noarch/varnish-release-3.0-1.el6.noarch.rpm

rpm ivh varnish-release-3.0-1.el6.noarch.rpm

Once installation completed, Edit configuration file and change 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

Bu cevap yeterince yardımcı oldu mu?

Diğer Dökümanlar


  • What is cPanel and how to access it?

    CPanel is a fully featured web-based control panel that allows you to manage your domain through a web interface. cPanel gives you complete control over a vast amount of functions, streamlining...

  • CloudFlare Plugin install on cpanel

    CloudFlare is a performance and security service. With 14 points of presence around the world, a website on CloudFlare typically loads twice as fast, uses 65% less server resources, saves 60% of...

  • Enable Cronjob in cpanel and examples

    What is cron? It is the scheduling daemon of the Linux operating system Cron jobs allow you to automate repetitive tasks on the server that hosts your web site. This is a powerful tool that allows...

  • What is Anonymous FTP and how to enable it

    Anonymous FTP allows you and others that you give permission to, to access your “public_ftp” folder. There are two options available: 1. ftp://ftp.yourdomain.com –This allows...

  • Unable to connect cpanel using IP/whm and IP/cpanel

    If cpanel cannot be accessed using IP/whm and IP/cpanel, but can be accessed using IP:2086 and IP:2082, then here goes the solution for the same. The reason for this issue due to missing some...