HTTPS & SSL Certificate & Certbot

HTTPS & SSL Certificate & Certbot
Original Certbot logo is licensed under CC-BY.

In this post we will see, how we can get an SSL certificate for our Apache or Nginx server with Certbot from Let’s Encrypt.

Prerequisites

  • An Ubuntu or Debian server (tested on Ubuntu 18.04 and Debian 10) that you have SSH access and root or sudo privileges.

    You can follow the SSH Server & UFW Configure guide to set up SSH best practices and configure a basic firewall.

Read more →

Nginx Install

Nginx Install
NGINX and the NGINX logo re trademarks of F5 Networks, Inc. in the U.S. and in certain other countries.

In this post we will see how we can install the Nginx web server in our Ubuntu server, and how to configure it to serve some files.

If you have already a web server installed, like Apache, you either have to uninstall it or change the default port that is listening because it will conflict with Nginx.

Install Nginx

We install nginx and any required dependencies:

sudo apt install nginx

Adjusting the Firewall

After you have followed the initial server setup and enabled the UFW firewall, make sure that your firewall allows HTTP and HTTPS traffic. You can check that UFW has an application profile for Nginx like so:

Read more →

LAMP Install

LAMP Install
The LAMP stack.

MySQL

Install MySQL

sudo apt install mysql-server

Run security script

Accept almost everything, and add secure root password:

sudo mysql_secure_installation

Change authentication method

If you don’t change the authentication method from auth_socket to mysql_native_password then anyone with a sudo user password can log in as root.

To check the authentication method, enter MySQL:

sudo mysql

And type:

SELECT user,authentication_string,plugin,host FROM mysql.user;

To configure the root account to authenticate with a password, run the following ALTER USER command. Be sure to change password to a strong password of your choosing, and note that this command will change the root password you set in the security script:

Read more →