• Exclusive

    Hey Guest, unlock an instant 10% bonus discount when you upgrade via the Crypoverse gateway.

HOW TO CREATE SSL CERTIFICATES AND ENABLE HTTPS ON LOCALHOST SITE (1 Viewer)

Currently reading:
 HOW TO CREATE SSL CERTIFICATES AND ENABLE HTTPS ON LOCALHOST SITE (1 Viewer)

Recently searched:

Legioniar

Member
LV
3
Joined
Nov 30, 2020
Threads
13
Likes
38
Awards
8
Credits
5,713©
Cash
5$
🔐 HOW TO CREATE SSL CERTIFICATES AND ENABLE HTTPS ON LOCALHOST SITE 🔐

1️⃣ For this, go to the corresponding path /etc/ssl :

cd /etc/ssl

Request root permissions :

sudo -i

2️⃣ Create a certificate :

openssl req -x509 -newkey rsa:2048 -keyout mylocalhost.key -out mylocalhost.pem -days 365 -nodes

It will ask you to enter details, you can either skip, or put random details. It's up to you.

3️⃣ Copy the files to the folders

cp mylocalhost.key private/
cp mylocalhost.pem certs/
a2enmod ssl

The key file goes to the private folder, while the pem file goes to certs folder.

4️⃣ Install nano and edit the config file :
sudo nano /etc/apache2/sites-available/default-ssl.conf

Search for "SSL ENGINE SWITCH", you can do that with CTRL+W (twice).

Now we edit :

SSLCertificateFile and SSLCertificateKeyFile

Replace the ssl-cert-snakeoil.pem with mylocalhost.pem and ssl-cert-snakeoil.key to mylocalhost.key.

Should look like this :

SSLCertificateFile /etc/ssl/certs/mylocalhost.pem
SSLCertificateKeyFile /etc/ssl/private/mylocalhost.key

To save, hit ctrl + s.

5️⃣ Enable the config

a2ensite default-ssl.conf

sudo service apache2 restart
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Tips
Recently searched:

Similar threads

Users who are viewing this thread

Top Bottom