Announcement

Collapse
No announcement yet.

How to Install varnish on cPanel/WHM

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Install varnish on cPanel/WHM

    Install varnish on cPanel


    This post helps you to install Varnish on cPanel server. Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configures it to cache the contents. Varnish Cache is really, really fast. It typically speeds up delivery with a factor of 300 – 1000x, depending on your architecture.

    How to install varnish cache on cPanel

    Step 1

    First, you need to update the Apache non-SSL IP/port to any port other than 80. Here I am using a custom port 8080. To change the Apache non-SSL IP/port to 8080, please go to WHM -> Tweak Settings -> Apache non-SSL IP/port. OR

    If you are working on a no-control panel server, edit the Apache configuration file (/etc/httpd/conf/httpd.conf) and search for below line.
    Code:
    Listen 80

    then change it to the following and restart Apache.
    Code:
    Listen 8080
    Step 2

    Once the Apache default port has been changed, we can go ahead and install several dependency packages using EPEL repository.
    Code:
    yum install epel-release
    yum install pygpgme yum-utils
    Step 3

    Add official Varnish Cache repository by creating a file named varnishcache_varnish41.repo
    Code:
    vim /etc/yum.repos.d/varnishcache_varnish41.repo
    Then add the following into it.


    For CentOS 7

    Code:
    [varnishcache_varnish41]
    name=varnishcache_varnish41
    baseurl=https://packagecloud.io/varnishcache/varnish41/el/7/$basearch
    repo_gpgcheck=1
    gpgcheck=0
    enabled=1
    gpgkey=https://packagecloud.io/varnishcache/varnish41/gpgkey
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt
    metadata_expire=300
    
    [varnishcache_varnish41-source]
    name=varnishcache_varnish41-source
    baseurl=https://packagecloud.io/varnishcache/varnish41/el/7/SRPMS
    repo_gpgcheck=1
    gpgcheck=0
    enabled=1
    gpgkey=https://packagecloud.io/varnishcache/varnish41/gpgkey
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt
    metadata_expire=300


    For CentOS 6

    Code:
    [varnishcache_varnish41]
    name=varnishcache_varnish41
    baseurl=https://packagecloud.io/varnishcache/varnish41/el/6/$basearch
    repo_gpgcheck=1
    gpgcheck=0
    enabled=1
    gpgkey=https://packagecloud.io/varnishcache/varnish41/gpgkey
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt
    metadata_expire=300
    
    [varnishcache_varnish41-source]
    name=varnishcache_varnish41-source
    baseurl=https://packagecloud.io/varnishcache/varnish41/el/6/SRPMS
    repo_gpgcheck=1
    gpgcheck=0
    enabled=1
    gpgkey=https://packagecloud.io/varnishcache/varnish41/gpgkey
    sslverify=1
    sslcacert=/etc/pki/tls/certs/ca-bundle.crt
    metadata_expire=300
    Last edited by DaMysterious; 10-23-2019, 07:13 PM.
Working...
X