You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Konstantin Kolinko <kn...@gmail.com> on 2011/06/24 22:22:36 UTC

Multiple instances of the same Tomcat version (was: svn commit: r1139381)

2011/6/24  <ma...@apache.org>:
> Author: markt
> Date: Fri Jun 24 16:43:40 2011
> New Revision: 1139381
>
> URL: http://svn.apache.org/viewvc?rev=1139381&view=rev
> Log:
> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50949
> Provide the ability to specify the AJP port and service name when installing Tomcat using the Windows installer. This permits multiple instances of the same Tomcat version to be installed side-by-side.


It does not permit multiple instances, unless you are able to specify
shutdown port as well.

Though I suspect that for running as a service that value can be "-1", thought

1) I have not tested whether that is true lately.

2) if Tomcat is installed to be integrated with an IDE,  e.g. to be
used with Eclipse IDE, an explicit shutdown port will be needed.  That
is because when you create a "Server" in Eclipse, it copies
configuration files from existing installation of Tomcat and later
uses the port specified there to stopping launched Tomcat.


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Multiple instances of the same Tomcat version (was: svn commit: r1139381)

Posted by Mladen Turk <mt...@apache.org>.
On Sat, Jun 25, 2011 at 11:22 AM, Mark Thomas <ma...@apache.org> wrote:
> On 25/06/2011 10:17, Rainer Jung wrote:
>>
>> and let the user choose NN or NNN. In server.xml it could be
>> port="${portBase}80" etc. and in the startup options -DportBase=NN.
>
> Or define portBase (or httpPort, httpsPort, shutdownPort, ajpPort) in
> catalina.properties - easier for users to edit.
>

And perhaps using some well known scheme, eg:
connector.<protocol>.<param>
port="${connector.http.port}" address="${connector.http.address}"
etc ..

Regards
-- 
^TM

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Multiple instances of the same Tomcat version (was: svn commit: r1139381)

Posted by Mark Thomas <ma...@apache.org>.
On 25/06/2011 10:17, Rainer Jung wrote:
> On 24.06.2011 22:22, Konstantin Kolinko wrote:
>> 2011/6/24  <ma...@apache.org>:
>>> Author: markt
>>> Date: Fri Jun 24 16:43:40 2011
>>> New Revision: 1139381
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1139381&view=rev
>>> Log:
>>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50949
>>> Provide the ability to specify the AJP port and service name when installing Tomcat using the Windows installer. This permits multiple instances of the same Tomcat version to be installed side-by-side.
>>
>>
>> It does not permit multiple instances, unless you are able to specify
>> shutdown port as well.
>>
>> Though I suspect that for running as a service that value can be "-1", thought
>>
>> 1) I have not tested whether that is true lately.
>>
>> 2) if Tomcat is installed to be integrated with an IDE,  e.g. to be
>> used with Eclipse IDE, an explicit shutdown port will be needed.  That
>> is because when you create a "Server" in Eclipse, it copies
>> configuration files from existing installation of Tomcat and later
>> uses the port specified there to stopping launched Tomcat.
> 
> I don't know whether that is a good fit for this discussion, but I think
> technically the nicest way is to choose a port range and a port
> convention, for example:
> 
> - AJP: NN09
> - HTTP: NN80
> - Shutdown: NN05
> - HTTPS: NN43
> 
> and let the user choose NN or NNN. In server.xml it could be
> port="${portBase}80" etc. and in the startup options -DportBase=NN.

Or define portBase (or httpPort, httpsPort, shutdownPort, ajpPort) in
catalina.properties - easier for users to edit.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Multiple instances of the same Tomcat version (was: svn commit: r1139381)

