티스토리 뷰

Web Service/Tomcat

tomcat에서 https 설정

광식'S Story 2009. 1. 8. 15:08

보안을 위해 https로 통신해야 할 필요가 있는 경우 tomcat에서 다음과 같이 설정한다.

1. key 생성

     Windows 인 경우
      %JAVA_HOME%bin/keytool -genkey -alias tomcat -keyalg RSA            
     Unix 인 경우
      $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA

    이때 패스워드를 물어보는데 "changeit"이라고 입력한다.
    다른 패스트워드를 입력할 경우 tomcat startup시 다음과 같은 오류가 발생한다.
   
    Keystore was tampered with, or password was incorrect


   그 다음은 알아서 입력하고 국가코드에는 "82"를 입력한다.

2. tomcat server.xml 파일 변경
   $TOMCAT_HOME/conf/server.xml 파일에서 다음 내용에서 주석을 제거한다.
    <!-- Define a SSL HTTP/1.1 Connector on port 8443 -->
    <Connector port="8443" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" disableUploadTimeout="true"
               acceptCount="100" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />

    <!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
    <!-- See proxy documentation for more information about using this. -->
    <Connector port="8082"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" acceptCount="100" connectionTimeout="20000"
               proxyPort="80" disableUploadTimeout="true" />

  
3. tomcat 시작 후 브라우저에서 확인
   http://localhost:8443


댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG more
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함