CloudPanel:Part 5

Service – Varnish Cache

Service - Varnish Cache

Service Settings

By default, 512MB of data can be stored in the memory. You should consider increasing the value if you have many sites on the server or sites with many pages. To give Varnish Cache more memory, do the following:
  1. Login via SSH as root user.
  2. Open the systemd service file:
nano /lib/systemd/system/varnish.service
  1. Increase the malloc value from 512m e.g. to 2048m:
ExecStart=/usr/sbin/varnishd \
-a :6081 \
-a localhost:8444,PROXY \
-f /etc/varnish/default.vcl \
-P %t/%N/varnishd.pid \
-p feature=+http2 \
-p http_resp_hdr_len=40000 \
-s malloc,512m
  1. Reload systemd manager configuration:
systemctl daemon-reload
  1. Restart the Varnish Cache Service:
systemctl restart varnish

Configuration File

The Varnish Cache Configuration File can be found at:

/etc/varnish/default.vcl

After making changes, you need to reload the configuration.

  1. Login via SSH as root user.
  2. Run varnishreload to use the new compiled vlc configuration:

varnishreload

WordPress - Plugin

With the plugin CLP Varnish Cache Plugin for WordPress, you can manage the cache settings and perform purge operations.

Installation

Login into WordPress and click in the admin area in the left menu on Plugins –> Add New and search for CLP Varnish Cache.

Click on the button Install Now and then on Activate to finish the installation.

E-Mail

CloudPanel doesn’t provide E-Mail because of performance. We want to keep it clean and lightweight.

E-Mail is very complex and shouldn’t be handled by the server that runs your Applications.

There are many companies that offer professional E-Mail services for less than $ 1 / per user per month.

E-Mail Service Providers

Self Hosted Solutions

Mailcow

Mailcow is a free dockerized email solution. Follow the Guide to learn how to set up Mailcow on CloudPanel.

SSL/TLS Certificates

By default, a self-signed certificate is generated.

Let's Encrypt Certificate

To issue a free Let’s Encrypt certificate, click on the button Actions and select New Let’s Encrypt Certificate.

Add the Domain Names and click on Create and Install to issue a Let’s Encrypt Certificate.

DNS Records

Make sure to have a valid DNS record for the domains you want to create a certificate for.

Cloudflare Certificate

You don’t need to issue a Let’s Encrypt Certificate if you use Cloudflare.

Recommendation

For higher security, it’s recommended to enable Allow traffic from Cloudflare only for your site so that attackers cannot bypass the traffic.

To use the free certificates from Cloudflare, do the following:

  1. Enable the Proxy for your DNS Records.
  1. Click on SSL/TLS in the left menu and choose the Full mode.

Import Certificate

The majority of the websites are OK with the free Let’s Encrypt Certificates, but in some cases e.g.
for an Extended Validation Certificate, you need to buy and import the certificate.

  1. To import a certificate, click on the button Actions and select Import Certificate.
  1. Enter the Private Key, Certificate, and Certificate Chain and click on Import and Install.