리눅스 아파치 2.2.X대 버전과 1.3.X대 버전에서 SSL 설치
페이지 정보
작성자
본문
요즘은 웹개발보다는 서버작업을 많이 하게 되버렷다..-_-;;
후임으로 들어온 아주 착한녀석이 워낙 열심히 해줘서 그런가..? 내가 할일이 줄엇다.
대신 그동안 미뤄왔던 서버 점검 레이스가 시작된건지 독특하게 요 몇주간 (아프고, 예비군 등등 실제 서버작업한건 일주일?) 서버만 4대를 작업하게 됬다..
신규서버 두대, 기존서버 셋팅변경 두대
다름아니라..SSL
특별히 SSL이 들어갈 필요가 없는데도 굳이 넣겟단다
머 보안을 튼튼히 해서 나쁜건 아니니까 적극 찬성이다.
SSL셋팅은 자주는 아니지만 그래도 몇번 해봣던거라 그리 어렵지 않을거라 생각하고 작업을 시작햇다.
기존에 설치햇던건 APACHE_1.x 버전이라 OPENSSL과 MOD_SSL을 둘다 설치해줘야하는 번거로움? 아무튼 그
런게 있었는데 APACHE_2_2 이상버전부터 MOD_SSL을 따로 설치해줄필요없고 아피차 설치시 옵션만 주면 되더라
#openssl 설치
[root@localhost src]# wet http://www.openssl.org/source/openssl-0.9.8e.tar.gz
[root@localhost src]# tar xvfz openssl-0.9.8e.tar.gz
[root@localhost src]# cd openssl-0.9.8e
[root@localhost openssl-0.9.8e]# ./configure --prefix=/usr/local/openssl
[root@localhost openssl-0.9.8e]# make
[root@localhost openssl-0.9.8e]# make install
설치확인은
[root@localhost openssl-0.9.8e]# openssl 하면
OpenSSL>
이런 명령창이 뜨면 된다
#아파치 설치
다운로드
[root@localhost src]# wget ftp://ftp.superuser.co.kr/apache/httpd-2.2.2.tar.gz
[root@localhost src]# tar xvfz httpd-2.2.2.tar.gz
[root@localhost src]# cd httpd-2.2.2
[root@localhost httpd-2.2.2]# ./configure \
--prefix=/usr/local/apache \
--enable-rule=SHARED_CORE \
--enable-module=so \
--enable-ssl \
--enable-module=rewrite \
--enable-so
[root@localhost httpd-2.2.2]# make
[root@localhost httpd-2.2.2]# make install
mod_ssl이 잘 설치 됫는지 확인해보려면
[root@localhost src]# /usr/local/apache/bin/httpd -l
Compiled in modules:
mod_ssl.c
요게 있어야 된다.
나머지 설정은 각자마다 조금씩 틀릴수 있으니까 적지 않는게^^;
아파치 1.3.x 버전은 mod_ssl을 설치 해줘야 한다
[root@localhost src]# wet http://www.openssl.org/source/openssl-0.9.6.tar.gz
[root@localhost src]# tar xvfz openssl-0.9.6.tar.gz
[root@localhost src]# cd openssl-0.9.6
[root@localhost openssl-0.9.6]# ./configure --prefix=/usr/local/openssl
[root@localhost openssl-0.9.6]# make
[root@localhost openssl-0.9.6]# make install
[root@localhost src]# ar -xzvf mod_ssl-2.8.1-1.3.19.tar.gz
[root@localhost src]# cd mod_ssl-2.8.1-1.3.19
[root@localhost mod_ssl-2.8.1-1.3.19 ]# ./configure --with-apache=/usr/local/src/apache_1.3.19
--with-ssl=../openssl-0.9.6
--prefix=/usr/local/apache
--enable-module=so
--enable-rule=SHARED_CORE
# mod_ssl-xxx_yyy (xxx 는 mod_ssl 버전, yyy 는 아파치 버전)
설치된 아파치 버전에 맞게 다운로드 받아서 설치하면 될거 같다
[root@localhost src]# tar -xzvf apache.1.3.19.tar.gz
[root@localhost src]# cd apache.1.3.19
[root@localhost apache.1.3.19]# SSL_BASE=openssl설치경로
[root@localhost apache.1.3.19]# ./configure --prefix=/usr/local/apache --enable-module=ssl
[root@localhost apache.1.3.19]# make
[root@localhost apache.1.3.19]# make install
각각 버전의 환경설정은 apache1.3.x버전은 httpd.conf에서 수정하면되고 apache2.0.x대버전은 ssl.conf apache2.2.x 버전은 extra/httpd-ssl.conf에서 수정할수 잇다
apache2.2.x버전은
[root@localhost conf]# vi httpd.conf
#Include conf/extra/httpd-ssl.conf의 주석을 삭제해주면된다
Include conf/extra/httpd-ssl.conf
[root@localhost conf]# vi extra/httpd-ssl.conf
Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLPassPhraseDialog builtin
SSLSessionCache shmcb:/usr/local/apache/logs/ssl_scache(512000)
SSLSessionCacheTimeout 300
SSLMutex file:/usr/local/apache/logs/ssl_mutex
<VirtualHost _default_:443>
DocumentRoot "적용될 소스 디렉토리"
ServerName "적용될 도메인 주소"
ErrorLog /usr/local/apache/logs/ssl_error_log
TransferLog /usr/local/apache/logs/ssl_access_log
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/apache/conf/ssl/ssl_gcdolmen_cert.pem
SSLCertificateKeyFile /usr/local/apache/conf/ssl/ssl_gcdolmen_key.pem
SSLCertificateChainFile /usr/local/ssl/caChain.pem
SSLCACertificateFile /usr/local/ssl/ca.pem
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
< /FilesMatch>
< Directory "/usr/local/apache/cgi-bin">
SSLOptions +StdEnvVars
< /Directory>
BrowserMatch ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /usr/local/apache/logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
</VirtualHost>
apache1.3.x버전은
[root@localhost conf]# vi httpd.conf
< IfDefine SSL>
LoadModule ssl_module libexec/libssl.so
< /IfDefine>
< IfDefine SSL>
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
< /IfDefine>
<IfModule mod_ssl.c>
SSLPassPhraseDialog builtin
SSLSessionCache dbm:/usr/local/apache/logs/ssl_scache
SSLSessionCacheTimeout 300
SSLMutex file:/usr/local/apache/logs/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
SSLLog /usr/local/apache/logs/ssl_engine_log
SSLLogLevel info
</IfModule>
<IfDefine SSL>
<VirtualHost 아이피또는 도메인:443>
DocumentRoot 설치디렉토리"
ServerName 설치도메인
ErrorLog /usr/local/apache/logs/error_log
TransferLog /usr/local/apache/logs/access_log
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /usr/local/apache/conf/ssl/harim/cert.pem
SSLCertificateKeyFile /usr/local/apache/conf/ssl/harim/key.pem
SSLCACertificateFile /usr/local/apache/conf/ssl/harim/intermediate.pem
< Files ~ "\.(cgi|shtml|phtml|php3?)$">
SSLOptions +StdEnvVars
< /Files>
< Directory "/usr/local/apache/cgi-bin">
SSLOptions +StdEnvVars
< /Directory>
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
CustomLog /usr/local/apache/logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
< /VirtualHost>
</IfDefine>
이렇게 설치하면 된다.
머 여기까지는 별문제 없이 ㅡㅡ;;;
근데 한참 삽질한뒤에 알게 된거지만 apache2.2.x버전은
[root@localhost bin]# ./apachectl startssl
Enter pass phrase:
이렇게 인증서 비밀번호를 치고 들어가면 스타트가 됐는데
apache2.2.x버전은 저 명령어가 안먹더라
[root@localhost /]# /usr/local/apache/bin/apachectl startssl
The startssl option is no longer supported.
Please edit httpd.conf to include the SSL configuration settings
and then use apachectl start.
한참 셋팅이 잘못된줄 알고 삽질햇는데..
[root@localhost /]# /usr/local/apache/bin/apachectl start
Enter pass phrase:
이걸로 끝이더군..ㅡㅡ;;
아 허무하고 무안해서 죽는줄 알았다
댓글목록
등록된 댓글이 없습니다.