보안서버 설치를 위해서는 몇가지 준비를 해야 한다.
설치 환경 : Apache 서버 2.x
설치전 준비사항 :
1. OpenSSL 설치 여부 확인 (www.openssl.org)
: rpm -qa | grep openssl
2. OpenSSL 의 Version 확인
: openssl version
3. OpenSSL 설치 (설치가 안되어 있을 경우)
: 압축풀기 : gzip -cd openssl-0.9.6.tar.gz | tar xvf -
: $./config$make$makeinstallconfig
☞ prefix를 주지 않았을 때에는 /usr/local/ssl디렉토리에 설치가 됩니다.
: 다른 디렉토리에 설치를 하고자 한다면 다음과 같이 설치합니다.
$./config--prefix=/usr/local--openssldir=/usr/local/openssl
☞ OpenSSL의 실행파일은 /usr/local/ssl/bin에 설치되고 인증서비스를 위한 파일들은/usr/local/openssl아래의 디렉토리에 생성됩니다.
4. Mod_ssl 설치 여부 확인 (www.modssl.org)
: httpd -l
☞ mod_ssl.c 또는 mod_ssl.so가 있는지 확인한다.
5. 만약 OpenSSL 과 Mod_ssl 이 없을 경우 설치한다.
: 참조 관공서에 제공해 주는 "보안서버 구축 가이드"를 참조할것
6. 관공서용 SSL은 openssl.cnf 를 수정하여야 한다.
[ req_distinguished_name ] countryName = Country Name (2 letter code) countryName_default = KR countryName_min = 2 countryName_max = 2 #stateOrProvinceName = State or Province Name (full name) #stateOrProvinceName_default = Some-State #localityName = Locality Name (eg, city) 0.organizationName = Organization Name (eg, company) 0.organizationName_default = Government of Korea # we can do this but it is not needed normally :-) #1.organizationName = Second Organization Name (eg, company) #1.organizationName_default = World Wide Web Pty Ltd organizationalUnitName = Organizational Unit Name (eg, section) organizationalUnitName_default = Group of Server commonName = Common Name (eg, YOUR name) commonName_max = 64 #emailAddress = Email Address #emailAddress_max = 64 |
GPKI에서 사용하는 Country, Organization, Orgainzation Unit, CommonName을 제외한 항목은 주석 처리 할것
7. 개인키 생성
: openssl genrsa -des3 -out Domain.key 2048
8. 생성된 개인키를 이용하여 CSR 생성
: openssl req -new -key Domain.key -out Domain_csr.pem
(예)
$ openssl -new -key key.pem -out csr.pem ~ ~ ~ Country Name (2 letter code) [KR]:⏎ Organization Name (eg, company) [Government of Korea]:⏎ Organizational Unit Name (eg, section) [Group of Server]:⏎ Common Name (eg, YOUR name) []:www.gpki.go.kr⏎ ~ ~ ~ A challenge password []:비밀번호⏎ An optional company name []:비밀번호⏎ |
8-1 개인키에서 패스워드 제거
: cp Domain.key Domain.key.org
openssl rsa -in Domain.key.org -out Domain.key
Enter pass phrase for Domain.key.org: <개인키 패스워드를 입력>
9. SSL 인증서 발급
: 행정전자서명 인증관리센터 홈페이지 (www.gpki.go.kr) 에서 발급하면 된다.
'Developement > Server' 카테고리의 다른 글
사이트이전시 자주 사용되는 명령어 모음 (0) | 2015.05.09 |
---|---|
Linux 설치 관련 (0) | 2015.03.25 |
CentOS 5.x 64비트 ModSecurity 설치 (0) | 2014.10.28 |
리눅스의 계정 목록을 확인 하기 (0) | 2014.10.25 |
vsFtp 설정 (0) | 2014.10.14 |