1.tomcat9的webapps下利用的拜访
tomcat9的server.xml文件中 <Host>下须要加一段:
<Context docBase="/xxx/tomcat9/webapps/xxx" path="/" reloadable="true"></Context>
改完后大抵为:
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <Context docBase="/xxx/tomcat9/webapps/xxx" path="/" reloadable="true"></Context>
留神:
path="/"
意思是,相当于指定此利用作为和默认时ROOT的拜访形式-->根目录拜访localhost
能够改为具体的域名,比方www.niewj.com
,具体理论看你的域名
2. 进一步:删除webapps下所有目录,只留本人利用
2.1 删除阐明
- docs、examples和ROOT这几个文件夹是能够间接删除的;
- host-manager和manager删除后会有日志告警,要打消,须要做如下操作
2.2 须要删除的内容
tomcat/conf/logging.properties
删除局部配置:
[1] handlers删除两项:
3manager.org.apache.juli.AsyncFileHandler, 4host-manager.org.apache.juli.AsyncFileHandler,
[2] 上面该两项相干的也都删掉(注掉即可):
# 3manager.org.apache.juli.AsyncFileHandler.level = FINE# 3manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs# 3manager.org.apache.juli.AsyncFileHandler.prefix = manager.# 3manager.org.apache.juli.AsyncFileHandler.maxDays = 90# 3manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8# 4host-manager.org.apache.juli.AsyncFileHandler.level = FINE# 4host-manager.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs# 4host-manager.org.apache.juli.AsyncFileHandler.prefix = host-manager.# 4host-manager.org.apache.juli.AsyncFileHandler.maxDays = 90# 4host-manager.org.apache.juli.AsyncFileHandler.encoding = UTF-8
3. 小结
而后,webapps 下所有都删掉,只保留本人业务相干的利用即可,而且配合第一点,间接localhost:8080/拜访就是本人的利用。
参考:https://blog.csdn.net/flyinga...