Let's Encrypt Automation - A Right Way in 2021

Install Certbot

Install snapd.

Remove old version of certbot:

sudo apt-get remove certbot
# or
sudo dnf remove certbot

Install certbot:

sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot

Run it!

sudo certbot --nginx

Caution!

In case you have an IP access blocking config in nginx, you need to disable it, temporarily at least.

For example, imagine you have this nginx block for IP access blocking:

1
2
3
4
5
6
server {

  listen 80 default_server;
  return 444;

}

Then disable it like so:

How to Install Vmware-Tools on Manjaro - an Awesome Distro of Arch Linux

One of the popular package managers for Arch Linux is “pacman”.

1
2
3
4
5
sudo pacman -Syu                # Update and upgrade system packages
sudo pacman -S package_name     # Install a new package
sudo pacman -R package_name     # Remove a package
sudo pacman -Rn package_name    # Remove along with backup-ed config files
sudo pacman -Rsu package_name   # Remove along with dependencies

If you do not have wget on your machine, you can install like so:

How to Install the Latest Version of Nginx on Ubuntu Bionic

Nginx.org maintains a repository for Ubuntu. We can use this repository to install the latest version of Nginx.

First off, let’s create a repository source file for Nginx with the following command.

1
vim /etc/apt/sources.list.d/nginx.list

Paste in the following two lines to the file:

deb [arch=amd64] http://nginx.org/packages/mainline/ubuntu/ bionic nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ bionic nginx

In order to verify the integrity of packages downloaded from this repository, we need to import Nginx public key using the commands below.

How to Build a CI/CD Pipeline on CircleCI

Once you got your account on CircleCI and setup your project linked to your git repository, you will have to have a directory named “.circleci” inside the root of your project repo.

Create a file named “config.yml” in there.

Grab the sample script given by CircleCI platform according to your project type.

  • The first step is to get the building workflow success.
  • The next step is to get the deployment workflow success.

Key point here is writing beautiful shell scripts and using proper orbs.

How to Configure a Nginx Reverse Proxy With Let's Encrypt

Let’s say one of your micro services is running on http://localhost:3000

If you already have a nginx service running on the server, create a server block like this:

1
vim /etc/nginx/sites-available/domain.com.conf

Grab this content to paste in:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
server {

  server_name domain.com;

  root /var/www/html;
  index index.html;

  location / {
    proxy_pass http://localhost:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
  }

}

For more advanced (more so production ready) configuration, use below instead: