Search

Tomcat 리다이렉트 설정

Multi-select
SSL
SSL인증서
TLS
SSL보안서버
보안서버 인증서
UCERT
HTTPS
유서트
CodeSign
코드싸인
Tomcat

설정 확인 사항

이 문서는 SSL 인증서 설치를 위한 설정이며 관련 없는 설정은 부분적으로 생략하였습니다.
서버마다 설정이 상이할 수 있어 인증서 설치 시 해당 문서 참고 부탁드립니다.

진행 과정

1. conf/web.xml 파일에 아래 설정 구문을 </web-app> 구문 위(맨 마지막 부분)에 넣어 주도록 합니다.

- 설정 구문

<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

- 삽입될 위치

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</<welcome-file>
<security-constraint>
<web-resource-collection>
<web-resource-name>Entire Application</web-resource-name>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
설정 구문이 삽입될 위치
</web-app>

2. server.xml의 http Connector 부분에서 지정한 리다이렉트 될 SSL 포트로 설정해줍니다.

아래의 예시처럼 redirectPort를 “444”로 설정 시, 444로 리다이렉트 하게 됩니다.
※ 만약 SSL(HTTPS) 포트가 8443이라면 8443으로 포트를 지정해주면 됩니다.
Ex. http://www.ucert.co.kr -> https://www.ucert.co.kr:8443
<Connector port=”8080” protocol=”HTTP/1.1” connectionTimeout=”20000” redirectPort=”444” />

- SSLProtocols 톰캣 버전 별 설정 구문 & 옵션 (TLS 프로토콜 활성화)

TLS 1.2 & TLS 1.1프로토콜은 톰캣 버전 상관없이 JAVA 1.7.x 버전 이상이 필요합니다.
Tomcat 5 and 6 (prior to 6.0.38)
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocols = "TLS" />
Tomcat 6 (6.0.38 and later) and 7
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslEnabledProtocols = "TLSv1,TLSv1.1,TLSv1.2" />

3. Tomcat 프로세스 재시작을 진행합니다.

[root@localhost /bin]#./shutdown.sh
[root@localhost /bin]#./startup.sh

관련된 자료가 더 필요하신가요?