Let’s Encrypt: mudanças entre as edições
De MochilaWiki
Ir para navegaçãoIr para pesquisar
Sem resumo de edição |
|||
| (8 revisões intermediárias pelo mesmo usuário não estão sendo mostradas) | |||
| Linha 27: | Linha 27: | ||
no apache | no apache | ||
<source lang="apache"> | <source lang="apache"> | ||
SSLCertificateKeyFile /etc/letsencrypt/live/seudominio.com.br/privkey.pem | <VirtualHost *:80> | ||
SSLCertificateFile /etc/letsencrypt/live/seudominio.com.br/cert.pem | ServerName www.seudominio.com.br | ||
SSLCertificateChainFile /etc/letsencrypt/live/seudominio.com.br/chain.pem | 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> | |||
</source> | |||
e habilitar o módulo | |||
<source lang="bash"> | |||
a2enmod ssl | |||
service apache2 restart | |||
</source> | </source> | ||
| Linha 37: | Linha 69: | ||
* http://serverfault.com/questions/129633/how-to-run-cron-job-every-3-months | * http://serverfault.com/questions/129633/how-to-run-cron-job-every-3-months | ||
== renovando chave == | |||
testando | |||
<source lang="bash"> | |||
./certbot-auto renew --dry-run --standalone --pre-hook "service nginx stop" --post-hook "service nginx start" | |||
</source> | |||
atualizando no bash, nginx | |||
<source lang="bash"> | |||
./certbot-auto renew --standalone --pre-hook "service nginx stop" --post-hook "service nginx start" | |||
</source> | |||
atualizando no bash, apache2 | |||
<source lang="bash"> | |||
./certbot-auto renew --standalone --pre-hook "service apache2 stop" --post-hook "service apache2 start" | |||
</source> | |||
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 == | |||
<source lang="bash"> | |||
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 | |||
</source> | |||
== alterando um e-mail de contato == | |||
<source lang="bash"> | |||
sudo certbot register --update-registration --email thenew@email.address | |||
</source> | |||
== Referências == | == Referências == | ||
| Linha 44: | Linha 114: | ||
* https://www.digitalocean.com/community/tutorials/how-to-set-up-let-s-encrypt-certificates-for-multiple-apache-virtual-hosts-on-ubuntu-14-04 | * 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/ | * http://www.slsmk.com/enabling-https-access-to-owncloud/ | ||
* https://blog.smallbee.com.br/letsencrypt-certificado-https-gratuito-automatizado-e-aberto/ | |||
Edição atual tal como às 11h06min de 22 de novembro de 2020
pá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/