- 윈도우 서비스
- BTP 배포
- JavaScript
- ionic3
- 구글맵 예제
- raspbian
- CAP Java
- HANA Cloud
- Windows Service
- blue-green
- SAP BTP
- BTP Deployment
- cloud foundry
- ChatGPT
- ionic
- cf push
- TypeScript
- sapui5
- Devian
- tomcat
- HANA DB
- Business Application Studio
- springboot
- Capire
- BTP
- angularJS
- raspberry pi
- ionic native
- sap
- eclipse plugin
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- Today
- Total
Ryan's Log
라즈베리파이 - #4 Apache2에 SSL 적용 본문
[라즈베리파이]
Apache2에 SSL 적용
얼마전 절친지인이 내게 뜬금없이 선물(이라 말했으나)로 준 Amazon Echo Dot.
Alexa 그녀가 Amazon Prime Music을 한달간 무료로 술술 틀어주곤 했는데...
그땐 참 좋았는데...
이제 어느덧 한달이 지나 더이상의 Prime Music Play를 기대할 수 없게되서 Alexa Skill로 내 MP3를 플레이 해보고자 마음 먹는다.
내게 뜬금없이 선물을 준 이유가 혹시...
Alexa Skill은 SSL이 적용된 HTTPS만을 허용한다. (당연 OpenSSL 불가)
그래서 내 라즈베리파이 Apache에 무료 SSL 인증서를 Let's Encrypt로 발급받아 적용하기로 한다.
적용할 Raspbian 버전은
> lsb_release -a No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 9.3 (stretch) Release: 9.3 Codename: stretch
> sudo apachectl -V Server version: Apache/2.4.25 (Raspbian) Server built: 2017-09-19T18:58:57
절차를 미리 정리 하면...
-. 신뢰할수 있는 무료 인증서 Let's Encrypt 설치
-. 인증서 발급(획득)
.- Apache에 적용
.- HTTPS로 접속
> sudo letsencrypt certonly --standalone -d myhome.iptime.org Saving debug log to /var/log/letsencrypt/letsencrypt.log Obtaining a new certificate Performing the following challenges: http-01 challenge for myhome.iptime.org Waiting for verification... Cleaning up challenges Generating key (2048 bits): /etc/letsencrypt/keys/0000_key-certbot.pem Creating CSR: /etc/letsencrypt/csr/0000_csr-certbot.pem IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at /etc/letsencrypt/live/myhome.iptime.org/fullchain.pem. Your cert will expire on 2018-06-08. 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
이후 default-ssl.conf를 열어 SSLCertificateFile과 SSLCertificateKeyFile을 Let's Encrypt에서 받은 인증서의 위치로 변경한다.
<IfModule mod_ssl.c> <VirtualHost _default_:443> ServerAdmin webmaster@localhost DocumentRoot /var/www/html JkMount /* ajp13_worker # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the loglevel for particular # modules, e.g. #LogLevel info ssl:warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined # For most configuration files from conf-available/, which are # enabled or disabled at a global level, it is possible to # include a line for only one particular virtual host. For example the # following line enables the CGI configuration for this host only # after it has been globally disabled with "a2disconf". #Include conf-available/serve-cgi-bin.conf # SSL Engine Switch: # Enable/Disable SSL for this virtual host. SSLEngine on # A self-signed (snakeoil) certificate can be created by installing # the ssl-cert package. See # /usr/share/doc/apache2/README.Debian.gz for more info. # If both key and certificate are stored in the same file, only the # SSLCertificateFile directive is needed. SSLCertificateFile /etc/letsencrypt/live/myhome.iptime.org/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/myhome.iptime.org/privkey.pem # Server Certificate Chain: # Point SSLCertificateChainFile at a file containing the # concatenation of PEM encoded CA certificates which form the # certificate chain for the server certificate. Alternatively # the referenced file can be the same as SSLCertificateFile # when the CA certificates are directly appended to the server # certificate for convinience. #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt
Let's Encrypt의 인증서는 90일의 유효기간이 있다.
주기적으로 해당 도메인 이름으로 서비스 하는지를 일정 기간마다 확인하겠다는 것이렸다.
인증서 갱신은 만료 30일 전부터 가능하다고 하니, 때가 되면 다음 명령으로 인증서를 갱신한다.
> sudo letsencrypt renew
> sudo letsencrypt renew Saving debug log to /var/log/letsencrypt/letsencrypt.log ------------------------------------------------------------------------------- Processing /etc/letsencrypt/renewal/myhome.iptime.org.conf ------------------------------------------------------------------------------- Cert not yet due for renewal The following certs are not due for renewal yet: /etc/letsencrypt/live/myhome.iptime.org/fullchain.pem (skipped) No renewals were attempted.
'Raspberry Pi' 카테고리의 다른 글
라즈베리파이 - #3 Apache2 + Tomcat8 설치 (MOD_JK) (1) | 2018.03.08 |
---|---|
라즈베리파이 - #1 Mac에서 Raspbian 설치 (0) | 2017.09.14 |