사용자 도구

사이트 도구


java:tomcat

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
java:tomcat [2017/07/25 08:14]
kwon37xi
java:tomcat [2019/06/19 13:26] (현재)
kwon37xi [주요 Valve]
줄 13: 줄 13:
   * [[https://examples.javacodegeeks.com/enterprise-java/tomcat/apache-tomcat-connector-example/|Apache Tomcat Connector Example - mod_jk]]   * [[https://examples.javacodegeeks.com/enterprise-java/tomcat/apache-tomcat-connector-example/|Apache Tomcat Connector Example - mod_jk]]
   * [[https://examples.javacodegeeks.com/enterprise-java/tomcat/apache-tomcat-hardening-tutorial/|Apache Tomcat Hardening Tutorial | Examples Java Code Geeks - 2016]]   * [[https://examples.javacodegeeks.com/enterprise-java/tomcat/apache-tomcat-hardening-tutorial/|Apache Tomcat Hardening Tutorial | Examples Java Code Geeks - 2016]]
 +  * [[http://tomcat.apache.org/presentations.html|Apache Tomcat® - Presentations]]
  
 ===== 다중 도메인 Session ===== ===== 다중 도메인 Session =====
줄 60: 줄 61:
 </code> </code>
  
 +
 +===== UTF-8 Charset/Encoding =====
 +  * [[http://www.baeldung.com/tomcat-utf-8|Making Tomcat UTF-8-Ready]]
 +
 +  * ''server.xml'' Connector에 ''URIEncodign="UTF-8"'' 지정
 +  * Spring 사용시 ''org.springframework.web.filter.CharacterEncodingFilter''로 필터 적용
 ===== Tomcat 7.0.54 ClassLoader memory leak ===== ===== Tomcat 7.0.54 ClassLoader memory leak =====
   * [[https://bz.apache.org/bugzilla/show_bug.cgi?id=57173|Bug 57173 – EOFException during annotation scanning]]   * [[https://bz.apache.org/bugzilla/show_bug.cgi?id=57173|Bug 57173 – EOFException during annotation scanning]]
줄 68: 줄 75:
   * 특히 MyBatis 3.4.0 버전에서 발생하였으며, Tomcat을 버전업하면 해결된다.   * 특히 MyBatis 3.4.0 버전에서 발생하였으며, Tomcat을 버전업하면 해결된다.
  
-===== 주요 Valve =====+===== RemoteIPValve =====
   * [[https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html|RemoteIpValve]] 프록시를 제거한 원본 요청 Remote IP 를 ''HttpServletRequest.remoteAddr''로 남겨주는 value   * [[https://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html|RemoteIpValve]] 프록시를 제거한 원본 요청 Remote IP 를 ''HttpServletRequest.remoteAddr''로 남겨주는 value
 +  * ''server.xml'' <code> 
 +<Valve className="org.apache.catalina.valves.RemoteIpValve" 
 +               remoteIpHeader="X-Forwarded-For" 
 +               requestAttributesEnabled="true" 
 +               internalProxies="127\.0\.0\.1"  /> 
 +</code> 
 +  * nginx <code> 
 +proxy_set_header X-Real-IP $remote_addr; 
 +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
 +proxy_set_header X-Forwarded-Proto $scheme; 
 +</code> 
 +  * [[springframework:springboot|SpringBoot]] 사용시에는 다음 프라퍼티 설정이 있으면 ''RemoteIpValue''가 자동 활성화된다.<code> 
 +server.tomcat.remote_ip_header=x-forwarded-for 
 +</code> 
 +  * [[springframework:springboot|SpringBoot]] 사용시에는 다음 프라퍼티 설정이 있어야 redirect 시에 protocol을 올바로 판단할 수 있다.<code> 
 +server.tomcat.protocol_header=x-forwarded-proto 
 +</code>
 ===== Realm ===== ===== Realm =====
   * [[https://dzone.com/articles/how-to-implement-a-new-realm-in-tomcat|How to Implement a New Realm in Tomcat ]]   * [[https://dzone.com/articles/how-to-implement-a-new-realm-in-tomcat|How to Implement a New Realm in Tomcat ]]
java/tomcat.1500939867.txt.gz · 마지막으로 수정됨: 2017/07/25 08:14 저자 kwon37xi