Varnish is one of the most used cache optimizer for improving server speed and reduce proccesses load.
Notice that Varnish can be installed in a cPanel Server or CentOS server as well.
For installing Varnish, please login SSH to your server.
First, you need get the rpm package for varnish. If you are running under CentOS 6 you will find
the link below:
https://repo.varnish-cache.org/redhat/varnish-4.0.el6.rpm
For install it in you server you need issue:
root@server[~] rpm --nosignature -i https://repo.varnish-cache.org/redhat/varnish-4.0.el6.rpm
Once we have added rpm package we can start varnish installation.
root@server[~] yum install varnish
While installing is probably that you get the same error message:
Error: Package: varnish-4.0.1-1.el6.x86_64 (varnish-4.0)
Requires: jemalloc
You could try using --skip-broken to work around the problem
Do not panic! This happens becasue varnish4 depends on 'jemalloc' being installed.
The problem is that this package seems not listed in RHEL's repository and we need install it before
continue into varnish installation.
So, let's take it from EPEL:
x86
https://dl.fedoraproject.org/pub/epel/6/x86_64/jemalloc-3.6.0-1.el6.i686.rpm
x64
rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
For install it, execute
root@server[~] cd /usr/local/src
root@server[~] wget https://dl.fedoraproject.org/pub/epel/6/x86_64/jemalloc-3.6.0-1.el6.i686.rpm
root@server[~] rpm -ivh jemalloc-3.6.0-1.el6.i686.rpm
Now we are ready for resuming varnish installation.
root@server[~] yum install varnish
Just let installation get completed. You can tweak varnish from now.
Enable it for starting automatically when system boots
chkconfig --add varnish
Start varnish service and enjoy!
service varnish start