Strona 1 z 1

ssl

: 08 paź 2021, 12:30
autor: pi
Step 1: Create the SSL Certificate
TLS/SSL works by using a combination of a public certificate and a private key. The SSL key is kept secret on the server. It is used to encrypt content sent to clients. The SSL certificate is publicly shared with anyone requesting the content. It can be used to decrypt the content signed by the associated SSL key.

We can create a self-signed key and certificate pair with OpenSSL in a single command:

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/apache-selfsigned.key -out /etc/ssl/certs/apache-selfsigned.crt


/etc/apache2/site-enabled/site-conf - set paths for key and cert files

set https .htaccess file:
RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

or http:

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Re: ssl

: 11 sty 2023, 8:55
autor: jurek
certBot

Re: ssl

: 29 lis 2024, 21:20
autor: jurek
Aby dodać protokół ssl do nowej strony:

Kod: Zaznacz cały

sudo certbot --apache