Apache 2 SSL > 서버관리 Tip

본문 바로가기
 

Apache 2 SSL

페이지 정보

작성자 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 댓글 0건 조회 19,220회 작성일 10-08-18 23:19

본문

Apache 2 SSL

apache 2의 SSL 지원은 단일 IP에 대해서만 지원이 된다. 즉, Named virtual host 방식의 다중 도메인 구성이 가능하고, IP 주소기반의 SSL 가상도메인은 지원이 안된다.
 

HTTPS Configuration#

 
The mod_ssl module adds an important feature to the Apache2 server - the ability to encrypt communications. Thus, when your browser is communicating using SSL, the https:// prefix is used at the beginning of the Uniform Resource Locator (URL) in the browser navigation bar. The mod_ssl module is available in apache2-common package. If you have installed this package, you can run the following command from a terminal prompt to enable the mod_ssl module:
  1. sudo a2enmod ssl
    

 

사전 준비#
/etc/apache2/prots.conf 에 443 확인#

Listen 80
Listen 443 https

<VirtualHost IP:443> 은 항상 단일 IP#

- Make sure you do not have more than one SSL certificate sharing the same IP. Please ensure that all SSL certificates utilise their own dedicated IP.

- If using Apache2 check your vhost config. Some users have reported changing <VirtualHost> to _default_ resolved the error.

 

 

 

 

암호화 키 생성#
공 개키 암호화 방식에서 키를 인증해주는 CA(Certificate Authority)를 이용하거나 사설 인증을 발급한다. 이 방식은 서버측에서 비밀키를 보유하고 공개키를 제시해 클라이언트들이 이 공개키와 자신의 공개키를 인크립션시켜 서버와 통신하게 된다. 그래서 비밀키를 생성해서 보관해야 한다.
 

 

TLS에서 사용하게 되는 ssl 인증서를 생성한다.#
* 웹 서버 등에서 사용하는 해당 도메인의 ssl 인증서가 존재하면 해당 인증서 파일을 사용하면 된다.
 
  1. openssl req -new -outform PEM -out mydomain.crt -newkey rsa:2048 -nodes -keyout mydomain.key -keyform PEM -days 730 -x509
[..]
Common name? 에 해당 서버의 Full Qulified Domain name을 입력한다.
 
 
퍼미션 조정#

chmod 640 mydomain.key

chgrp ssl-cert mydomain.key

 

Generating a Certificate Signing Request (CSR)#

 

des3를 이용한 키를 생성한다.#
  1. $openssl genrsa -des3 -out mydomain.key 1024
    
  2. Generating RSA private key, 1024 bit long modulus
    ...++++++ ..................................++++++ unable to write 'random state'

    e is 65537 (0x10001)

    Enter pass phrase for mydomain.key:

pass phrase는 4~8자 이상을 입력한다

 

  1. $ ls -l bukwang.key
    -rw-r--r-- 1 gtko gtko 963 2009-02-13 15:49 mydomain.key

 

CSR을 생성한다.#
  1. openssl req -new -key bukwang.key -out bukwang.csr
    
CSR을 생성하기 위해 몇몇 정보를 입력하고 나면 CSR파일을 만들게 된다.
  1. $ls -l bukwang.*
    -rw-r--r-- 1 gtko gtko 680 2009-02-13 15:57 mydomain.csr
    -rw-r--r-- 1 gtko gtko 963 2009-02-13 15:49 mydomain.key

참고로, passphrase 없이 서비스를 돌릴수 도 있는데 -des3 스위치를 제외하고 사용하낟. 혹은 아래와 같은 명령을 사용한다:

  1. openssl rsa -in mydomain.key -out mydomain.key.insecure
    
Creating a Self-Signed Certificate#
앞서 작성한 CSR을 CA에 제출하고 정식 certificate를 받거나 아래와 같이 자신의 certificate를 작성한다.
  1. openssl x509 -req -days 730 -in mydomain.csr -signkey mydomain.key -out mydomain.crt
    
  • 2년 기간의 인증서

Installing the Certificate#
You can install the key file server.key and certificate file server.crt, or the certificate file issued by your CA, by running following commands at a terminal prompt:
  1. sudo cp mydomain.crt /etc/ssl/certs
    sudo cp mydomain.key /etc/ssl/private

Apache2 설정에 추가#

기본 사이트 설정 /etc/apache2/sites-available/default 이나 virtual host에 더해준다. DocumentRoot 아래 위치한다.
  1. SSLEngine on
    SSLOptions +StrictRequire
    SSLCertificateFile /etc/ssl/certs/bukwang.crt
    SSLCertificateKeyFile /etc/ssl/private/bukwang.key
참고#
우분투 8.04 / httpd 설정#

https://help.ubuntu.com/8.04/serverguide/C/httpd.html

우분투 8.04 / Certificate#

https://help.ubuntu.com/8.04/serverguide/C/certificates-and-security.html

댓글목록

등록된 댓글이 없습니다.

Total 159건 6 페이지
서버관리 Tip 목록
번호 제목 글쓴이 조회 날짜
69 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 16380 08-19
68 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15876 08-18
67 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15252 08-18
열람중 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 19221 08-18
65 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 9913 07-21
64 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15792 07-16
63 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15997 06-30
62 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 8751 06-30
61 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15944 06-30
60 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13920 06-30
59 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14159 06-30
58 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 13945 06-30
57 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14332 02-08
56 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 16256 10-11
55 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 12472 08-16
54 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 17070 08-12
53 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 15341 08-12
52 no_profile 차동박 쪽지보내기 메일보내기 홈페이지 자기소개 아이디로 검색 전체게시물 14451 08-04
게시물 검색