Tomcat Instanznamen ändern

HarleyDavidson

Bekanntes Mitglied
Hallo zusammen,
jetzt google ich schon eine ganze Weile und finde nicht die Lösung. Vielleicht könnt ihr mir helfen:
Ich habe hier mehrere Tomcat-Instanzen auf einem Server laufen und möchte diese entsprechend umbenennen, so dass diese auch im Manager angezeigt werden. Diesen Text hier möchte ich editieren:

2015_04_15_09_43_53_Apache_Tomcat_7.0.14.jpg

Bisher habe ich nur die Möglichkeit gefunden, die index.jsp unter

"webapps/ROOT/index.jsp" in Zeile 26 und 45 zu ändern:

HTML:
<%--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--%>
<!DOCTYPE html>
<%
java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat("yyyy");
request.setAttribute("year", sdf.format(new java.util.Date()));
request.setAttribute("tomcat7Url", "http://tomcat.apache.org/");
request.setAttribute("tomcat7DocUrl", "/docs/");
%>
<html lang="en">
    <head>
        <title><%=request.getServletContext().getServerInfo() %></title> <<<<<<<<
        <link href="favicon.ico" rel="icon" type="image/x-icon" />
        <link href="favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <link href="tomcat.css" rel="stylesheet" type="text/css" />
    </head>

    <body>
        <div id="wrapper">
            <div id="navigation" class="curved container">
                <span id="nav-home"><a href="${tomcat7Url}">Home</a></span>
                <span id="nav-hosts"><a href="${tomcat7DocUrl}">Documentation</a></span>
                <span id="nav-hosts"><a href="${tomcat7DocUrl}config/">Configuration</a></span>
                <span id="nav-wiki"><a href="http://wiki.apache.org/tomcat/FrontPage">Wiki</a></span>
                <span id="nav-lists"><a href="${tomcat7Url}lists.html">Mailing Lists</a></span>
                <span id="nav-help"><a href="${tomcat7Url}findhelp.html">Find Help</a></span>
                <br class="separator" />
            </div>
            <div id="asf-box">
                <div id="version">
                    <h1><%=request.getServletContext().getServerInfo() %></h1> <<<<<<<
                </div>
                (...)

Aber "request.getServletContext().getServerInfo()" im <title>-Tag verrät mir, dass diese Variable doch irgendwo gesetzt wird und es eine elegantere Möglichkeit gibt, als den Namen hart gecoded einzutippen.

Weiß jemand, wo diese Variable gesetzt wird und / oder man den Tomcat-Namen ändern kann?

Vielen Dank!
 
Zuletzt bearbeitet:
Keine wirklich schöne Lösung, aber sie funktioniert:

In
CATALINA_BASE/lib
das Verzeichnis
org/apache/catalina/util
erstellen und dort ein Properties-File namens ServerInfo.properties anlegen.

Inhalt dessen:
server.info=MeineTomcatInstanz_X/1.2.3

Nach einem Update der Tomcat-Version wäre das dann natürlich futsch.
 

Neue Themen


Zurück
Oben