What interested me from CWP is that the software comes with LAMP plus
Varnish, a powerful reputable frontend caching engine to boost your
website loading speed and reduce server’s CPU load. User can choose
either Disk-based or RAM-based caching mechanism. However if your server
/ VPS has a generous amount of RAM, you can allocate part of it for
Varnish to store its cache files. RAM-based caching is however faster than Disk, even an SSD.
During initial install, CWP will only install and enable full LAMP stack while Varnish need is not. Hence, you’ll need additional steps to get it installed, activated and configured properly. But do not worry so much because installing Varnish on CentOS Web Panel can be done in one click (unlike zPanel that you have to install it manually).
Are you ready? Here’s what you’ll need for:
Step 1 – Go to Apache Settings then Varnish Cache Server.

Step 2 – You’ll then see a message saying that Varnish is not installed (yet). Now click on the blue Install Varnish button.

In the next page, you can see all the install process like following:
Step 3 – It is time to setup few configuration so Varnish can run properly. By default, the configuration is set as following:
Varnish port is set to: 6081 in: /etc/sysconfig/varnish
Apache IP is set to 127.0.0.1 in Varnish config file: /etc/varnish/default.vcl
Apache port is set to 80 in Varnish config file: /etc/varnish/default.vcl
Normally as per my previous guide, if you installed it manually then you have to edit each of Varnish configuration including its .vcl files. Thanks to CWP, you can now configure it via a web-based user interface so you don’t even need to open Putty and do the task via command line interface.
Now scroll down that page a little bit and you will see a form where you can adjust its value.

Simply edit as recommended except the Varnish Storage Size because you need to adjust the value according the your server’s RAM. If your VPS has only 1GB of RAM, you can allocate 512MB max for Varnish. Of course you can make it less than 512MB. In my case I will allocate 256MB.

Once you clicked the Save Changes button, you’ll see several lines of message like below:

The first part means CWP has updated all Virtual Host entries adjusting its port to 82 (Apache). The next part just tells you that Apache has restarted and Varnish is running. That’s it.
Now you can use your other server to check its header using CURL command:

See? Enjoy the speed of Varnish without the complicated part.
During initial install, CWP will only install and enable full LAMP stack while Varnish need is not. Hence, you’ll need additional steps to get it installed, activated and configured properly. But do not worry so much because installing Varnish on CentOS Web Panel can be done in one click (unlike zPanel that you have to install it manually).
Are you ready? Here’s what you’ll need for:
- First, install CWP on your server following my previous guide.
- Do some basic configuration tasks.
- Login to CWP admin page as root or as user with root privilege via:
http://ip-address:2030
Step 1 – Go to Apache Settings then Varnish Cache Server.
Step 2 – You’ll then see a message saying that Varnish is not installed (yet). Now click on the blue Install Varnish button.
In the next page, you can see all the install process like following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
| Preparing... ################################################## varnish-release ################################################## Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: repos.mia.quadranet.com * extras: repos.mia.quadranet.com * rpmforge: mirror.teklinks.com * updates: repos.mia.quadranet.com Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package varnish.x86_64 0:3.0.6-1.el6 will be installed --> Processing Dependency: varnish-libs = 3.0.6-1.el6 for package: varnish-3.0.6-1.el6.x86_64 --> Processing Dependency: libvarnishapi.so.1(LIBVARNISHAPI_1.0)(64bit) for package: varnish-3.0.6-1.el6.x86_64 --> Processing Dependency: libvarnishapi.so.1()(64bit) for package: varnish-3.0.6-1.el6.x86_64 --> Running transaction check ---> Package varnish-libs.x86_64 0:3.0.6-1.el6 will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: varnish x86_64 3.0.6-1.el6 varnish-3.0 444 k Installing for dependencies: varnish-libs x86_64 3.0.6-1.el6 varnish-3.0 42 k Transaction Summary ================================================================================ Install 2 Package(s) Total download size: 485 k Installed size: 1.2 M Downloading Packages: -------------------------------------------------------------------------------- Total 215 kB /s | 485 kB 00:02 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : varnish-libs-3.0.6-1.el6.x86_64 1 /2 Installing : varnish-3.0.6-1.el6.x86_64 2 /2 Verifying : varnish-3.0.6-1.el6.x86_64 1 /2 Verifying : varnish-libs-3.0.6-1.el6.x86_64 2 /2 Installed: varnish.x86_64 0:3.0.6-1.el6 Dependency Installed: varnish-libs.x86_64 0:3.0.6-1.el6 Complete! |
Varnish port is set to: 6081 in: /etc/sysconfig/varnish
Apache IP is set to 127.0.0.1 in Varnish config file: /etc/varnish/default.vcl
Apache port is set to 80 in Varnish config file: /etc/varnish/default.vcl
Normally as per my previous guide, if you installed it manually then you have to edit each of Varnish configuration including its .vcl files. Thanks to CWP, you can now configure it via a web-based user interface so you don’t even need to open Putty and do the task via command line interface.
Now scroll down that page a little bit and you will see a form where you can adjust its value.
Simply edit as recommended except the Varnish Storage Size because you need to adjust the value according the your server’s RAM. If your VPS has only 1GB of RAM, you can allocate 512MB max for Varnish. Of course you can make it less than 512MB. In my case I will allocate 256MB.
Once you clicked the Save Changes button, you’ll see several lines of message like below:
The first part means CWP has updated all Virtual Host entries adjusting its port to 82 (Apache). The next part just tells you that Apache has restarted and Varnish is running. That’s it.
Now you can use your other server to check its header using CURL command:
See? Enjoy the speed of Varnish without the complicated part.
No comments:
Post a Comment