- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在 Tomcat 的文档中,关于 Defining a context 的部分列出以下选项来定义上下文:
$CATALINA_BASE/conf/[enginename]/[hostname]/
目录中的单个文件(扩展名为“.xml”)。上下文路径和版本将从文件的基本名称派生(文件名减去 .xml 扩展名)。此文件将始终优先于打包在 Web 应用程序的 META-INF 目录中的任何 context.xml 文件。选项 1 不好,因为它意味着必须对应用程序工件中的值进行硬编码,并且不能轻易更改它们。
选项 3 被文档积极劝阻:
It is NOT recommended to place elements directly in the server.xml file.
这只留给我们选项 2,尤其是如果我们想使用不同的配置多次部署同一应用程序(例如,一个用于生产,一个用于测试),这是唯一的选择。
但是文档没有解释,[enginename]
或 [hostname]
应该是什么,或者它们默认是什么。
这些的默认值是什么?我可以在哪里更改它们?
最佳答案
长话短说 [enginename]
通常是 Catalina
和 [hostname]
通常是 localhost
.
简单说明
在 Tomcat 附带的默认配置中,引擎配置在 $CATALINA_HOME/conf/server.xml
中, 在该文件的末尾,您通常会看到类似这样的内容:
<Engine name="Catalina" defaultHost="localhost">
...
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
</Engine>
name
<Engine>
的属性(property)元素是 enginename
和 name
<Host>
的属性(property)元素是 hostname
.
更长的解释
答案可以在两个地方找到,通过阅读 Host和 Engine Tomcat 文档的页面。
对于 <Engine>
元素有趣的值是:
默认主机:
The default host name, which identifies the Host that will process requests directed to host names on this server, but which are not configured in this configuration file. This name MUST match the name attributes of one of the Host elements nested immediately inside.
姓名:
Logical name of this Engine, used in log and error messages. When using multiple Service elements in the same Server, each Engine MUST be assigned a unique name.
对于 <Host>
它声明的元素:
姓名:
Usually the network name of this virtual host, as registered in your Domain Name Service server. Regardless of the case used to specify the host name, Tomcat will convert it to lower case internally. One of the Hosts nested within an Engine MUST have a name that matches the defaultHost setting for that Engine. See Host Name Aliases for information on how to assign more than one network name to the same virtual host.
关于Tomcat:定义上下文,[Enginename] 和 [Hostname] 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44181214/
无法启动 hostname.service:单元 hostname.service 被屏蔽。 这发生在主机名更新之后,尝试执行 sudo 服务主机名启动。 最佳答案 在运行 service hostn
我基于vmware搭建hadoop集群,使用sbin/start-dfs.sh命令,遇到ssh问题。它说, ssh: Could not resolve hostname now.: No addre
我在两个 AWS EC2 实例上运行的集群环境中运行 Airflow。一份给主人,一份给 worker 。工作节点在运行“$airflow worker”时会定期抛出此错误: [2018-08-09
我现在正在设置新的 SuSE Linux Enterprise 12 服务器。有人可以解释一下,/etc/hostname 和 yast2 > 主机名之间有什么区别?两者似乎都有不同的内容,一个地方的
我正在尝试使用 Go SDK 将文件上传到 Amazon S3 存储桶到自定义终端节点,但我收到了该错误: RequestError: send request failed caused by: P
从 cloud.mongodb 处理 URI 后,我尝试通过 compass 进行连接(1.15.1) 在 Windows 10 上,但我收到这个奇怪的错误: No hostname or hostn
我尝试部署了一个测试hadoop集群环境。当我启动它时,所有日志都正确,但是无法运行任何hadoop命令,我发现9000端口没有被监听。 运行hadoop命令(ERROR,所有命令都是一样的错误):
在 Linux 上启动为 Apache Solr 4.x 配置的 tomcat6 服务时,如果有人可以帮助解决在 catalina.out 中记录的这个问题,我将不胜感激: Mar 22, 2014
我有一个本地网络,上面有几台 PC 和专用 Controller 。这些专用 Controller 必须配置静态 IP 地址,并且不具备 DHCP 功能。 我被要求将设备主机名和 IP 地址的列表放在
我正在使用 puppet 来配置服务器。我想在 *.erb 模板中打印当前机器(节点)名称。有主机名变量,但这包含 puppetmaster 主机名。是否有关于此主题的任何好的引用/列表? 最佳答案
我对这些概念 super 陌生,如果这很愚蠢,我深表歉意。我正在尝试使用Elasticsearch数据源在Grafana上可视化Metricbeat数据,这些数据源均在本地运行,但无法找到Metric
假设我有一个具有以下属性的虚拟机 FQDN :trialinstance.westus.cloudapp.azure.com Public IP : XXX.XXX.XXX.XXX Private I
假设我有一个具有以下属性的虚拟机 FQDN :trialinstance.westus.cloudapp.azure.com Public IP : XXX.XXX.XXX.XXX Private I
在 CLI Linux 中我运行: echo $HOSTNAME 并接收: alex-HP-295-G1-SFF-Business-PC 我尝试在java中获取这个环境 ExpressionPa
如果我回显一个包含 $(hostname) 命令的字符串,那么它工作正常。例如,在终端中运行: echo "http://$(hostname)/main.html" http://artur/mai
我想写一个C++代码来获取所有主机名的完整信息,以及已添加到域控制的计算机的IP地址和子网掩码。 最佳答案 gethostname 会给你当前主机的名字 gethostbyname 查找具有特定名称的
在 CLI 模式下 getenv('HOSTNAME') 正确返回 HOSTNAME 环境变量,但在脚本中调用时返回 FALSE。 为什么?如何在脚本中获取 HOSTNAME 变量? 最佳答案 HOS
本文是关于Linux操作系统主机名(hostname)的文档,对主要配置文件/etc/hosts进行简要的说明 ;另外对基配具工具hostname也进行了举例说明; 欢迎高手斧正,谢谢; 目录
需要修改两处:一处是/etc/sysconfig/network,另一处是/etc/hosts,只修改任一处会导致系统启动异常。首先切换到root用户。 复制代码
使用Win7,Gitolite和TortoiseGIT 今天,我将GIT更新为2.6.1版,因此必须卸载旧版本。 很久以前,我创建了一个ssh-config文件,以更轻松地访问我的存储库,并且从今天开
我是一名优秀的程序员,十分优秀!