-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Neven,

On 8/22/14, 2:59 AM, Neven Cvetkovic wrote:
> On Thu, Aug 21, 2014 at 9:40 PM, David Kerber
> <dcker...@verizon.net> wrote:
> 
>> On 8/21/2014 6:18 PM, André Warnier wrote:
>>> 
>>> Now all that's left to do is for someone to make a version of
>>> this that works for installing and starting the same as Windows
>>> Services.
>>> 
>>> Despite what Christopher wrote - which is basically right -
>>> there is still some tricky element there, in that you cannot
>>> set the "system-wide" environment variables JAVA_HOME,
>>> CATALINA_HOME and CATALINA_BASE.  If you do, then each of the
>>> respective (tomcat6, tomcat7, tomcat8) "service.bat" will use
>>> the set values, and never prompt for another. I have not
>>> actually tested this scenario, but looking at the code of the 
>>> "service.bat" file, I believe that in case you install multiple
>>> Tomcat services, there is a potential for misbehaving there
>>> (for example, it requires JAVA_HOME to be set, but which one
>>> ?).
>>> 
>> 
>> I think the intent of the instructions was to allow you to run
>> any of them, but start them at different times, changing the
>> environment variables as appropriate before starting each one.
>> Once an instance is started, I believe it's safe to change the
>> env var's to start the next one.
>> 
>> 
> André and David,
> 
> I wanted to exactly avoid installing Tomcat as a Windows service.
> My (assumed) goal was to have operational Tomcat instances that I
> can start/stop at will. I also tried to avoid setting any of the
> environment variables (CATALINA_HOME, CATALINA_BASE, JAVA_HOME,
> PATH) globally or for the running "shell" (command prompt window) -
> but rather scope it to the execution of the particular startup
> script.

So just write a batch script that looks like this:

@ECHO OFF
SET CATALINA_BASE=whatever
SET CATALINA_HOME=whatever

CALL %CATALINA_HOME%\bin\catalina.sh start

Name it tomcat-start-environmentX.bat and create one for each
environment. If you want to be able to start/stop them, etc. then you
can use bin\startup.bat for an example of how to copy command-line
arguments from the current script and pass them to another (hint: it's
not as easy as it is in a *NIX shell).

I wouldn't ever recommend setting CATALINA_HOME and CATALINA_BASE
globally. If you want to use multiple environments without installing
a Windows Servics or writing your own wrappers, etc. then you *must*
use the environment variables to control where Tomcat looks for things.

It's just not that difficult to do given the flexibility it gives you.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJT960XAAoJEBzwKT+lPKRY/OsQALkmelpL6Di11fCQ/ZZvDHDx
8xtmf79+NJsTCt9Kjd34Tp1XqL3v010chw3athA/ks2UdWh6/9j2jBjFYQ5e7qAF
EpRO4kGxCMs1h3HKlf4zcy9xiE2M1g3hURYkKBeFGgO4Iw0Qx3UVrQTUJTlcIJyL
AiLjv9ZvG6ePo3VN/3ju1Stf4aNPmT6Y3Qaaa//ArGt3LU/Zg2YqalwbbvmV2R7v
FGUBlBKgC00jCOVOdlhbSdh2fmv9Wv7FTUV7Yor47NUZnAHpyG5+UjRbE1o60emU
HnT9JqLho5T0raVfeWKw/jOnyZMzqGibYUH6QlBRXsIYSeiQuRAJ5JCNEm+qJClh
fsuXcKEjofuUOwVutto8dMM7GuBPcPrzj2wkNLwRomxi1MuUGtJDyoFFNZc9VDOA
5fxQBqbDhowXuv0dDbZRtFY81w5hXLhLmdItutJKnXnhbUem9Y9q1vrSyCWalKoD
iXWraE7pvKFKeK6ymtPmrswP9u0Esp9bGxxA7EHkjQdsy4LZoKCuIV+K1fqMnceD
Q9z4UqIf5mmTMdTQsB1iGB1BiUKPKCnIXtcvAajK5/9LX0SfHeKVoAjfHY/xA3fI
W5X6SnC1j5etfT/51RKlEGiJs0Qgl4edvYqy8KTop+XsWA7RQGmOG9giDKGCUa0X
MoYIaytnTrD2kgzsPRdP
=CnQ3
-----END PGP SIGNATURE-----

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

Reply via email to