You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mo...@rbs.com on 2013/02/06 10:25:00 UTC

Tomcat

Hi

I am using a tomcat server on a Linux machine.
Is there any way I can run multiple instances of apached daemon process so that if daemon for environment A do not have access to files for environment B.
In short I want to run multiple daemon processes.

Thanks & Regards
MOHIT GARG
Analyst
International Banking
RBS
Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, Haryana, 122002, India
Office: +91 8860190177


*********************************************************************************** 
The Royal Bank of Scotland plc. Registered in Scotland No 90312. 
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised and regulated by the Financial Services Authority. The 
Royal Bank of Scotland N.V. is authorised and regulated by the 
De Nederlandsche Bank and has its seat at Amsterdam, the 
Netherlands, and is registered in the Commercial Register under 
number 33002587. Registered Office: Gustav Mahlerlaan 350, 
Amsterdam, The Netherlands. The Royal Bank of Scotland N.V. and 
The Royal Bank of Scotland plc are authorised to act as agent for each 
other in certain jurisdictions. 
  
This e-mail message is confidential and for use by the addressee only. 
If the message is received by anyone other than the addressee, please 
return the message to the sender by replying to it and then delete the 
message from your computer. Internet e-mails are not necessarily 
secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland 
N.V. including its affiliates ("RBS group") does not accept responsibility 
for changes made to this message after it was sent. For the protection
of RBS group and its clients and customers, and in compliance with
regulatory requirements, the contents of both incoming and outgoing
e-mail communications, which could include proprietary information and
Non-Public Personal Information, may be read by authorised persons
within RBS group other than the intended recipient(s). 

Whilst all reasonable care has been taken to avoid the transmission of 
viruses, it is the responsibility of the recipient to ensure that the onward 
transmission, opening or use of this message and any attachments will 
not adversely affect its systems or data. No responsibility is accepted 
by the RBS group in this regard and the recipient should carry out such 
virus and other checks as it considers appropriate. 

Visit our website at www.rbs.com 

***********************************************************************************  

Re: Tomcat

