aspose file tools*
The moose likes Tomcat and the fly likes Mutiple Instances of a server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Mutiple Instances of a server" Watch "Mutiple Instances of a server" New topic
Author

Mutiple Instances of a server

John Lark
Ranch Hand

Joined: Feb 08, 2010
Posts: 72
Hey All,

I am trying to run two servers through one tomcat. I want one on 8080 and one on 9090. In order to accomplish this I copped the all the page information and pasted it below then changed the main port from 8080 to 9090, the shutdown port from 8005 to 9005 and the ajp one from 8009 to 9009. I restarted tomcat and now it recoginzes the 8080 but when I change it to 9090 its consistently giving me a page not found!?

Thanks and HELP,
John
Misha Ver
Ranch Hand

Joined: Mar 03, 2008
Posts: 470
Is it Windows or Linux platform? If it is Windows, how did you install Tomcat? There are the steps for non Windows Service Installer Running multiple Tomcat instances on Windows
John Lark
Ranch Hand

Joined: Feb 08, 2010
Posts: 72
I am running on windows server 2003 & 2008. I am using the following Install File:
apache-tomcat-6.0.26.exe.
John Lark
Ranch Hand

Joined: Feb 08, 2010
Posts: 72
Would it be possible to do it through the server.xml? This is for a program that is going to install itself, the easiest approach seems to me it would be to rewrite the xml file?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16061
    
  21

John Lark wrote:Would it be possible to do it through the server.xml? This is for a program that is going to install itself, the easiest approach seems to me it would be to rewrite the xml file?


There are 2 Tomcat environment variables: CATALINA_HOME and CATALINA_BASE. In most cases, they point to the same place, but if you want to run multiple instances of Tomcat, you set CATALINA_BASE to a shared copy of Tomcat, and create a separate CATALINA_HOME for each one. CATALINA_HOME contains the webapps, work, temp, and conf directories. CATALINA_BASE contains the sharable files, such as the bin and lib directories.

In an environment where tomcat is controlled via a command-line interface, you'd set up the environment variables before you invoked the catalina.bat start function for each Tomcat. I don't know how to to that using the Windows Service Manager, however, since I rarely run Tomcat on Windows, and usually do it from the command prompt when I do.


Customer surveys are for companies who didn't pay proper attention to begin with.
John Lark
Ranch Hand

Joined: Feb 08, 2010
Posts: 72
As I am learning more about the subject (John <-- Tomcat Newbie) I am asking for something different then what I wanted . I am not looking to make multiple Instances of Tomcat I am looking to run multiple Servers within one Instance of Tomcat, if possible(no one has said it isn't yet). Although, I really have appreciated the information so far its helping me to understand parts of the this that I am not comprehending.

Thanks,
John
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16061
    
  21

John Lark wrote:As I am learning more about the subject (John <-- Tomcat Newbie) I am asking for something different then what I wanted . I am not looking to make multiple Instances of Tomcat I am looking to run multiple Servers within one Instance of Tomcat. Although, I really have appreciated the information so far its helping me to understand parts of the this that I am not comprehending.

Thanks,
John


Tomcat is a server. So each "server" is an instance.

I think what you're actually looking for is Virtual Hosts. One Tomcat server instance can support multiple virtual hosts, and, in fact, we just had a nice discussion on how to set up multiple virtual hosts in Tomcat. Check this forum's recent history.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mutiple Instances of a server