Server.xml is for the most part a standard xml file and what Hassan is suggesting is a very standard way of including external files in XML.

At the very top of your file, before anything (except maybe the <?xml version="1.0" ...?> line if it exists) put in a DOCTYPE tag as described below. The entity tag within it will define the external file to include. Place &virtualhosts; where you want that file to be included as in:

<!DOCTYPE Server [
  <!ENTITY virtualhosts SYSTEM "file:/etc/tomcat4/virtualhosts.xml">
]>

<Server port="8005" shutdown="SHUTDOWN" debug="0">
  .... lot of config stuff including global resources and service tag......
  <Engine .......>
    <Host ...(if any are defined within the file)....>
        .... more config stuff including contexts if any.....
    </Host>

&virtualhost ;

</Engine>
</Server>


Note: DOCTYPE is a special case -- there is no terminating </DOCTYPE> tag. Putting one in will only cause an error.

virtualhosts.xml should be just a fragment of the server.xml file -- preferably just the <Host> open and close tags and all the stuff within them.

If you need more info on this way of doing things, I strongly recommend consulting some documentation on XML files either online or in books. It'll help to understand the XML standard better.

--David

Ponnam Janiki wrote:

Hi Hassan,

I'm sorry to bothering you. I'm not getting what you send. Can you please
explain about this?

Thanks
Ram

-----Original Message-----
From: Hassan Schroeder [mailto:[EMAIL PROTECTED] Sent: Friday, May 07, 2004 2:10 PM
To: Tomcat Users List
Subject: Re: Include file?


Steven Garrett wrote:



ok, so I put this into my server.xml underneath the last <Host> entry

<!ENTITY virtualhosts = "SYSTEM /etc/tomcat4/virtualhosts.xml" />



?! Uh, that's not even close to what I sent :-)


<!DOCTYPE Server [
  <!ENTITY virtualhosts SYSTEM "file:/etc/tomcat4/virtualhosts.xml">
]>

That goes right *before* the <Server ...> tag at the top of your
server.xml file...



&virtualhosts;



The above line can then follow your other <Host> block.


HTH!




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to