天天看點

47.2. 配置 Tomcat 伺服器

tomcat 端口預設為8080, 可以通過修改下面port項改為80端口,但不建議你這樣使用80端口,tomcat 會繼承root權限,這是非常危險的做法。

性能調整

壓縮傳送資料

如果你的站點編碼非UTF-8,去掉URIEncoding="UTF-8"使用下面選項.

useBodyEncodingForURI="true"

在Connector中加入server="Neo App Srv 1.0"

配置虛拟目錄

例如我們需要這樣的配置

實作方法

關閉war自動部署 unpackWARs="false" autoDeploy="false"。防止被植入木馬等惡意程式

關閉 reloadable="false" 也用于防止被植入木馬

修改 Cookie 變量 JSESSIONID, 這個cookie 是用于維持Session關系。建議你改為PHPSESSID。

狀态監控 http://localhost/manager/status

服務管理 http://localhost/manager/html/list

context.xml 主要用于配置 資料庫連接配接池

開啟熱部署,生産環境不建議使用

org.apache.catalina.webresources.Cache.getResource Unable to add the resource at [/WEB-INF/lib/netkiller.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache

修改日志目錄

配置跳過掃描*.jar

context.xml

原文出處:Netkiller 系列 手劄

本文作者:陳景峯

轉載請與作者聯系,同時請務必标明文章原始出處和作者資訊及本聲明。