How To Configure Varnish Cache with Apache Reverse Proxy and SSL Termination

Based on site: PlumRocket

In this guide, we will show you how to install and configure the Varnish cache for the Apache webserver with SSL termination. One limitation of Varnish Cache is that it is designed to accelerate HTTP, not the secure HTTPS protocol. Therefore, some workarounds must be performed to allow Varnish to work on SSL enabled website.

SSL/TLS Termination is the process of decrypting SSL-encrypted traffic. In our case, Apache acts like a proxy server and intermediary point between the client and Varnish and is used to convert HTTPS to HTTP.

apache_varnish

Step 1. Install and Configure Apache (Backend) on CentOS/RHEL 8

We had CentOS 8 installed on our web server, which uses dnf package manager. However, if you are familiar with Linux systems, you can apply this manual almost entirely to other OS, such as Centos 7 (use yum) or Ubuntu and Debian (use apt instead).

How to install Wiki.js on Ubuntu 22.04

This guide is a fully detailed guide to install everything necessary to run Wiki.js on a brand new Ubuntu 18.04 / 20.04 / 22.04 LTS machine.

What's Included

At the end of the guide, you'll have a fully working Wiki.js instance with the following components:

  • Docker
  • PostgreSQL 11 (dockerized)
  • Wiki.js 2.x (dockerized, accessible via port 80)
  • Wiki.js Update Companion (dockerized)
  • OpenSSH with UFW Firewall preconfigured for SSH, HTTP and HTTPS

Update Ubuntu

sudo apt -qqy update

sudo DEBIAN_FRONTEND=noninteractive apt-get -qqy -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' dist-upgrade

Install Docker

Raspberry PI Pico W motion and light sensor relay

At first I thought I would need to use a PI Pico to control a automatic light in my garage.  I started off by buying the following, but then I learned that just the RCWL-0516 Switch Module could do it all without the need for the PI Pico.

Radar Sensor RCWL-0516 Switch Module

Songhe RCWL-0516 RCWL0516 Microwave Radar Sensor Module,Human Body Induction Switch Module,Motion Induction Switch Sensor Module 5-7m 4-28V 5pcs

At CDS you can add a LDR (light-dependent resistor) to do motion detection during night only. For example, if you need to use this module for motion sensing light for outdoor, then LDR is a must. Without LDR light will glow in daytime also which is the waste of electricity.

(details here)

Amazon 8 pcs for $9.59

 RCWL-0516

 

Resistor 5516 GL5516 5mm 0.5 Mohm Photoresistor

Chanzon 20pcs LDR Resistor 5516 GL5516 5mm 0.5 Mohm Photoresistor Light-Dependent Photoconductor 20pcs Photo Light Sensitive

(details here)