tomcat에서 https 설정

보안을 위해 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
크리에이티브 커먼즈 라이센스
Creative Commons License

Posted by 김형준


Trackback URL : http://www.jaso.co.kr/trackback/160

Leave a comment
« Previous : 1 : ... 261 : 262 : 263 : 264 : 265 : 266 : 267 : 268 : 269 : ... 388 : Next »