[Apache Tomcat] Enhance security

我沒有在使用 Apache Tomcat 的後台,佈署軟體/程式都是透過 scp/sftp/ftp 等方式做傳輸。
所以在解開 Apache Tomcat 的壓縮檔之後,我會執行以下指令,把不必要的檔案清掉,增強安全性:

cd apache-tomcat-* && \
/bin/rm -rf webapps/docs webapps/examples webapps/host-manager webapps/manager && \
/bin/rm -f webapps/ROOT/*.gif webapps/ROOT/*.xml webapps/ROOT/*.ico webapps/ROOT/*.txt webapps/ROOT/*.svg && \
/bin/cat /dev/null > webapps/ROOT/index.jsp &&
/bin/cat /dev/null > webapps/ROOT/index.html