Michael,

On 6/13/2018 3:58 AM, Lemke, Michael ST/HZA-ZIC2 wrote:
I've been struggling to come to grips with Tomcat installation on Windows 
Server but I couldn't really find a clear answer. This is what I want to 
achieve:

   *   Have one directory tree with all my webapps
   *   Have a tomcat installation somewhere different, like C:\Program Files
   *   run tomcat as a service
   *   be able to easily replace/update the tomcat installation
I could run the supplied installer and it created a working service. Editing 
server.xml I could make it use my intended webapps directory. So far so good 
(if I got that server.xml right) but now all lives in something like 
D:\apache-tomcat-9.0.6. Not good. The Windows service configuration has this 
path hard coded in its definition, the directory has files with installation 
specific configuration and some other live working directories also end up 
there.
Any suggestion how to do this right? So that I can easily upgrade this to say, 
tomcat 9.0.8?

You can use bin/service.bat [1] to install the service with the settings that you want.

Set your configuration settings in environment variables, e.g.

    set CATALINA_HOME=<path-to-Tomcat-binaries>
    set JRE_HOME=<path-to-JRE>

Then install the Windows service with

    service.bat install

If you want to update a previous installation then first uninstall the service with

    service.bat uninstall

Be sure to check the changelog for breaking changes first.

For now, I'd be happy with a single Tomcat service but to be able to have 
several (on different ports of course) would be a welcome bonus.

Use a different SERVICE_NAME and  a different CATALINA_BASE for each installation.  e.g.

    set CATALINA_BASE=<path-to-Tomcat-config-setup>

[1] https://github.com/apache/tomcat/blob/trunk/bin/service.bat#L17

Best,


Igal

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to