Slide 1

Slide 1 text

@Amimoto_Ami amimoto-ami.com AMIMOTO (HHVM) + SSLʢLet's Encryptʣ

Slide 2

Slide 2 text

SSL ূ໌ॻͱ͸

Slide 3

Slide 3 text

ূ໌ॻͷ༗ޮظݶ اۀͷॴࡏ஍ ೝূہͷ৘ใ اۀ໊ SSL ূ໌ॻʹؚ·ΕΔ৘ใ

Slide 4

Slide 4 text

αΠτ͕SSL/TLS Λ࢖͍ͬͯΔ͔Λݟ෼͚Δʹ͸

Slide 5

Slide 5 text

SSL CERTIFICATE Λ࢖͏ϝϦοτ

Slide 6

Slide 6 text

HTTP/2 SEO ৴པੑ

Slide 7

Slide 7 text

SSL ূ໌ॻΛ ࢖Θͳ͍Ͱ͍Δ ͱ……

Slide 8

Slide 8 text

SSL ূ໌ॻͷ औಘɾઃఆํ๏

Slide 9

Slide 9 text

ෳ਺υϝΠϯͷূ໌ॻ υϝΠϯຖʹূ໌ॻ ༗ྉͷ SSL ূ໌ॻ

Slide 10

Slide 10 text

ແྉͰࣗಈͰΦʔϓϯͳ SSL ূ໌ॻ

Slide 11

Slide 11 text

Ϩοπ 
 Πϯετʔϧ
 Let’s Encrypt!

Slide 12

Slide 12 text

AWS ίϯιʔϧ΁ϩάΠϯ͠·͢

Slide 13

Slide 13 text

Route53 ͰυϝΠϯͷκʔϯΛઃఆ͠·͢

Slide 14

Slide 14 text

Route53 ͰυϝΠϯͷκʔϯΛઃఆ͠·͢

Slide 15

Slide 15 text

Route53 ͰυϝΠϯͷκʔϯΛઃఆ͠·͢

Slide 16

Slide 16 text

EC2 ͔Β AMIMOTO AMI Λϩʔϯν͠·͢

Slide 17

Slide 17 text

EC2 ͔Β AMIMOTO AMI Λϩʔϯν͠·͢

Slide 18

Slide 18 text

EC2 ͔Β AMIMOTO AMI Λϩʔϯν͠·͢

Slide 19

Slide 19 text

EC2 ͔Β AMIMOTO AMI Λϩʔϯν͠·͢

Slide 20

Slide 20 text

(HTTP/2) Next Generation Preview AMI Λϩʔϯν

Slide 21

Slide 21 text

ΠϯελϯεαΠζΛબ୒͠·͢

Slide 22

Slide 22 text

Πϯελϯεͷઃఆ͸σϑΥϧτͷ··ͰOKͰ͢

Slide 23

Slide 23 text

Πϯελϯεͷઃఆ͸σϑΥϧτͷ··ͰOKͰ͢

Slide 24

Slide 24 text

Πϯελϯεͷઃఆ͸σϑΥϧτͷ··ͰOKͰ͢

Slide 25

Slide 25 text

ηΩϡϦςΟάϧʔϓ΁ HTTPS(443) Λ௥Ճ͠·͢

Slide 26

Slide 26 text

EC2 ͔Β AMIMOTO AMI Λϩʔϯν͠·͢

Slide 27

Slide 27 text

SSH ΞΫηεʹඞཁͳΩʔϖΞΛ࡞੒͠·͢

Slide 28

Slide 28 text

HTTP/2 Next Generation Preview AMI ͕ىಈத

Slide 29

Slide 29 text

Elastic IP Λىಈͨ͠Πϯελϯε΁ׂΓ౰ͯ·͢

Slide 30

Slide 30 text

ׂΓ౰ͯΔΠϯελϯεID Λબ୒

Slide 31

Slide 31 text

Elastic IP ͷׂΓ౰ͯ׬ྃ

Slide 32

Slide 32 text

EC2ΠϯελϯεʹElastic IP ͕දࣔ͞Ε·ͨ͠ɻ

