tomcat - 将 webapps 位置从 Tomcat 9 安装目录移动到另一个路径
问题描述
我按照https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-9-on-debian-10的教程安装了tomcat 9,
因此得到了安装路径/opt/tomcat
然后我决定将webapps
文件夹移动到文件系统上的另一个路径。我的尝试是以这种方式将路径与文件中appBase
主机配置中的变量相关联conf/server.xml
:
<Host name="localhost"
<!-- appBase="webapps" -->
appBase="/opt/tomcat/webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
这不起作用,因此appBase
变量无法获得绝对路径的值。如何将webapps
文件夹移动到另一个位置,例如用户目录?
解决方案
请在 server.xml 文件中使用以下标记。
<Host name="localhost" appBase="/opt/tomcat/webapps" unpackWARs="true" autoDeploy="true">
推荐阅读
- sql-server - SQL Server 中浮点数据类型上算术运算符的可空性属性
- ssis - 带有单列的平面文件导入被截断到可用数据大小以下
- react-native - 如何在 expo/react-native 应用程序中添加自定义节点模块?
- javascript - 如何在 react.js 组件中将一个十六进制的值更改为另一个十六进制(简单方法)
- javascript - 无法在 Laravel 页面的谷歌浏览器中检测到选项卡关闭事件
- angular - 指定 rxjs observable 的“错误”处理程序的类型
- ios - UISearchBar 和 UISearchBarController 的区别?
- uwp - 如何在 Windows 10 GATT 服务中打开 L2CAP 通道?
- c# - 如何删除文件而不显示位置
- php - 如何在 bluehost 服务器中将 Server API CGI/FastCGI 更改为 Apache Handler。某些功能在我的 php 配置中不起作用