์๋ฌํด๊ฒฐ๊ณผ์ ์ ์ค์ค๋ก ๊ธฐ์ตํ๊ธฐ์ํด ํฌ์คํ ํฉ๋๋ค.
AWS ์๋ฒํ๊ฒฝ : Ubuntu, Tomcat9, Nginx(ํฐ์บฃ์ฐ๋)
Tip: ํฐ๋ฏธ๋ ์ฐฝ 2๊ฐ ์ผ๋๊ณ ์คํํด์ผํจ.
โจ์ฒซ๋ฒ์งธ ํฐ๋ฏธ๋ (Ubuntu ์๋ฒ ์ ์ํ)
certbot ์๋ฌ 404
ubuntu@:~$ sudo certbot --nginx -d yunamom.duckdns.org
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for yunamom.duckdns.org
Waiting for verification...
Challenge failed for domain yunamom.duckdns.org
http-01 challenge for yunamom.duckdns.org
Cleaning up challenges
Some challenges have failed.
IMPORTANT NOTES:
- The following errors were reported by the server:
Domain: yunamom.duckdns.org
Type: unauthorized
Detail: Invalid response from
http://yunamom.duckdns.org/.well-known/acme-challenge/JySEiBtvqf8RRcKAbkpPaqAitHPHpY0J7H_ADer58P0
[13.209.236.220]: 404
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
๋ค์ ๋ช ๋ น์ด๋ฅผ ํตํด ์ค์ ์ ์์ํ๋ค.
sudo certbot certonly --manual --email [์ด๋ฉ์ผ] -d [๋๋ฉ์ธ]
ubuntu@:~$ sudo certbot certonly --manual --email hellokin10@gmail.com -d yunamom.duckdns.org
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator manual, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for yunamom.duckdns.org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NOTE: The IP of this machine will be publicly logged as having requested this
certificate. If you're running certbot in manual mode on a machine that is not
your server, please ensure you're okay with that.
Are you OK with your IP being logged?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Create a file containing just this data:
KPPagWtoBa8rNj8MzIGoRyXwIcEQv0kNcnvtq7blVkA.0Tc284K9HV1X9hq8oXsrv6Xy9c1aiwswFuGgGzK0F2o
And make it available on your web server at this URL:
http://yunamom.duckdns.org/.well-known/acme-challenge/KPPagWtoBa8rNj8MzIGoRyXwIcEQv0kNcnvtq7blVkA
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press Enter to Continue
์ฌ๊ธฐ์ ์ํฐ๋ฅผ ๋๋ฅด๋ฉด ์ง๊ธ ์์ฑ๊ฐ์ ๋ง๋ค์ด์ฃผ์ง์์์ผ๋ฏ๋ก ๋น์ฐํ 404์๋ฌ๊ฐ ๋์จ๋ค ๊ทธ๋ฆฌ๊ณ ๊ฐ์ด ๋ ๋ฆฌ์ ๋๋ฏ๋ก
์ด ํฐ๋ฏธ๋์ฐฝ์ ๊ทธ๋๋ก ๋๊ณ ๋๋ฒ์งธ ํฐ๋ฏธ๋์์ ์๋ฒ์ ์์ ํด์ค๋ค. (๋๋ฉ์ธ ์์ ๊ถํ์ธ์ ์ํ ์์ )
์์ ๋ด์ฉ์ .well-known/acme-challenge/[์์์์ฑ๊ฐ] ์ ํธ์ถํ ๋ ์๋์ ๊ฐ์ด ๋ฆฌํด๋์ด์ผ ํ๋ค
*์๋์ ๊ฐ์ ๊ฐ๊ฐ์ธ๋ง๋ค ๋ค๋ฆ ๋๋ค ๋ณธ์ธ์ ์์์์ฑ๊ฐ์ ํ์ธํด์ผํจ
KPPagWtoBa8rNj8MzIGoRyXwIcEQv0kNcnvtq7blVkA.0Tc284K9HV1X9hq8oXsrv6Xy9c1aiwswFuGgGzK0F2o
โจ๋๋ฒ์งธ ํฐ๋ฏธ๋ (Ubuntu ์๋ฒ ์ ์ํ)
ํฐ์บฃ ๋ฃจํธ์ ํด๋/ํ์ผ ์ ๋ง๋ค์ด์ค๋ค.
ubuntu@:/var/lib/tomcat9/webapps/ROOT$ sudo mkdir -p .well-known/acme-challenge
ubuntu@:/var/lib/tomcat9/webapps/ROOT$ ls
META-INF hi.html index.html index.jsp sudo
# ์จ๊ฒจ์งํด๋๋ผ ๋ชฉ๋ก์ ๋์ค์ง์๋๋ค ls -a ๋ช
๋ น์ด๋ก ํ์ธํ ์์๋ค.
ubuntu@:/var/lib/tomcat9/webapps/ROOT$ ls -a
. .. .well-known META-INF hi.html index.html index.jsp sudo
ubuntu@:/var/lib/tomcat9/webapps/ROOT$ cd .well-known/acme-challenge
ubuntu@:/var/lib/tomcat9/webapps/ROOT/.well-known/acme-challenge$ sudo vi KPPagWtoBa8rNj8MzIGoRyXwIcEQv0kNcnvtq7blVkA
ubuntu@:/var/lib/tomcat9/webapps/ROOT/.well-known/acme-challenge$
ํ์ผ ์์ ๋ค์์ ์ ๋ ฅ
*์๋์ ๊ฐ์ ๊ฐ๊ฐ์ธ๋ง๋ค ๋ค๋ฆ ๋๋ค ๋ณธ์ธ์ ์์์์ฑ๊ฐ์ ํ์ธํด์ผํจ
KPPagWtoBa8rNj8MzIGoRyXwIcEQv0kNcnvtq7blVkA.0Tc284K9HV1X9hq8oXsrv6Xy9c1aiwswFuGgGzK0F2o
์ ์ํด์ ์ถ๋ ฅํ์ธํ
http://yunamom.duckdns.org/.well-known/acme-challenge/KPPagWtoBa8rNj8MzIGoRyXwIcEQv0kNcnvtq7blVkA
โจ๊ทธ๋ค์ ์ฒซ๋ฒ์งธ ํฐ๋ฏธ๋ ํ๋ฉด์ผ๋ก ๋์๊ฐ์ ์ํฐ๋ฅผ ๋๋ฌ์ค๋ค.
Press Enter to Continue
Waiting for verification...
Cleaning up challenges
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/yunamom.duckdns.org/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/yunamom.duckdns.org/privkey.pem
Your cert will expire on 2022-07-18. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
ubuntu@:~$
๊ทธํ์ ์๋ ๋ช ๋ น์ด๋ก SSL ์ธ์ฆ์ ๋ฐ๊ธ ( http -> https )
ubuntu@:~$ sudo certbot --nginx -d yunamom.duckdns.org
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Cert not yet due for renewal
You have an existing certificate that has exactly the same domains or certificate name you requested and isn't close to expiry.
(ref: /etc/letsencrypt/renewal/yunamom.duckdns.org.conf)
What would you like to do?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Attempt to reinstall this existing certificate
2: Renew & replace the cert (limit ~5 per 7 days)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 1
Keeping the existing certificate
Deploying Certificate to VirtualHost /etc/nginx/sites-enabled/tomcat.conf
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 all traffic on port 80 to ssl in /etc/nginx/sites-enabled/tomcat.conf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://yunamom.duckdns.org
You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=yunamom.duckdns.org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/yunamom.duckdns.org/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/yunamom.duckdns.org/privkey.pem
Your cert will expire on 2022-07-18. To obtain a new or tweaked
version of this certificate in the future, simply run certbot again
with the "certonly" option. To non-interactively renew *all* of
your certificates, run "certbot renew"
- If you like Certbot, please consider supporting our work by:
Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le
ubuntu@:~$