๐Ÿ“DevOps

[AWS] https ์ธ์ฆ ๋งŒ๋ฃŒ์‹œ ํ•ด๊ฒฐ๋ฐฉ๋ฒ•

yujch 2023. 1. 17. 20:17
๋ฐ˜์‘ํ˜•

"์—ฐ๊ฒฐ์ด ๋น„๊ณต๊ฐœ๋กœ ์„ค์ •๋˜์–ด ์žˆ์ง€ ์•Š์Šต๋‹ˆ๋‹ค"

=> https ์ธ์ฆ ๋งŒ๋ฃŒ๋˜์„œ ์ƒ๊ธด ๋ฌธ์ œ

 

1, SSL ์ธ์ฆ์„œ ๋ฐœ๊ธ‰๋ฐ›๊ธฐ

# lets encrypt ์„ค์น˜

sudo apt update -y & sudo apt install lets encrypt -y

 

# nginx ์ค‘์ง€

sudo systemctl stop nginx

 

# ์ธ์ฆ์„œ ๋ฐœ๊ธ‰

sudo certbot certonly --standalone -d {๋ฐœ๊ธ‰๋ฐ›์„ ๋„๋ฉ”์ธ}

 

- ๋ฐœ๊ธ‰๋ฐ›์œผ๋ฉด ์•„๋ž˜์— .pem ํŒŒ์ผ 2๊ฐœ์˜ ์œ„์น˜๋ฅผ ์•Œ๋ ค์คŒ

 

# nginx ์„ค์ •ํŒŒ์ผ ์ˆ˜์ •

/etc/nginx/sites-available์˜ default ๋ฅผ ์ˆ˜์ •

์œ„์—์„œ ์•Œ๋ ค์ค€ ํŒŒ์ผ 2๊ฐœ๋ฅผ ๋ถ™์—ฌ๋„ฃ๊ธฐ

ssl_certificate โ€œ{fullchain.pemd์˜ ์œ„์น˜};

ssl_certificate_key โ€œ{privkey.pem์˜ ์œ„์น˜}โ€;

 

# nginx ์žฌ์‹œ์ž‘

sudo service nginx restart

 

 


 

2. SSL ์ธ์ฆ์„œ ๊ฐฑ์‹ 

- ๋ฐœ๊ธ‰๋ฐ›์€์  ์žˆ๋Š” ๊ฒฝ์šฐ ์‚ฌ์šฉ

 

# nginx ๋„๊ธฐ

systemctl stop nginx

 

# cerbot ๊ฐฑ์‹  ์‹คํ–‰

๊ฐฑ์‹  ํ…Œ์ŠคํŠธ

certbot renew โ€”dry-run

 

์‹ค์ œ ๊ฐฑ์‹ 

certbot renew

 

# ์ธ์ฆ์„œ ๋งŒ๋ฃŒ์ผ ํ™•์ธ

certbot certificates

 

# nginx ์žฌ์‹œ์ž‘

sudo service nginx restart

 


 

>>์œ„ ๋ฐฉ๋ฒ•์œผ๋กœ  nginx๊ฐ€ ์žฌ์‹œ์ž‘๋˜์ง€ ์•Š๊ณ  ์—๋Ÿฌ๋‚œ ๊ฒฝ์šฐ

"Job for nginx.service failed because the control process exited with error code."

- ํ•ด๊ฒฐ๋ฐฉ๋ฒ•

https://soda-dev.tistory.com/91

 

[AWS] Job for nginx.service failed because the control process exited with error code. ์—๋Ÿฌ

"Job for nginx.service failed because the control process exited with error code." # nignx ์ƒํƒœ ํ™•์ธ systemctl status nginx.service "Failed to start A high performance web server and a reverse proxy server." - ํฌํŠธ ๋ฒˆํ˜ธ๊ฐ€ ์ถฉ๋Œ๋‚œ ๊ฒƒ >>apache๊ฐ€

soda-dev.tistory.com

 

๋ฐ˜์‘ํ˜•