# Tomcat - https://tomcat.apache.org - 서블릿 컨테이너 표준 구현 서버 - JAVA_HOME 환경 변수 필요 ## Run ``` bin/startup.sh bin\startup.bat ``` ## Folder - conf - server.xml - webapps - ROOT.war - Maven folder structure vs. WebContent ## Tomcat Architecture tomcat architecture ## Eclipse(STS) Tomcat Tip - Server Options - Check `Serve modules without publishing` - `application.getRealPath("/")` - External Web Browser - Disable all validations ## SSL - http://tomcat.apache.org/tomcat-9.0-doc/ssl-howto.html ```bash keytool -genkey -alias tomcat -keyalg RSA -keystore ~/.ssh/okdevtv.keystore ``` - conf/server.xml ```xml ``` - check ``` curl https://localhost:8443 -k ``` ## Sharing Session conf/context.xml ```xml ``` - clear cookie and test - `checker.jsp` in each webapp ```jsp <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> Checker context path : <%= application.getContextPath() %>
sesseion id : <%= session.getId() %>
cookie string : <%= request.getHeader("cookie") %> ``` ## ref - http://kenu.github.io/tomcat70/docs/