I'm doing a distribution of tomcat for a many servers and in each of these servers the realm is going to be different. I would like to have a file /etc/tomcat/realm.xml
containing the realm for that installation and have the file /var/lib/tomcat/conf/server.xml
import it directly. I've tried with Xinclude without luck and I'm about to resort to sed
to the import when running /etc/init.d/tomcat
. Is there a better way to do this?
views:
25answers:
1
A:
I'm not familiar with tomcat, but will it recognize/handle a system entity?
I'm not sure what the root element of /var/lib/tomcat/conf/server.xml
is, so I'll just use server
in my example:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server [
<!ENTITY realm SYSTEM "/etc/tomcat/realm.xml">
]>
<server>
&realm;
</server>
Would something like that work?
DevNull
2010-04-17 05:56:25
I'm going to give that a try and post back if it worked.
rmarimon
2010-04-17 14:19:20
This works perfectly but doesn't seem as robust as I would like. I ended up using something like the result of this question http://stackoverflow.com/questions/2699666/replace-delimited-block-of-text-in-file-with-the-contents-of-another-file
rmarimon
2010-04-24 01:48:02
Glad you got it working. Thanks for posting the link to the other question.
DevNull
2010-04-24 02:02:36