Posted by Rainer Jung <ra...@kippdata.de>.
On 24.06.2011 22:22, Konstantin Kolinko wrote:
> 2011/6/24  <ma...@apache.org>:
>> Author: markt
>> Date: Fri Jun 24 16:43:40 2011
>> New Revision: 1139381
>>
>> URL: http://svn.apache.org/viewvc?rev=1139381&view=rev
>> Log:
>> Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50949
>> Provide the ability to specify the AJP port and service name when installing Tomcat using the Windows installer. This permits multiple instances of the same Tomcat version to be installed side-by-side.
> 
> 
> It does not permit multiple instances, unless you are able to specify
> shutdown port as well.
> 
> Though I suspect that for running as a service that value can be "-1", thought
> 
> 1) I have not tested whether that is true lately.
> 
> 2) if Tomcat is installed to be integrated with an IDE,  e.g. to be
> used with Eclipse IDE, an explicit shutdown port will be needed.  That
> is because when you create a "Server" in Eclipse, it copies
> configuration files from existing installation of Tomcat and later
> uses the port specified there to stopping launched Tomcat.

I don't know whether that is a good fit for this discussion, but I think
technically the nicest way is to choose a port range and a port
convention, for example:

- AJP: NN09
- HTTP: NN80
- Shutdown: NN05
- HTTPS: NN43

and let the user choose NN or NNN. In server.xml it could be
port="${portBase}80" etc. and in the startup options -DportBase=NN.

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Multiple instances of the same Tomcat version (was: svn commit: r1139381)

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/6/25 Konstantin Kolinko <kn...@gmail.com>:
> 2011/6/25 Konstantin Kolinko <kn...@gmail.com>:
>>
>> Though I suspect that for running as a service that value can be "-1", thought
>>
>
> Sorry, I did not notice that shutdown port has already been changed.
> (I looked in the file, but did not notice that my "svn update" command
> had failed).
>
>>
>> 2) if Tomcat is installed to be integrated with an IDE,  e.g. to be
>> used with Eclipse IDE, an explicit shutdown port will be needed.  That
>> is because when you create a "Server" in Eclipse, it copies
>> configuration files from existing installation of Tomcat and later
>> uses the port specified there to stopping launched Tomcat.
>>
>
> Defining the port numbers as properties in catalina.properties does
> work. I did it once.
>
> But, because of the above quoted use case, I think that server.xml
> created by the installer should stay as close as possible to the one
> packed in a zip archive.
>
> That means to use 8005 by default and to be able to change it.
>
> One more feature to be added: to be able to do not install HTTP or AJP
> connector if it is not needed.
>
> Technically, I think the installer can print the whole <Connector>
> element by itself instead of printing just the port.  (If user choses
> not to install the connector, the same text can be printed as an XML
> comment).
>
> (...)

One more idea:
maybe generate server_1.xml etc. at build time from conf/server.xml
E.g. with
http://ant.apache.org/manual/Tasks/replaceregexp.html

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Multiple instances of the same Tomcat version (was: svn commit: r1139381)

Posted by Konstantin Kolinko <kn...@gmail.com>.
2011/6/25 Konstantin Kolinko <kn...@gmail.com>:
>
> Though I suspect that for running as a service that value can be "-1", thought
>

Sorry, I did not notice that shutdown port has already been changed.
(I looked in the file, but did not notice that my "svn update" command
had failed).

>
> 2) if Tomcat is installed to be integrated with an IDE,  e.g. to be
> used with Eclipse IDE, an explicit shutdown port will be needed.  That
> is because when you create a "Server" in Eclipse, it copies
> configuration files from existing installation of Tomcat and later
> uses the port specified there to stopping launched Tomcat.
>

Defining the port numbers as properties in catalina.properties does
work. I did it once.

But, because of the above quoted use case, I think that server.xml
created by the installer should stay as close as possible to the one
packed in a zip archive.

That means to use 8005 by default and to be able to change it.

One more feature to be added: to be able to do not install HTTP or AJP
connector if it is not needed.

Technically, I think the installer can print the whole <Connector>
element by itself instead of printing just the port.  (If user choses
not to install the connector, the same text can be printed as an XML
comment).


By the way, I searched whether there exists some subroutine to perform
string replacements, so that we do not need to maintain several
fragments of the file.
Here are some pointers:

http://nsis.sourceforge.net/A_sample_script_that_uses_several_cool_functions_%28replace_txt,_mutually_exclusive_functions,_MUI,_patch_install,_etc.%29

http://nsis.sourceforge.net/Another_String_Replace_%28and_Slash/BackSlash_Converter%29

http://nsis.sourceforge.net/NSISpcre_plug-in

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org