Відмінності між версіями «Https»

Матеріал з Wiki Welard
Перейти до навігації Перейти до пошуку
 
(Не показані 3 проміжні версії цього користувача)
Рядок 2: Рядок 2:
 
[http://habrahabr.ru/post/250931/ Переходим на HTTPS на Nginx: шпаргалка]
 
[http://habrahabr.ru/post/250931/ Переходим на HTTPS на Nginx: шпаргалка]
  
−
'''cloudflare'''  
+
[https://b3n.org/intranet-ssl-certificates-using-lets-encrypt-dns-01/ '''Intranet SSL Certificates Using Let’s Encrypt | DNS-01 cloudflare''']
 
  yum install python-pip python-cffi python2-cryptography dnspython python-enum34 python2-future -y
 
  yum install python-pip python-cffi python2-cryptography dnspython python-enum34 python2-future -y
 
  yum install python-idna python-ipaddress python-ndg_httpsclient python-pyasn1 python-pycparser pyOpenSSL python-requests python-six python-wheel -y
 
  yum install python-idna python-ipaddress python-ndg_httpsclient python-pyasn1 python-pycparser pyOpenSSL python-requests python-six python-wheel -y
Рядок 9: Рядок 9:
 
Installing certbot [https://certbot.eff.org/#centosrhel7-nginx certbot]
 
Installing certbot [https://certbot.eff.org/#centosrhel7-nginx certbot]
 
  yum install certbot -y
 
  yum install certbot -y
−
 
  
 
[https://github.com/lukas2511/dehydrated dehydrated] - script which handle getting certificates '''copy dehydrated to /usr/local/bin'''
 
[https://github.com/lukas2511/dehydrated dehydrated] - script which handle getting certificates '''copy dehydrated to /usr/local/bin'''
Рядок 29: Рядок 28:
 
/etc/dehydrated/domains.txt
 
/etc/dehydrated/domains.txt
 
  example.com www.example.com delta.example.com
 
  example.com www.example.com delta.example.com
 +
 +
'''Installing'''
 +
/usr/local/bin/dehydrated -c
 +
 +
after that certifacates would be placed '''/etc/dehydrated/certs/'''example.com
 +
 +
make changes to nginx config files
 +
ssl_certificate        /etc/dehydrated/certs/example.com/fullchain-9999999999.pem;
 +
ssl_certificate_key    /etc/dehydrated/certs/example.com/privkey-9999999999.pem;
 +
  
 
Also possible to add these lines to start of /usr/local/bin/dehydrated
 
Also possible to add these lines to start of /usr/local/bin/dehydrated
 
  #sleep random 45s before start dehydrated  
 
  #sleep random 45s before start dehydrated  
 
  sleep $[($RANDOM%45)+1]s
 
  sleep $[($RANDOM%45)+1]s

Поточна версія на 08:19, 12 лютого 2017

https на сервер

Переходим на HTTPS на Nginx: шпаргалка

Intranet SSL Certificates Using Let’s Encrypt | DNS-01 cloudflare

yum install python-pip python-cffi python2-cryptography dnspython python-enum34 python2-future -y
yum install python-idna python-ipaddress python-ndg_httpsclient python-pyasn1 python-pycparser pyOpenSSL python-requests python-six python-wheel -y
pip install tld

Installing certbot certbot

yum install certbot -y

dehydrated - script which handle getting certificates copy dehydrated to /usr/local/bin

hook.py which used by dehydrated to contact cloudflare copy hook.py to /usr/local/bin

/etc/cron.d/dehydrated

0 5 * * * root /usr/local/bin/dehydrated -c &>/var/log/dehydrated.log

/etc/dehydrated/config

CHALLENGETYPE="dns-01"
CERTDIR="${BASEDIR}/certs"
ACCOUNTDIR="${BASEDIR}/accounts"
HOOK=/usr/local/bin/hook.py
[email protected]
export CF_EMAIL='[email protected]'
export CF_KEY='your_cloudflare_API_key'

/etc/dehydrated/domains.txt

example.com www.example.com delta.example.com

Installing

/usr/local/bin/dehydrated -c

after that certifacates would be placed /etc/dehydrated/certs/example.com

make changes to nginx config files

ssl_certificate         /etc/dehydrated/certs/example.com/fullchain-9999999999.pem;
ssl_certificate_key     /etc/dehydrated/certs/example.com/privkey-9999999999.pem;


Also possible to add these lines to start of /usr/local/bin/dehydrated

#sleep random 45s before start dehydrated 
sleep $[($RANDOM%45)+1]s