Posted by André Warnier <aw...@ice-sa.com>.
Mark Eggers wrote:
> On 2/6/2013 3:20 AM, Mohit.Garg@rbs.com wrote:
>>
>> Hi Thanks for all the help and I know it may sound lame but I am
>> trying to learn these things. Although I have one more doubt. If we
>> have multiple tomcat for multiple environment on the single Unix
>> box(machine) Now Single Apache daemon is running for multiple
>> environment. So can we run multiple instance of Apache daemon in the
>> same machine or not for each different environment. If this is
>> possible how can we accomplish this.
>>
>> Thanks in advance for the help and sorry for bugging the group with
>> such silly questions.
>>
>> MOHIT GARG Analyst International Banking RBS Block No 1, Tower A,
>> Unitech Infospace Complex Sector 21, Gurgaon, Haryana, 122002, India
>> Office: +91 8860190177
>>
>> -----Original Message----- From: André Warnier
>> [mailto:aw@ice-sa.com] Sent: 06 February 2013 16:21 To: Tomcat Users
>> List Subject: Re: Tomcat
>>
>> Mohit.Garg@rbs.com wrote:
>>> Hi
>>>
>>> Regrets for the wrong framing of question. Actually I am new to
>>> tomcat and what I really want to do is run on the same server two
>>> different tomcats so that one doesn't interfere with the working of
>>> the other. As I have different environments so I want that the
>>> tomcat running in my development environment do not access the
>>> files of my SIT environment and vice-versa. That's why I want to
>>> have a separate tomcat process for each host. If I just change the
>>> port in the config file the request will be mapped but the various
>>> environments will have access to all the files as it will be
>>> present in the common directory.
>>>
>>
>> Ah, that's better. So we forget about Apache httpd, right ? So,
>> assuming that you are talking about tomcat only :
>>
>> There are (many) different levels of separation, depending on what
>> you really want to separate.
>>
>> First, a note : considering that you are on a Linux machine, it is
>> highly possible that you have installed Tomcat using a pre-packaged
>> version from your Linux distribution. These packages work fine and
>> are easy to install for a normal single-instance case, but they make
>> it more difficult for doing the kind of thing that you want to do,
>> and more difficult for people on this list to help you.  That is
>> because each of these packages distributes the files of Tomcat in
>> different places on the disk, sets different environment variables,
>> sets differents links from one directory to the other in the
>> filesystem, etc.. So it would be better to install a "standard"
>> tomcat downloaded from the website "tomcat.apache.org", to some
>> directory like /opt/tomcat, and follow the instructions that are
>> given in the "RUNNING.txt" file at the top of this distribution. This
>> way, everyone here knows what you are talking about and has a good
>> idea of where things are. (You can also leave your current Tomcat
>> where it is, and consider it as your "production" tomcat, and
>> download and install another copy to another directory as your
>> "development" tomcat. Then we can maybe help you set up this
>> development tomcat in a way that does not conflict with the other
>> one).
>>
>> Then, the next question is : you want to run 2 "separate" tomcats, so
>> as not to mix the production and the development environments. That's
>> established. But do you want also to be able to run 2 different
>> /versions/ of Tomcat ?
>>
>> If yes, you will have to download and install tomcat twice, to 2
>> separate directories in /opt (such as /opt/tomcat-prod and
>> /opt/tomcat-dev for instance). If not, then one single copy of tomcat
>> will be enough, and you can configure things to still run 2 different
>> "instances" of tomcat, from one single copy of the code.
>>
>>
>> Then, some advance information : There are 2 environment variables
>> which point to disk directories and which are very important for what
>> you want to do :
>>
>> CATALINA_HOME : this tells Tomcat where its runnable *code* is
>> located.  under CATALINA_HOME, Tomcat expects to find for example
>> it's "bin" subdirectory, where the main executable parts of Tomcat
>> are located.
>>
>> CATALINA_BASE : this tells Tomcat where its instance-specific
>> "things" are located. For example, Tomcat will look into
>> $CATALINA_BASE/conf to find its main configuration files.
>>
>> By default, these 2 values are the same, and Tomcat will use the same
>> /bin, /conf etc..
>>
>> But you can set up 2 tomcat instances to use the same $CATALINA_HOME
>> directory (so they will run the same Tomcat code from
>> $CATALINA_HOME/bin), but have different $CATALINA_BASE directories
>> (so they will use a different configuration from $CATALINA_BASE/conf,
>> different webapps from $CATALINA_BASE/webapps etc).
>>
>> That's the basics for separating two tomcat instances.
>>
>> Note that there is still a much easier way, using a single Tomcat
>> instance and just 2 separate "virtual hosts" inside the same running
>> Tomcat (see :
>> http://tomcat.apache.org/tomcat-7.0-doc/virtual-hosting-howto.html).
>> The hostnames will be different, and the webapps will be completely
>> separate.  But there will still be one single instance of tomcat
>> running, and there /could/ be interference between them (not at the
>> access level, but in the sense that one webapp could use up all the
>> memory and so interfere with the other e.g.).
>>
> 
> +1 for all tha André has said.
> 
> (Mark-like novella typing detected above :p)
> 
> Anyway, what we do is the following:
> 
> 1. One Apache HTTPD
> 
> This runs named virtual hosts and IP-based virtual hosts (see the Apache 
> HTTPD docs and the Apache HTTPD mailing list)
> 
> 2. mod_jk between Apache HTTPD and multiple Tomcats
> 
> 2a. Each Tomcat gets its own worker.properties configuration
> 
> See http://tomcat.apache.org/connectors-doc/reference/workers.html for 
> details. There are great examples in the recent mod_jk source  bundle.
> 
> 2b. Each named virtual host gets its own uriworkermap.properties file
> 
> See http://tomcat.apache.org/connectors-doc/reference/uriworkermap.html 
> for details. There are great examples in the recent mod_jk source bundle.
> 
> 3. Tomcat configuration
> 
> 3a. Make sure that each Tomcat has a <Host> element that corresponds to 
> each Apache named virtual host (or IP-based virtual host) that it's 
> responsible for.
> 
> 3b. Make sure that the ports are different for each Tomcat.
> (Shutdown port, AJP port, any HTTP/1.1 ports)
> 
> 4. Run each Tomcat as a separate service
> 
> We use a separate start-up script for each. Each start-up script reads 
> from a configuration file that has CATALINA_HOME, CATALINA_BASE, and 
> JRE_HOME defined. This means we can run different JVMs for different 
> Tomcats, and upgrade each Tomcat separately.
> 
> 5. As André pointed out, run a stock Tomcat from tomcat.apache.org
> 
> 6. Run all of the Tomcats from an unprivileged account
> 
> We make the account only accessible via su, control access, and monitor 
> its use. This makes auditing much easier.
> 
> I'm sure there is more, but this is quite long enough as it is.
> 
> . . . . just my two cents.

+1 (mutual admiration society, one hand washes the other etc.)

P.S. Do I detect some Mark-like novella-typing here too ?


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


Re: Tomcat

Posted by Mark Eggers <it...@yahoo.com>.
On 2/6/2013 3:20 AM, Mohit.Garg@rbs.com wrote:
>
> Hi Thanks for all the help and I know it may sound lame but I am
> trying to learn these things. Although I have one more doubt. If we
> have multiple tomcat for multiple environment on the single Unix
> box(machine) Now Single Apache daemon is running for multiple
> environment. So can we run multiple instance of Apache daemon in the
> same machine or not for each different environment. If this is
> possible how can we accomplish this.
>
> Thanks in advance for the help and sorry for bugging the group with
> such silly questions.
>
> MOHIT GARG Analyst International Banking RBS Block No 1, Tower A,
> Unitech Infospace Complex Sector 21, Gurgaon, Haryana, 122002, India
> Office: +91 8860190177
>
> -----Original Message----- From: André Warnier
> [mailto:aw@ice-sa.com] Sent: 06 February 2013 16:21 To: Tomcat Users
> List Subject: Re: Tomcat
>
> Mohit.Garg@rbs.com wrote:
>> Hi
>>
>> Regrets for the wrong framing of question. Actually I am new to
>> tomcat and what I really want to do is run on the same server two
>> different tomcats so that one doesn't interfere with the working of
>> the other. As I have different environments so I want that the
>> tomcat running in my development environment do not access the
>> files of my SIT environment and vice-versa. That's why I want to
>> have a separate tomcat process for each host. If I just change the
>> port in the config file the request will be mapped but the various
>> environments will have access to all the files as it will be
>> present in the common directory.
>>
>
> Ah, that's better. So we forget about Apache httpd, right ? So,
> assuming that you are talking about tomcat only :
>
> There are (many) different levels of separation, depending on what
> you really want to separate.
>
> First, a note : considering that you are on a Linux machine, it is
> highly possible that you have installed Tomcat using a pre-packaged
> version from your Linux distribution. These packages work fine and
> are easy to install for a normal single-instance case, but they make
> it more difficult for doing the kind of thing that you want to do,
> and more difficult for people on this list to help you.  That is
> because each of these packages distributes the files of Tomcat in
> different places on the disk, sets different environment variables,
> sets differents links from one directory to the other in the
> filesystem, etc.. So it would be better to install a "standard"
> tomcat downloaded from the website "tomcat.apache.org", to some
> directory like /opt/tomcat, and follow the instructions that are
> given in the "RUNNING.txt" file at the top of this distribution. This
> way, everyone here knows what you are talking about and has a good
> idea of where things are. (You can also leave your current Tomcat
> where it is, and consider it as your "production" tomcat, and
> download and install another copy to another directory as your
> "development" tomcat. Then we can maybe help you set up this
> development tomcat in a way that does not conflict with the other
> one).
>
> Then, the next question is : you want to run 2 "separate" tomcats, so
> as not to mix the production and the development environments. That's
> established. But do you want also to be able to run 2 different
> /versions/ of Tomcat ?
>
> If yes, you will have to download and install tomcat twice, to 2
> separate directories in /opt (such as /opt/tomcat-prod and
> /opt/tomcat-dev for instance). If not, then one single copy of tomcat
> will be enough, and you can configure things to still run 2 different
> "instances" of tomcat, from one single copy of the code.
>
>
> Then, some advance information : There are 2 environment variables
> which point to disk directories and which are very important for what
> you want to do :
>
> CATALINA_HOME : this tells Tomcat where its runnable *code* is
> located.  under CATALINA_HOME, Tomcat expects to find for example
> it's "bin" subdirectory, where the main executable parts of Tomcat
> are located.
>
> CATALINA_BASE : this tells Tomcat where its instance-specific
> "things" are located. For example, Tomcat will look into
> $CATALINA_BASE/conf to find its main configuration files.
>
> By default, these 2 values are the same, and Tomcat will use the same
> /bin, /conf etc..
>
> But you can set up 2 tomcat instances to use the same $CATALINA_HOME
> directory (so they will run the same Tomcat code from
> $CATALINA_HOME/bin), but have different $CATALINA_BASE directories
> (so they will use a different configuration from $CATALINA_BASE/conf,
> different webapps from $CATALINA_BASE/webapps etc).
>
> That's the basics for separating two tomcat instances.
>
> Note that there is still a much easier way, using a single Tomcat
> instance and just 2 separate "virtual hosts" inside the same running
> Tomcat (see :
> http://tomcat.apache.org/tomcat-7.0-doc/virtual-hosting-howto.html).
> The hostnames will be different, and the webapps will be completely
> separate.  But there will still be one single instance of tomcat
> running, and there /could/ be interference between them (not at the
> access level, but in the sense that one webapp could use up all the
> memory and so interfere with the other e.g.).
>

+1 for all tha André has said.

(Mark-like novella typing detected above :p)

Anyway, what we do is the following:

1. One Apache HTTPD

This runs named virtual hosts and IP-based virtual hosts (see the Apache 
HTTPD docs and the Apache HTTPD mailing list)

2. mod_jk between Apache HTTPD and multiple Tomcats

2a. Each Tomcat gets its own worker.properties configuration

See http://tomcat.apache.org/connectors-doc/reference/workers.html for 
details. There are great examples in the recent mod_jk source  bundle.

2b. Each named virtual host gets its own uriworkermap.properties file

See http://tomcat.apache.org/connectors-doc/reference/uriworkermap.html 
for details. There are great examples in the recent mod_jk source bundle.

3. Tomcat configuration

3a. Make sure that each Tomcat has a <Host> element that corresponds to 
each Apache named virtual host (or IP-based virtual host) that it's 
responsible for.

3b. Make sure that the ports are different for each Tomcat.
(Shutdown port, AJP port, any HTTP/1.1 ports)

4. Run each Tomcat as a separate service

We use a separate start-up script for each. Each start-up script reads 
from a configuration file that has CATALINA_HOME, CATALINA_BASE, and 
JRE_HOME defined. This means we can run different JVMs for different 
Tomcats, and upgrade each Tomcat separately.

5. As André pointed out, run a stock Tomcat from tomcat.apache.org

6. Run all of the Tomcats from an unprivileged account

We make the account only accessible via su, control access, and monitor 
its use. This makes auditing much easier.

I'm sure there is more, but this is quite long enough as it is.

. . . . just my two cents.
/mde/

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


Re: Tomcat

Posted by André Warnier <aw...@ice-sa.com>.
Mohit.Garg@rbs.com wrote:
>  
> Hi
> Thanks for all the help and I know it may sound lame but I am trying to learn these things.
> Although I have one more doubt.
> If we have multiple tomcat for multiple environment on the single Unix box(machine)
> Now Single Apache daemon is running for multiple environment. So can we run multiple instance of Apache daemon in the same machine or not for each different environment.
> If this is possible how can we accomplish this.
> 

Yes you can, but this is a Tomcat list, not an Apache httpd list.
So for that question you should better go to the Apache httpd help list.

The real question is : what does that Apache httpd really do, in your setup ?


(Unrelated note : send your responses only to the list, do not send me an extra copy. I 
already get each message posted to the list, so I get them in double now).

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


RE: Tomcat

Posted by Mo...@rbs.com.
 
Hi
Thanks for all the help and I know it may sound lame but I am trying to learn these things.
Although I have one more doubt.
If we have multiple tomcat for multiple environment on the single Unix box(machine)
Now Single Apache daemon is running for multiple environment. So can we run multiple instance of Apache daemon in the same machine or not for each different environment.
If this is possible how can we accomplish this.

Thanks in advance for the help and sorry for bugging the group with such silly questions.

MOHIT GARG
Analyst 
International Banking
RBS
Block No 1, Tower A, Unitech Infospace Complex Sector 21, Gurgaon, Haryana, 122002, India
Office: +91 8860190177   

-----Original Message-----
From: André Warnier [mailto:aw@ice-sa.com] 
Sent: 06 February 2013 16:21
To: Tomcat Users List
Subject: Re: Tomcat

Mohit.Garg@rbs.com wrote:
> Hi
>  
> Regrets for the wrong framing of question.
> Actually I am new to tomcat and what I really want to do is run on the same server two different tomcats so that one doesn't interfere with the working of the other.
> As I have different environments so I want that the tomcat running in my development environment do not access the files of my SIT environment and vice-versa. That's why I want to have a separate tomcat process for each host.
> If I just change the port in the config file the request will be mapped but the various environments will have access to all the files as it will be present in the common directory.
> 

Ah, that's better.
So we forget about Apache httpd, right ?
So, assuming that you are talking about tomcat only :

There are (many) different levels of separation, depending on what you really want to separate.

First, a note : considering that you are on a Linux machine, it is highly possible that you have installed Tomcat using a pre-packaged version from your Linux distribution.
These packages work fine and are easy to install for a normal single-instance case, but they make it more difficult for doing the kind of thing that you want to do, and more difficult for people on this list to help you.  That is because each of these packages distributes the files of Tomcat in different places on the disk, sets different environment variables, sets differents links from one directory to the other in the filesystem, etc..
So it would be better to install a "standard" tomcat downloaded from the website "tomcat.apache.org", to some directory like /opt/tomcat, and follow the instructions that are given in the "RUNNING.txt" file at the top of this distribution.
This way, everyone here knows what you are talking about and has a good idea of where things are.
(You can also leave your current Tomcat where it is, and consider it as your "production" 
tomcat, and download and install another copy to another directory as your "development" 
tomcat. Then we can maybe help you set up this development tomcat in a way that does not conflict with the other one).

Then, the next question is : you want to run 2 "separate" tomcats, so as not to mix the production and the development environments. That's established.
But do you want also to be able to run 2 different /versions/ of Tomcat ?

If yes, you will have to download and install tomcat twice, to 2 separate directories in /opt (such as /opt/tomcat-prod and /opt/tomcat-dev for instance).
If not, then one single copy of tomcat will be enough, and you can configure things to still run 2 different "instances" of tomcat, from one single copy of the code.


Then, some advance information :
There are 2 environment variables which point to disk directories and which are very important for what you want to do :

CATALINA_HOME : this tells Tomcat where its runnable *code* is located.  under CATALINA_HOME, Tomcat expects to find for example it's "bin" subdirectory, where the main executable parts of Tomcat are located.

CATALINA_BASE : this tells Tomcat where its instance-specific "things" are located. For example, Tomcat will look into $CATALINA_BASE/conf to find its main configuration files.

By default, these 2 values are the same, and Tomcat will use the same /bin, /conf etc..

But you can set up 2 tomcat instances to use the same $CATALINA_HOME directory (so they will run the same Tomcat code from $CATALINA_HOME/bin), but have different $CATALINA_BASE directories (so they will use a different configuration from $CATALINA_BASE/conf, different webapps from $CATALINA_BASE/webapps etc).

That's the basics for separating two tomcat instances.

Note that there is still a much easier way, using a single Tomcat instance and just 2 separate "virtual hosts" inside the same running Tomcat (see : http://tomcat.apache.org/tomcat-7.0-doc/virtual-hosting-howto.html).
The hostnames will be different, and the webapps will be completely separate.  But there will still be one single instance of tomcat running, and there /could/ be interference between them (not at the access level, but in the sense that one webapp could use up all the memory and so interfere with the other e.g.).


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


*********************************************************************************** 
The Royal Bank of Scotland plc. Registered in Scotland No 90312. 
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised and regulated by the Financial Services Authority. The 
Royal Bank of Scotland N.V. is authorised and regulated by the 
De Nederlandsche Bank and has its seat at Amsterdam, the 
Netherlands, and is registered in the Commercial Register under 
number 33002587. Registered Office: Gustav Mahlerlaan 350, 
Amsterdam, The Netherlands. The Royal Bank of Scotland N.V. and 
The Royal Bank of Scotland plc are authorised to act as agent for each 
other in certain jurisdictions. 
  
This e-mail message is confidential and for use by the addressee only. 
If the message is received by anyone other than the addressee, please 
return the message to the sender by replying to it and then delete the 
message from your computer. Internet e-mails are not necessarily 
secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland 
N.V. including its affiliates ("RBS group") does not accept responsibility 
for changes made to this message after it was sent. For the protection
of RBS group and its clients and customers, and in compliance with
regulatory requirements, the contents of both incoming and outgoing
e-mail communications, which could include proprietary information and
Non-Public Personal Information, may be read by authorised persons
within RBS group other than the intended recipient(s). 

Whilst all reasonable care has been taken to avoid the transmission of 
viruses, it is the responsibility of the recipient to ensure that the onward 
transmission, opening or use of this message and any attachments will 
not adversely affect its systems or data. No responsibility is accepted 
by the RBS group in this regard and the recipient should carry out such 
virus and other checks as it considers appropriate. 

Visit our website at www.rbs.com 

***********************************************************************************  


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


Re: Tomcat

Posted by André Warnier <aw...@ice-sa.com>.
Mohit.Garg@rbs.com wrote:
> Hi
>  
> Regrets for the wrong framing of question.
> Actually I am new to tomcat and what I really want to do is run on the same server two different tomcats so that one doesn't interfere with the working of the other.
> As I have different environments so I want that the tomcat running in my development environment do not access the files of my SIT environment and vice-versa. That's why I want to have a separate tomcat process for each host.
> If I just change the port in the config file the request will be mapped but the various environments will have access to all the files as it will be present in the common directory.
> 

Ah, that's better.
So we forget about Apache httpd, right ?
So, assuming that you are talking about tomcat only :

There are (many) different levels of separation, depending on what you really want to 
separate.

First, a note : considering that you are on a Linux machine, it is highly possible that 
you have installed Tomcat using a pre-packaged version from your Linux distribution.
These packages work fine and are easy to install for a normal single-instance case, but 
they make it more difficult for doing the kind of thing that you want to do, and more 
difficult for people on this list to help you.  That is because each of these packages 
distributes the files of Tomcat in different places on the disk, sets different 
environment variables, sets differents links from one directory to the other in the 
filesystem, etc..
So it would be better to install a "standard" tomcat downloaded from the website 
"tomcat.apache.org", to some directory like /opt/tomcat, and follow the instructions that 
are given in the "RUNNING.txt" file at the top of this distribution.
This way, everyone here knows what you are talking about and has a good idea of where 
things are.
(You can also leave your current Tomcat where it is, and consider it as your "production" 
tomcat, and download and install another copy to another directory as your "development" 
tomcat. Then we can maybe help you set up this development tomcat in a way that does not 
conflict with the other one).

Then, the next question is : you want to run 2 "separate" tomcats, so as not to mix the 
production and the development environments. That's established.
But do you want also to be able to run 2 different /versions/ of Tomcat ?

If yes, you will have to download and install tomcat twice, to 2 separate directories in 
/opt (such as /opt/tomcat-prod and /opt/tomcat-dev for instance).
If not, then one single copy of tomcat will be enough, and you can configure things to 
still run 2 different "instances" of tomcat, from one single copy of the code.


Then, some advance information :
There are 2 environment variables which point to disk directories and which are very 
important for what you want to do :

CATALINA_HOME : this tells Tomcat where its runnable *code* is located.  under 
CATALINA_HOME, Tomcat expects to find for example it's "bin" subdirectory, where the main 
executable parts of Tomcat are located.

CATALINA_BASE : this tells Tomcat where its instance-specific "things" are located. For 
example, Tomcat will look into $CATALINA_BASE/conf to find its main configuration files.

By default, these 2 values are the same, and Tomcat will use the same /bin, /conf etc..

But you can set up 2 tomcat instances to use the same $CATALINA_HOME directory (so they 
will run the same Tomcat code from $CATALINA_HOME/bin), but have different $CATALINA_BASE 
directories (so they will use a different configuration from $CATALINA_BASE/conf, 
different webapps from $CATALINA_BASE/webapps etc).

That's the basics for separating two tomcat instances.

Note that there is still a much easier way, using a single Tomcat instance and just 2 
separate "virtual hosts" inside the same running Tomcat
(see : http://tomcat.apache.org/tomcat-7.0-doc/virtual-hosting-howto.html).
The hostnames will be different, and the webapps will be completely separate.  But there 
will still be one single instance of tomcat running, and there /could/ be interference 
between them (not at the access level, but in the sense that one webapp could use up all 
the memory and so interfere with the other e.g.).


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


RE: Tomcat

Posted by Mo...@rbs.com.
Hi
 
Regrets for the wrong framing of question.
Actually I am new to tomcat and what I really want to do is run on the same server two different tomcats so that one doesn't interfere with the working of the other.
As I have different environments so I want that the tomcat running in my development environment do not access the files of my SIT environment and vice-versa. That's why I want to have a separate tomcat process for each host.
If I just change the port in the config file the request will be mapped but the various environments will have access to all the files as it will be present in the common directory.

-----Original Message-----
From: André Warnier [mailto:aw@ice-sa.com] 
Sent: 06 February 2013 15:30
To: Tomcat Users List
Subject: Re: Tomcat

Mohit.Garg@rbs.com wrote:

> Hi
> 
> I am using a tomcat server on a Linux machine.
> Is there any way I can run multiple instances of apached daemon process so that if daemon for environment A do not have access to files for environment B.
> In short I want to run multiple daemon processes.
> 

Hi. No offense but the way you are asking your question tends to suggest that you have a limited understanding of how this stuff works. Here are some pointers :

You seem to be talking about 2 different products :
1) Apache httpd : is a general purpose webserver, made by people who belong to the Apache httpd project (see : httpd.apache.org)
2) Apache Tomcat : is also a webserver, but mainly a "java servlet container", designed primarily to run web applications written in java.  It is made by other people who belong to the Apache Tomcat project (see : tomcat.apache.org)

(And see "www.apache.org" for what "Apache" really is).

Either one of Apache httpd or Apache tomcat can act as a webserver, serve static content and run web applications.
They can also work in combination, with Apache httpd acting as a front-end to one or more Tomcat servers.  If the client browsers always access the front-end Apache httpd server, and the front-end Apache httpd server then distributes the work to several back-end tomcat servers, this is called "proxying" and/or "load balancing".  There are also other programs (or hardware boxes) that can act as "proxy" and/or "load-balancer".

In both cases (Apache httpd or tomcat), you /can/ run several instances on a same host. 
It is only a matter of configuration.
Generally-speaking however, if the problem is that one instance is not enough to support the load that is put on it, multiplying the instances on the same host will not help.
You will need either to improve your applications (so that they respond better), or use a bigger machine, or multiply the hosts and divide the load between them (using a load-balancing configuration).

If the question is about separating the documents or applications into several independent "domains", so that one "website" does not have access to the data of another website, then in both cases the solution may be to run one single instance, but use what is know as "virtual hosts" (where one instance responds to several hostnames, each having its own documents and applications).

So now, would you like to rephrase your question more precisely ?

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


*********************************************************************************** 
The Royal Bank of Scotland plc. Registered in Scotland No 90312. 
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB. 
Authorised and regulated by the Financial Services Authority. The 
Royal Bank of Scotland N.V. is authorised and regulated by the 
De Nederlandsche Bank and has its seat at Amsterdam, the 
Netherlands, and is registered in the Commercial Register under 
number 33002587. Registered Office: Gustav Mahlerlaan 350, 
Amsterdam, The Netherlands. The Royal Bank of Scotland N.V. and 
The Royal Bank of Scotland plc are authorised to act as agent for each 
other in certain jurisdictions. 
  
This e-mail message is confidential and for use by the addressee only. 
If the message is received by anyone other than the addressee, please 
return the message to the sender by replying to it and then delete the 
message from your computer. Internet e-mails are not necessarily 
secure. The Royal Bank of Scotland plc and The Royal Bank of Scotland 
N.V. including its affiliates ("RBS group") does not accept responsibility 
for changes made to this message after it was sent. For the protection
of RBS group and its clients and customers, and in compliance with
regulatory requirements, the contents of both incoming and outgoing
e-mail communications, which could include proprietary information and
Non-Public Personal Information, may be read by authorised persons
within RBS group other than the intended recipient(s). 

Whilst all reasonable care has been taken to avoid the transmission of 
viruses, it is the responsibility of the recipient to ensure that the onward 
transmission, opening or use of this message and any attachments will 
not adversely affect its systems or data. No responsibility is accepted 
by the RBS group in this regard and the recipient should carry out such 
virus and other checks as it considers appropriate. 

Visit our website at www.rbs.com 

***********************************************************************************  


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


Re: Tomcat

Posted by André Warnier <aw...@ice-sa.com>.
Mohit.Garg@rbs.com wrote:

> Hi
> 
> I am using a tomcat server on a Linux machine.
> Is there any way I can run multiple instances of apached daemon process so that if daemon for environment A do not have access to files for environment B.
> In short I want to run multiple daemon processes.
> 

Hi. No offense but the way you are asking your question tends to suggest that you have a 
limited understanding of how this stuff works. Here are some pointers :

You seem to be talking about 2 different products :
1) Apache httpd : is a general purpose webserver, made by people who belong to the Apache 
httpd project (see : httpd.apache.org)
2) Apache Tomcat : is also a webserver, but mainly a "java servlet container", designed 
primarily to run web applications written in java.  It is made by other people who belong 
to the Apache Tomcat project (see : tomcat.apache.org)

(And see "www.apache.org" for what "Apache" really is).

Either one of Apache httpd or Apache tomcat can act as a webserver, serve static content 
and run web applications.
They can also work in combination, with Apache httpd acting as a front-end to one or more 
Tomcat servers.  If the client browsers always access the front-end Apache httpd server, 
and the front-end Apache httpd server then distributes the work to several back-end tomcat 
servers, this is called "proxying" and/or "load balancing".  There are also other programs 
(or hardware boxes) that can act as "proxy" and/or "load-balancer".

In both cases (Apache httpd or tomcat), you /can/ run several instances on a same host. 
It is only a matter of configuration.
Generally-speaking however, if the problem is that one instance is not enough to support 
the load that is put on it, multiplying the instances on the same host will not help.
You will need either to improve your applications (so that they respond better), or use a 
bigger machine, or multiply the hosts and divide the load between them (using a 
load-balancing configuration).

If the question is about separating the documents or applications into several independent 
"domains", so that one "website" does not have access to the data of another website, then 
in both cases the solution may be to run one single instance, but use what is know as 
"virtual hosts" (where one instance responds to several hostnames, each having its own 
documents and applications).

So now, would you like to rephrase your question more precisely ?

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