tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject RE: Tomcat 3.3 and 4.x tuning via command line
Date Fri, 08 Feb 2002 18:03:41 GMT


On Fri, 8 Feb 2002, GOMEZ Henri wrote:

> Date: Fri, 8 Feb 2002 18:10:57 +0100
> From: GOMEZ Henri <hgomez@slib.fr>
> Reply-To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> To: Tomcat Developers List <tomcat-dev@jakarta.apache.org>
> Subject: RE: Tomcat 3.3 and 4.x tuning via command line
>
> >I'm wondering whether we really need to build it in to Tomcat itself,
> >though.  Can't you accomplish the same thing by using a little
> >Ant script
> >and run a <filter> or <replace> task?  All this would require
> >is packaging
> >ant.jar along with Tomcat, or requiring users that need the facility to
> >download Ant themselves.
>
> Could you give us a little example of ant replace task ?
>
> It will be a great interest for the mass :)
>

There's a lot of power in what the <replace> task can do.  Here's a very
simple one that replaces the string "@port@" with the port number
specified by the "port" property:

  <project name="Create server.xml" default="generate">

    <target name="generate" description="Generate customized server.xml">
      <replace file="server.xml" token="@port@" value="${port}"
    </target>

  </project>

In your template server.xml, you'd have a <Connector> element like this:

  <Connector ... port="@port@" .../>

Now, you just run "ant -Dport=8085" and you've replaced the port number.
Generalizing this to replace lots of properties is straightforward.

See the Ant docs for more details <http://jakarta.apache.org/ant/>.

Craig


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message