본문 바로가기

WAS/JBoss&WildFly

[JBoss 7/8] welcome-content 비활성화

728x90

JBoss 에서는 welcome-content가 존재한다.

 

이 welcome-content가 보안취약점 관련으로 조회되는 경우가 있는데,

이 디렉토리를 단순히 지우면 server error이 발생한다. 

 

그래서 비활성화를 하고 지워야 하다보니, 비활성화 하는 방법을 정리한다.

 

1. ${JBOSS_INSTANCE}/configuration/standalone-ha.xml 내에서 welcome-content 검색

 

여기에서 <location name="/" handler="welcome-content"/>,

<file name="welcome-content" path="${jboss.home.dir}/welcome-content"/> 부분을 주석처

        <subsystem xmlns="urn:jboss:domain:undertow:14.0" default-virtual-host="default-host" default-servlet-container="default" default-server="default-server" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}" default-security-domain="other">
            <byte-buffer-pool name="default"/>
            <buffer-cache name="default"/>
            <server name="default-server">
                <ajp-listener name="ajp" socket-binding="ajp"/>
                <http-listener name="default" socket-binding="http" redirect-socket="https" enable-http2="true"/>
                <https-listener name="https" socket-binding="https" ssl-context="applicationSSC" enable-http2="true"/>
                <host name="default-host" alias="localhost">
                	<!-- <location name> 태그 주석 -->
                    <!-- <location name="/" handler="welcome-content"/> --> 
                    <http-invoker http-authentication-factory="application-http-authentication"/>
                </host>
            </server>
            <servlet-container name="default">
                <jsp-config/>
                <websockets/>
            </servlet-container>
            <handlers>
            	<!-- <file name> 태그 주석 -->
                <!-- <file name="welcome-content" path="${jboss.home.dir}/welcome-content"/> -->
            </handlers>
            <application-security-domains>
                <application-security-domain name="other" security-domain="ApplicationDomain"/>
            </application-security-domains>
        </subsystem>