아파치나 nginx 웹서버의 경우 해당 경로에 index 페이지 파일 설정이 안되어있으면, 그 directory 의 파일 목록을 보여주는 기능이 있다.


tomcat 에도 있을까 하고 살펴봤더니 옵션 한곳만 바꿔주면 된다.


conf/web.xml

<servlet> 

        <servlet-name>default</servlet-name> 

        <servlet-class> 

          org.apache.catalina.servlets.DefaultServlet 

        </servlet-class> 

        <init-param> 

            <param-name>debug</param-name> 

            <param-value>0</param-value> 

        </init-param> 

        <init-param> 

            <param-name>listings</param-name> 

            <param-value>false</param-value> 

        </init-param> 

        <load-on-startup>1</load-on-startup> 

</servlet> 

listings 의 false 를 true 로 바꿔주고,
tomcat을 재시작해주면 파일 목록을 볼 수 있다 :)


(아마 운영 서버에서는 이렇게 쓰진 않겠지...)

2013/10/15 21:47 2013/10/15 21:47

BSD는 리눅스가 아니지만 편의상 -_-;


setaria# make install clean
===>  Installing for tomcat-5.5.17
===>   tomcat-5.5.17 depends on file: /usr/local/diablo-jdk1.5.0/bin/java - found
===>   Generating temporary packing list
===>  Checking if www/tomcat55 already installed
>> Creating destination directory... [ DONE ]
>> Copying files to destination directory...
       Installing local configuration file: /usr/local/tomcat5.5/conf/Catalina/localhost/host-manager.xml
       Installing local configuration file: /usr/local/tomcat5.5/conf/Catalina/localhost/manager.xml
       Installing local configuration file: /usr/local/tomcat5.5/conf/catalina.policy
       Installing local configuration file: /usr/local/tomcat5.5/conf/catalina.properties
       Installing local configuration file: /usr/local/tomcat5.5/conf/context.xml
       Installing local configuration file: /usr/local/tomcat5.5/conf/logging.properties
       Installing local configuration file: /usr/local/tomcat5.5/conf/server-minimal.xml
       Installing local configuration file: /usr/local/tomcat5.5/conf/server.xml
       Installing local configuration file: /usr/local/tomcat5.5/conf/tomcat-users.xml
       Installing local configuration file: /usr/local/tomcat5.5/conf/web.xml
[ DONE ]
>> Creating log files... [ DONE ]
>> Creating symlink to tools.jar... [ DONE ]
>> Fixing ownership settings... [ DONE ]
>> Fixing permissions... [ DONE ]
Apache Tomcat 5.5.17 has been installed in /usr/local/tomcat5.5.
===> Installing rc.d startup script(s)
===>   Registering installation for tomcat-5.5.17
===>  Cleaning for diablo-jdk-1.5.0.07.00===>  Cleaning for xorg-libraries-6.9.0
===>  Cleaning for javavmwrapper-2.3
===>  Cleaning for imake-6.9.0
===>  Cleaning for libdrm-2.0.2
===>  Cleaning for freetype2-2.1.10_5
===>  Cleaning for fontconfig-2.3.2_5,1
===>  Cleaning for perl-5.8.8
===>  Cleaning for gmake-3.81_1
===>  Cleaning for pkg-config-0.20_2
===>  Cleaning for expat-2.0.0_1
===>  Cleaning for gettext-0.14.5_2
===>  Cleaning for libtool-1.5.22_2
===>  Cleaning for libiconv-1.9.2_2
===>  Cleaning for tomcat-5.5.17
2006/12/17 19:02 2006/12/17 19:02