openssl 사설인증서

1. 키파일 생성
openssl genrsa -des3 -out server.key 1024


2. csr파일 생성
openssl req -new -key server.key -out server.csr


Country Name (2 letter code) [AU]:KR

State or Province Name (full name) [Some-State]:시도

Locality Name (eg, city) []:구군
Organization Name (eg, company) [Internet Widgits Pty Ltd]:회사명

Organizational Unit Name (eg, section) []:조직명

Common Name (eg, YOUR name) []:인증서에적용할사이트명

Email Address []:담당이메일주소
A challenge password []:

An optional company name []:

A challenge password[]는 공백으로 넘어감


3. crt 파일생성
openssl x509 -req -days 9999 -in server.csr -signkey server.key -out server.crt

9999는 인증서 만료날짜


4. 서버에서 패스워드 제거. 제거하지 않으면 웹서버 시작시마다 비밀번호를 입력해 줘야 한다.

cp server.key server.tmp
openssl rsa -in server.tmp -out server.key


인증서 생성이 완료되었다.

아파치에 적용하자.


httpd-ssl.conf 편집.


Listen 443
NameVirtualHost 127.0.0.0:443





DocumentRoot /home/mysite
ServerName www.mysite.com
SSLEngine on
SSLCertificateFile server.crt
SSLCertificateKeyFile server.key


 






 

'Linux' 카테고리의 다른 글

CentOS7 apache 2.4 mod_deflate  (0) 2017.11.26
CentOS7 sshd 포트 변경하기  (0) 2017.10.29
iconv euckr to utf8 파일명  (0) 2016.12.06
텍스트파일 텍스트 치환  (0) 2016.12.06
리눅스 버전 확인 Linux version check  (0) 2016.12.05
블로그 이미지

엘로드넷

,