Slide 33

Slide 33 text

࡞੒ͨ͠Πϯελϯε΁SSH ͰΞΫηε͠·͢

Slide 34

Slide 34 text

WordPress ΛΠϯετʔϧ͠·͢ 1. SSH Ͱαʔό΁ΞΫηε:
 $ ssh -i ~/example.pem ec2-user@ΠϯελϯεͷIPΞυϨε
 ·ͨ͸
 $ ssh -i ~/example.pem [email protected]
 2. ύοέʔδΛ࠷৽൛΁ߋ৽:
 $ sudo yum update
 3. WordPress ͷΠϯετʔϧ: 
 $ sudo /usr/local/bin/wp-setup example.com

Slide 35

Slide 35 text

pip ͱ Let’s Encrypt ΛΠϯετʔϧ 4. Python ͷόʔδϣϯʹ߹͏ pip ͱvirtualenv ΛΠϯετʔϧ:
 
 $ sudo yum install python27-pip python27-virtualenv augeas-libs dialog gcc libffi-devel openssl-devel system-rpm-config
 5. Let’s Encrypt ΛΠϯετʔϧ:
 $ sudo virtualenv /opt/letsencrypt/
 $ sudo /opt/letsencrypt/bin/pip install letsencrypt
 6. ূ໌ॻΛ࡞੒:
 $ sudo /opt/letsencrypt/bin/letsencrypt certonly -t -d example.com - a webroot --webroot-path=/var/www/vhosts/example.com/ --rsa-key-size 2048 --server https://acme-v01.api.letsencrypt.org/directory
 7. ظݶ੾Εͷ͓஌Βͤ΍ϦΧόϦ༻ͷϝʔϧΞυϨεΛઃఆ

Slide 36

Slide 36 text

pip ͱ Let’s encrypt ͷΠϯετʔϧ 8. nginx ͷઃఆϑΝΠϧΛίϐʔͯ͠ SSL ޲͚ʹϦωʔϜ͠·͢:
 $ sudo cp /etc/nginx/conf.d/default-ssl.conf /etc/nginx/conf.d/ example.com-ssl.conf
 
 9. ίϐʔͨ͠ઃఆϑΝΠϧ example.com-ssl.conf Λฤू͠·͢:
 $ sudo vi /etc/nginx/conf.d/example.com-ssl.conf


Slide 37

Slide 37 text

มߋޙͷ example.com-ssl.conf server { listen 443 ssl http2; server_name example.com; root /var/www/vhosts/example.com; index index.html index.htm; charset utf-8; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers AESGCM:HIGH:!aNULL:!MD5; ssl_session_cache shared:SSL:10m; ssl_session_timeout 5m; ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; access_log /var/log/nginx/example.com.access.log main; error_log /var/log/nginx/example.com.error.log;

Slide 38

Slide 38 text

HTTP → HTTPS ΁ͷϦμΠϨΫτઃఆ 10.example.com.conf ʹ HTTPS ΁ͷϦμϨΫτઃఆΛ͠·͢: $ sudo vi /etc/nginx/conf.d/example.com.conf server { listen 80; server_name example.com; root /var/www/vhosts/example.com; return 301 https://$host$request_uri; index index.html index.htm; charset utf-8; access_log /var/log/nginx/example.com.access.log main; error_log /var/log/nginx/example.com.error.log;


Slide 39

Slide 39 text

pip ͱ Let’s encrypt ͷΠϯετʔϧ 11.มߋ಺༰Λ൓ө͢ΔͨΊ nginx Λ࠶ىಈ͠·͢:
 
 $ sudo service nginx restart

Slide 40

Slide 40 text

SETUP YOUR WORDPRESS

Slide 41

Slide 41 text

Πϯελϯε ID Λೖྗͯ͠ WordPress ͷઃఆΛ׬ྃͤ͞·͠ΐ͏

Slide 42

Slide 42 text

http://amimoto-ami.com/slack/ Questions:

Slide 43

Slide 43 text

@Amimoto_Ami amimoto-ami.com THANK YOU! AMIMOTO (HHVM) + SSLʢLet's Encryptʣ