'서버/보안정보'에 해당되는 글 1건
- 2010.07.01 :: [아파치]SSL 설치하는 방법 2
(1) 아파치 키를 생성
[root@localhost httpd]# openssl sha1 * > rand.dat
[root@localhost httpd]# openssl genrsa -rand rand.dat -des3 2048 > [개인키명]
예전에는 키가 1024 이었는데, 최근에 2048 bit로 암호화 강도가 높아 졌다고 추천하네요.
(생성예)# openssl genrsa -rand rand.dat -des3 2048 > www.innocert.co.kr.key
Generating RSA private key, 2048 bit long modulus
...................++++++
......++++++
e is 65537 (0x10001)
Enter pass phrase: [패스워드입력]
Verifying - Enter pass phrase: [패스워드입력]
(2) CSR 생성 명령
[root@localhost httpd]# openssl req -new -key [개인키] -out [CSR파일명] # CSR 생성
(생성예)openssl req -new -key www.innocert.co.kr.key -out www.innocert.co.kr.csr
Enter pass phrase for www.innocert.co.kr.key: [패스워드입력]
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]: KR # 국가 코드 #
State or Province Name (full name) [Berkshire]: Seoul # 지역 #
Locality Name (eg, city) [Newbury]: Yeoksamdong # 지역 #
Organization Name (eg, company) [My Company Ltd]: KOINOS Co.,Ltd. # 업체명 #
Organizational Unit Name (eg, section) []: CERT TEAM # 부서 #
Common Name (eg, your name or your server's hostname) []: www.innocert.co.kr # 도메인 #
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: [Enter]
An optional company name []: [Enter]
위에 생성된 CSR을 가지고 신청하면 인증서가 발급됨.
(3) 발급된거 설치하기
[root@localhost httpd]# vi $APACHE_HOME/conf/httpd.conf
(참고) $APACHE_HOME 은 아파치가 설치된 경로를 뜻합니다.
httpd.conf에 아래 내용이 있는지 확인 합니다.
LoadModule ssl_module modules/mod_ssl.so
# VirtualHost 설정하기 #
# 아파치의 버전에 따라 conf.d/ssl.conf 혹은 extra/httpd-ssl.conf 로 파일명이 되어 있습니다.#
[root@localhost httpd]# vi $APACHE_HOME/conf.d/ssl.conf
‥‥‥‥‥‥‥(중략)‥‥‥‥‥‥‥
Listen 443 # SSL 포트확인 #
‥‥‥‥‥‥‥(중략)‥‥‥‥‥‥‥
DocumentRoot /var/www/html
ServerName www.innocert.co.kr
SSLEngine on
SSLCertificateFile /usr/local/apache/ssl/www.innocert.co.kr.crt # 발급 받은 인증서 #
SSLCertificateKeyFile /usr/local/apache/ssl/www.innocert.co.kr.key # 개인키 #
SSLCertificateChainFile /usr/local/apache/ssl/bundle.crt # 체인인증서 #
위에 3줄만 셋팅하면 별 문제 없네요.
셋팅 후 apachectl configtest 를 반드시 해서 config 에 문제 없는지 확인 후
리스타트 하면 끝~
[출처]이노서트-www.innocert.co.kr