Category Archives: cPanel

Installing WHM and cPanel

1.) Login via SSH as root
2.) Run the following command: cd /home && curl -o latest -L https://securedownloads.cpanel.net/latest && sh latest
3.) The install will take an hour to 90 minutes to complete
4.) Once the install is complete, you will need to login to WHM to finish the installation process. Your control panel will be located athttps://<ipaddress>:2087 replacing <ipaddress> with the main IP address your services are located on.
5.) Follow the on screen instructions, you will be prompted for a variety of different features and functions, please be sure to read the help icons if you are unsure what each feature or requirement is.

You are now all set to begin using WHM/cPanel. We recommend configuring any packages you might have next!

How to install Varnish with CPanel and CentOS to cache static content on serve

There are few things you need to do to install Varnish with Cpanel (WHM):

  1. Let Apache listen on port 8080 – you can do it by editing httpd.conf or directly in WHM: Tweak Settings menu -> set value of field Apache non-SSL IP/portto 8080 and Save settings
  1. install Varnish on your server:

Execute commands:

#install varnish repository

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

#yum installation of Varnish

yum install varnish

  1. Edit configuration of Varnish /etc/sysconfig/varnish and change value of VARNISH_LISTEN_PORT to 80

VARNISH_LISTEN_PORT=80

  1. Edit Varnish Config: /etc/varnish/default.vcl

Use following content (don’t forget to set correct IP address):

backend default {

  .host = “50.28.31.120”;

  .port = “8080”;

}

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;

 }

}

  1. Now start Varnish service on your server:

chkconfig varnish on

service varnish start

  1. Now you are all set.

Now you can monitor your varnish cache e.g. with commandline tool: varnishstat

if you want to make changes to your varnish configuration, test your configuration changes before restarting varnish with following command:

varnishd -C -f /etc/varnish/default.vcl