Let's Encrypt ssl-sertifikaatin asennus Apache web-palvelimeen – Ubuntu 16.04

Let’s Encrypt ssl-sertifikaatti

Let’s Encrypt on ilmainen, automaattinen ja avoin sertifikaatti varmentaja. Let’s Encrypt ssl-sertifikaatti on voimassa 90 päivää.

SSL-sertifikaatin asennus

Sinulla pitää olla asennettuna toimiva Apache palvelin. Tarvitset myös oman verkkotunnuksen nimipalvelun A-tietue osoittaa palvelimen IP-osoitteeseen.
Tässä ohjeessa käytämme verkkotunnusta domain.fi.
Asennetaan CertBotti.

sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-apache

Asennetaan Let’s Encrypt ssl sertifikaatti.

sudo certbot --apache -d domain.fi
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): user@domain.fi
-------------------------------------------------------------------------------
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v01.api.letsencrypt.org/directory
-------------------------------------------------------------------------------
(A)gree/(C)ancel: A
-------------------------------------------------------------------------------
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about EFF and
our work to encrypt the web, protect its users and defend digital rights.
-------------------------------------------------------------------------------
(Y)es/(N)o: N
Obtaining a new certificate
Performing the following challenges:
tls-sni-01 challenge for linuxhostsupport.com
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/domain.fi-le-ssl.conf
Deploying Certificate fortslan.fi to VirtualHost /etc/apache2/sites-available/domain.fi-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/domain.fi-le-ssl.conf

Uudelleenohjataan kaikki liikenne http > https.

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
-------------------------------------------------------------------------------
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Redirecting vhost in /etc/apache2/sites-enabled/domain.fi.conf to ssl vhost in /etc/apache2/sites-available/domain.fi-le-ssl.conf
-------------------------------------------------------------------------------
Congratulations! You have successfully enabled https://www.domain.fi

Sertifikaatti on mahdollista uusia automaattisesti käyttäen ajastettua tehtävää (Cron Job).

crontab -e

Lisää croniin seuraava rivi.

0 0 1 * * /usr/bin/letsencrypt renew >> /var/log/letsencrypt.log

Sulje ja tallenna muuttamasi tiedosto ja uudelleenkäynnistä cron seuraavalla komennolla.

service cron restart

Nyt sivustollasi on toimiva ja automaattisesti päivittyvä ssl sertifikaatti.





Vastaa

Sähköpostiosoitettasi ei julkaista. Pakolliset kentät on merkitty *