8.4 Apache Tomcat서버 보안

 

  1. 아파치 톰캣의 서버 정보를 보이지 않도록 조절합니다.
    %TOMCAT_HOME%/conf/server.xml 에서 아래의 항목을 추가합니다.
    <Valve className="org.apache.catalina.valves.ErrorReportValve" showReport="false" showServerInfo="false" />
    항목을 추가하면 톰캣의 서버 정보를 보여주지 않습니다.

  1. server.xml에 web.xml에 에러 코드를 정의합니다.

정의해야할 에러코드는 다음과 같습니다.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#client_error_responses
400~415, 500~505 까지의 페이지를 정의합니다.

에러페이지는 서버, 프로그램 정보가 노출되지 않도록 합니다. 상단에 에러 코드가 정상적으로 리턴될수 있도록 정의합니다..

  1. 에러페이지가 정상적으로 포워딩하지 않는다면 server.xml 에 context를 정의합니다.

 

2. 톰캣의 오류 메시지 to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache 가 나올텐데 이것은 캐쉬가 부족해서 나오는 메시지인데 다음을 수정합니다.

%TOMCAT_HOME%/conf/context.xml에

<Resources cachingAllowed="true" cacheMaxSize="200000" />

 

 

 

<span id="pageNum"/>