You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rob Hills <ro...@netpaver.com.au> on 2005/07/12 06:29:27 UTC

api for server.xml maintenance

Hi All,

We typically use one Tomcat instance to serve multiple applications, each 
with its own domain name.

I have always managed this by creating a host entry for each application, 
primarily so that we can have the application rooted at the default (empty-
path) context.

However, this has meant I've always had to manually create a host entry 
each time I deploy a new application, either by editing server.xml in the old 
days, or via the admin application in TC 5.5.

We're now automating the process of deployment and I've been hunting 
around for some kind of API to enable me to create new host entries.  After 
much time hunting documentation and Google, time pressure led me to 
write some code that stops tomcat and directly modifies server.xml, but the 
whole process is very flakey and I feel this is the wrong way to do things, 
leaving aside the fact that one needs direct access to the file system to do 
it.

I'm tantalised by the "Monitoring and Management" (section 21) part of the 
User Guide, but unfortunately it only tells me how to enable JMX, not how I 
could use that to manage Tomcat.

I've read and re-read the Manager documentation, and the Deployer 
documentation, but I can't see any way of using those processes to deploy 
multiple applications on one server such that each has its own root context.

So, I have two questions:

1.	Is there some sort of API I can use to programmatically 
create/modify host entries in server.xml.  If so, how can I find out how to use 
that.

2.	Alternatively, is there any way to deploy multiple "root context" 
applications using the built in manager?

TIA,

Rob Hills
Perth, Western Australia

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


Automated Server Configuration (was api for server.xml maintenance)

Posted by Rob Hills <ro...@netpaver.com.au>.
Hi All,

I received no reply to my earlier email in this thread so I thought I'd try and 
come up with a less verbose description of my problem.

I'm looking to automate the management of hosts on my server.

Our tomcat servers operate multiple applications, each of which has its own 
host entry and root context.  We do this because each application has its 
own domain name and the domain name and root context is an important 
feature for our clients.

I've read the documentation on the Tomcat Manger and the Tomcat 
Deployer in great detail, but as far as I can tell, both only support the 
management of contexts under a previously established host.

I'm also aware of the ability to "auto-deploy" applications by depositing their 
WAR files into the %CATALINA_HOME%/webapps directory.  However, 
these are then associated with a context under the default host, which is not 
what I want to achieve.

I'd thought maybe there I could write a request filter that redirects requests 
for a specified url (domain name + url) to a context in the default host, but 
I'm not even sure that would do what I need, let alone how it would 
perform/scale.

Any thoughts, suggestions, comments welcome.

Rob Hills
www.netpaver.com.au
Western Australia

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