multiple instances of tomcat
Edward Quick
edwardquick at hotmail.com
Sat May 23 16:59:57 UTC 2015
From: edwardquick at hotmail.com
To: users at lists.fedoraproject.org
Subject: multiple instances of tomcat
Date: Sat, 23 May 2015 14:49:15 +0000
Hi,
First just to say I'm running F21.
I found a post on setting up multiple tomcat instances at https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20130708/1055381.html which states:
In the new world, if you need an instance, you'll create a directory
/var/lib/tomcats/name, create {conf temp work webapps} in it, and then
systemctl enable tomcat at name.service.
So I created /var/lib/tomcats/instance1, /var/lib/tomcats/instance2 and /var/lib/tomcats/instance3 (and their contents)
I then ran:
[root at laptop system]# systemctl enable tomcat at instance1.service
Created symlink from /etc/systemd/system/multi-user.target.wants
/tomcat at instance1.service to /usr/lib/systemd/system/tomcat at .service.
[root at laptop system]# systemctl enable tomcat at instance2.service
Created symlink from /etc/systemd/system/multi-user.target.wants
/tomcat at instance2.service to /usr/lib/systemd/system/tomcat at .service.
[root at laptop system]# systemctl enable tomcat at instance3.service
Created symlink from /etc/systemd/system/multi-user.target.wants/tomcat at instance3.service to /usr/lib/systemd/system/tomcat at .service.
And created these sysconfig files, changing the CATALINA_BASE to match the corresponding directory under /var/lib/tomcats:
[root at laptop system]# ls -l /etc/sysconfig/*tomcat*
-rw-rw-r--. 1 root tomcat 490 Feb 14 21:29 /etc/sysconfig/tomcat
-rw-r--r--. 1 root root 194 May 23 14:58 /etc/sysconfig/tomcat at instance1
-rw-r--r--. 1 root root 194 May 23 14:59 /etc/sysconfig/tomcat at instance2
-rw-r--r--. 1 root root 194 May 23 15:00 /etc/sysconfig/tomcat at instance3
Unfortunately everytime I try to start one of these instances, for example, if I run
systemctl start tomcat at instance2
it just starts up the system installed tomcat with CATALINA_BASE /usr/share/tomcat.
Please could you tell me if I am doing anything obviously wrong here? :)
Thanks for any help.
Edward
P.S. Just a note to add that I did get this working but only after adding the following files. The discussion in the attached link seemed to indicate that I shouldn't need to do this.
[root at laptop logs]# cat /etc/sysconfig/tomcat at instance1
TOMCAT_CFG_LOADED=1
CATALINA_HOME="/usr/share/tomcat"
CATALINA_BASE="/var/lib/tomcats/instance1"
CATALINA_TMPDIR="/var/lib/tomcats/instance1/temp"
TOMCAT_USER="tomcat"
CATALINA_PID="/var/lib/tomcats/instance1/logs/tomcat.pid"
[root at laptop logs]# cat /etc/sysconfig/tomcat at instance2
TOMCAT_CFG_LOADED=1
CATALINA_HOME="/usr/share/tomcat"
CATALINA_BASE="/var/lib/tomcats/instance2"
CATALINA_TMPDIR="/var/lib/tomcats/instance2/temp"
TOMCAT_USER="tomcat"
CATALINA_PID="/var/lib/tomcats/instance2/logs/tomcat.pid"
[root at laptop logs]# cat /etc/sysconfig/tomcat at instance3
TOMCAT_CFG_LOADED=1
CATALINA_HOME="/usr/share/tomcat"
CATALINA_BASE="/var/lib/tomcats/instance3"
CATALINA_TMPDIR="/var/lib/tomcats/instance3/temp"
TOMCAT_USER="tomcat"
CATALINA_PID="/var/lib/tomcats/instance3/logs/tomcat.pid"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.fedoraproject.org/pipermail/users/attachments/20150523/88d972a3/attachment.html>
More information about the users
mailing list