Install the Apache server and the required packages.
Enable Apache module named: Mod_ssl.
Enable Apache module named: Mod_rewrite.
Edit the Apache configuration file.
Add the following lines at the end of this file.
Create a private key and the website certificate using the OpenSSL command.
Enter the requested information.
On the option named COMMON_NAME, you need to enter the IP address or hostname.
In our example, we used the IP address 188.8.131.520.
Edit the Apache configuration file for the default website.
Here is the file, before our configuration.
Here is the file, after our configuration.
Optionally, you may want to redirect HTTP users to the HTTPS version of your website.
In this case, use the following configuration.
Restart the Apache service.
Open your browser and access the HTTPS version of your website.
In our example, the following URL was entered in the Browser:
The Apache server will display the HTTPS version of your website.
Congratulations! You have finished the configuration of HTTPS on the Apache server.