티스토리 뷰
1. certbot 을 설치
$ sudo add-apt-repository ppa:certbot/certbot $ sudo apt-get update $ sudo apt-get install certbot |
2. 생성
$ certbot certonly --manual |
3. 이메일 입력
이메일입력후 도메인 입력까지 Y 입력
4. 인증서를 발급할 도메인 주소 입력
http, https 빼고 순수 도메인만 입력
5. Y 엔터
6. 위 화면이 나오면 a-string부분의 임의문자열을 복사후 파일생성
http://도메인/.well-known/acme-challenge/a-string임의 문자열을 웹서버에 경로 및 파일생성
\server root
----\.well-known
--------\acme-challenge
------------a-string 문자열 파일
----index.js
7. 웹서버에 a-string 생성하였으면 터미널창에서 이어서 엔터
8. 인증서 발급완료
/etc/letsencrypt/live/도메인
해당 경로로 들어가면 pem파일 생성되어있음
9. index.js 파일에 설정
// Dependencies
const fs = require('fs');
const http = require('http');
const https = require('https');
const express = require('express');
const app = express();
// Certificate
const privateKey = fs.readFileSync('/etc/letsencrypt/live/yourdomain.com/privkey.pem', 'utf8');
const certificate = fs.readFileSync('/etc/letsencrypt/live/yourdomain.com/cert.pem', 'utf8');
const ca = fs.readFileSync('/etc/letsencrypt/live/yourdomain.com/chain.pem', 'utf8');
const credentials = {
key: privateKey,
cert: certificate,
ca: ca
};
app.use((req, res) => {
res.send('Hello there !');
});
// Starting both http & https servers
const httpServer = http.createServer(app);
const httpsServer = https.createServer(credentials, app);
httpServer.listen(80, () => {
console.log('HTTP Server running on port 80');
});
httpsServer.listen(443, () => {
console.log('HTTPS Server running on port 443');
});
10. https로 접속확인
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 아이폰 카메라어플
- 로네펠트
- .NET Excel
- 나를 기억하고 있는 너에게
- 윈터드림
- 켄우드 정수기
- 삼성 외장하드
- Lily's Diary
- 릴리스 다이어리 - 설레어
- 보이스티
- 모토스톰2
- 아이튠즈 없이 mp3가져오기
- 안녕 바다
- 아이폰 보조배터리
- God of War III
- 닷넷 엑셀
- 보이스차
- Roibosh Vanilla
- KL-2200
- georgia max
- 릴리스다이어리
- 닷넷 파일형식
- Crows Zero
- IT·컴퓨터
- 러브트리프로젝트
- 아이팟 보조배터리
- GTO SHONAN 14DAYS
- hot 6
- 아이폰 셀카
- KL2200
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
글 보관함