Unix/Solaris10

Apache https 설정

ForceCore 2008. 6. 4. 00:15

우선 SSL인증서를 만들어야 한다.

가장 쉬운방법은

http://slacksite.com/apache/certificate.php

여기 적혀 있다.

 

PDF파일로도 dump되어있으니 어렵지 않음.

 

Solaris 10의 apache2 패키지의 경우,

SSL 서버를 켜기 위해서는

# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
#       starting without SSL on platforms with no /dev/random equivalent
#       but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

 

Include conf/extra/httpd-ssl.conf의 코멘트를 해제하기만 하면 된다.

그리고 httpd-ssl.conf를 수정해서 만든 certificate을 지정해준다.

 

근데 문제가 있다.

certificate에 password를 걸면 apache가 시작할 때 마다 비번을 입력해야 하는 문제가 있다.

그게 싫으면 password 없이 certificate를 만들고 root만이 읽을 수 있도록 certificate를 만들면 됨.

 

or

http://free4u.dnip.net/weblog/?mid=blog&category=528&document_srl=787

역시 root만이 읽고 실행할 수 있는 스크립트를 만들면 된다.

 

apachectl startssl로 아파치 시작시 패스어구 자동입력은

#!/bin/sh
echo password(실제 패스워드)

를 스크립트로 만들어두고
아파치 설정파일에서
<IfModule mod_ssl.c>

# Pass Phrase Dialog:
# Configure the pass phrase gathering process.
# The filtering dialog program (`builtin' is a internal
# terminal dialog) has to provide the pass phrase on stdout.
#SSLPassPhraseDialog builtin
SSLPassPhraseDialog exec:/path/to/script
위처럼 경로를 설정해주면 mod_ssl시작시 자동으로
패스어구를 입력시킬수있습니다.