Apache2 에 ssl 적용 삽질기…

 

Apache2 에 ssl 적용 삽질기…

1. openssl 설치
openssl-0.9.8g.tar.gz 다운

]# ./config
]# make
]# make install

2. 아파치 재컴파일

]# cd /usr/local/src/httpd-2.2.4
]# ./configure --prefix=/usr/local/apache2 --enable-module=ssl --with-ssl=/usr/local/ssl --enable-ssl --with-included-apr --enable-so

문제발생1
configure 하면서 아래와 같은 에러가 발생함.
configure: error: Cannot use an external APR-util with the bundled APR 에러발생

해결방법
./configure 할때 –with-included-apr 옵션 추가

문제발생2
컴파일 하면서 아래와 같이 에러 발생함.
libexpat.so: could not read symbols: File in wrong format 에러 발생

해결방법
libexpat.so 파일을 심볼릭 링크를 걸어준다.
ln -s /usr/lib64/libexpat.so.0.5.0 /usr/lib/libexpat.so

3. 인증서와 키 복사
인증기관에서 발급받은 개인키와 인증서 파일을 복사한다.
인증서 : test.crt
개인키 : test.key

4. http.conf 설정

Listen 443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl
SSLPassPhraseDialog  builtin
SSLSessionCache        shmcb:/usr/local/apache2/logs/ssl_scache(512000)
SSLSessionCacheTimeout  300
SSLMutex  file:/usr/local/apache2/logs/ssl_mutex
NameVirtualHost xxx.xxx.xxx.xxx:80
NameVirtualHost xxx.xxx.xxx.xxx:443
# service provider
<VirtualHost xxx.xxx.xxx.xxx:80>
    ServerAdmin webmaster@test.com
    DocumentRoot /user/test/
    ServerName test.test.com
    ServerAlias test.test.com
    CustomLog logs/test.test.com_log common
    SSLEngine off
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
</VirtualHost>
<VirtualHost xxx.xxx.xxx.xxx:443>
    ServerAdmin webmaster@test.com
    DocumentRoot /user/test/
    ServerName test.test.com
    ServerAlias test.test.com
    CustomLog logs/test.test.com_log common
    SSLEngine on
    SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
    SSLCertificateFile /usr/local/apache2/conf/test.crt
    SSLCertificateKeyFile /usr/local/apache2/conf/test.key
    BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
    CustomLog /usr/local/apache2/logs/ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    </Directory>
</VirtualHost>

5. apache 재시작

/usr/local/apache/bin/apachectl start

에러발생

httpd: apr_sockaddr_info_get() failed for FreeBSD_xix27.local
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

해결방법
ServerName 이 정상적으로 설정되이 않아서 발생하는 문제 인듯..
http.conf 파일에 ServerName 부분 설정
ServerName xxx.xxx.xxx.xxx

6. 방화벽 체크
그래도 https:// 프로토콜이 접근이 안되면, 방화병게 443 포트가 열려있는지 체크..

 

This entry was posted in WEB/WAS and tagged , , , , , . Bookmark the permalink.

댓글 남기기