HTTPS & SSL Certificate & Certbot
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.
Nginx Install
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.
LAMP Install
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.