Let’s Encrypt
De MochilaWiki
Ir para navegaçãoIr para pesquisarpágina do projeto
baixando código
apt-get install git-core
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
gerando a chave
sudo ./letsencrypt-auto certonly -d seudominio.com.br -d www.seudominio.com.br --manual
depois acessa em http://seudominio.com.br/.well-known/acme-challenge/26bs4LFnqRp2eGXMaNeAkH19qLggg_gpeCi_aKG4RvsUQ
no nginx
listen 443 ssl;
ssl on;
ssl_certificate /etc/letsencrypt/live/seudominio.com.br/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/seudominio.com.br/privkey.pem;
no apache
<VirtualHost *:80>
ServerName www.seudominio.com.br
ServerAlias seudominio.com.br
DocumentRoot /var/www/seudominio.com.br
Redirect permanent / https://www.seudominio.com.br
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/seudominio.com.br
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/seudominio.com.br>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
SSLEngine on
SSLCertificateKeyFile /etc/letsencrypt/live/seudominio.com.br/privkey.pem
SSLCertificateFile /etc/letsencrypt/live/seudominio.com.br/cert.pem
SSLCertificateChainFile /etc/letsencrypt/live/seudominio.com.br/chain.pem
</VirtualHost>
</IfModule>
e habilitar o módulo
a2enmod ssl
service apache2 restart
- falta colocar como auto-renovar, pois expira em 90 dias
- http://blog.héry.com/article23/use-haproxy-with-let-s-encrypt
- http://stackoverflow.com/questions/21773817/crontab-run-a-cronjob-quarterly
- http://serverfault.com/questions/129633/how-to-run-cron-job-every-3-months
renovando chave
testando
./certbot-auto renew --dry-run --standalone --pre-hook "service nginx stop" --post-hook "service nginx start"
atualizando no bash, nginx
./certbot-auto renew --standalone --pre-hook "service nginx stop" --post-hook "service nginx start"
atualizando no bash, apache2
./certbot-auto renew --standalone --pre-hook "service apache2 stop" --post-hook "service apache2 start"
inserir no crontab -e
0 9 1 */2 * certbot renew --quiet --standalone --pre-hook "service nginx stop" --post-hook "service nginx start"
ou
echo "1 3 * * * root certbot renew --post-hook 'service postfix restart; service nginx restart; service dovecot restart'" > /etc/cron.d/certbot-renew
Problema com Debian Wheezy
ln -fs /usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata_nd.py /usr/lib/python2.7/
wget https://raw.githubusercontent.com/certbot/certbot/75499277be6699fd5a9b884837546391950a3ec9/certbot-auto
chmod +x ./certbot-auto
certbot-auto renew --no-self-upgrade
alterando um e-mail de contato
sudo certbot register --update-registration --email thenew@email.address
Referências
- https://tiagohillebrandt.eti.br/lets-encrypt-certificado-ssl-gratuito-para-seu-site.html
- http://admin.cefala.org/blog/usando-o-lets-encrypt.html
- https://skrilnetz.net/how-to-get-free-ssl-certificates-on-ubuntu/
- https://www.digitalocean.com/community/tutorials/how-to-set-up-let-s-encrypt-certificates-for-multiple-apache-virtual-hosts-on-ubuntu-14-04
- http://www.slsmk.com/enabling-https-access-to-owncloud/
- https://blog.smallbee.com.br/letsencrypt-certificado-https-gratuito-automatizado-e-aberto/