<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>david winter &#187; tomcat</title>
	<atom:link href="http://davidwinter.me.uk/articles/tag/tomcat/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidwinter.me.uk</link>
	<description>you were expecting someone else?</description>
	<lastBuildDate>Mon, 28 Jun 2010 20:37:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Using Tomcat Ant tasks</title>
		<link>http://davidwinter.me.uk/articles/2006/03/21/using-tomcat-ant-tasks/</link>
		<comments>http://davidwinter.me.uk/articles/2006/03/21/using-tomcat-ant-tasks/#comments</comments>
		<pubDate>Tue, 21 Mar 2006 09:06:07 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://davidwinter.me.uk/articles/2006/10/13/using-tomcat-ant-tasks/</guid>
		<description><![CDATA[I&#8217;m now really loving Ant for compiling my Java projects together. It really has solved the problem of figuring out what to update, or going through countless commands to compile each package etc. You could be wondering why I don&#8217;t just use a fancy IDE, like Eclipse to do all this for me? Well&#8230; I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m now really loving Ant for compiling my Java projects together. It really has solved the problem of figuring out what to update, or going through countless commands to compile each package etc.</p>

<p>You could be wondering why I don&#8217;t just use a fancy IDE, like Eclipse to do all this for me? Well&#8230; I&#8217;ve tried. But&#8230; I just can&#8217;t &#8216;like&#8217; Eclipse. I admit, I was very impressed with it &#8211; tons of functionallity, but in the end, I just couldn&#8217;t give up using the beautiful TextMate. Eclipse felt cluttered and I was claustrophobic using it.</p>

<p>Pathetic excuse I know, but I need something I can get on and work with.</p>

<p><span id="more-23"></span></p>

<p>Anyway &#8211; enough side-tracking on talk of Eclipse.</p>

<p>Ant. Java compiling made easy. Bring on Tomcat extension tasks with it and that saves me another aspirin for working on my Tomcat coursework which is to develop a web based quiz. To install the Tomcat tasks for Ant on Mac OS X, you just need to copy them over:</p>

<pre><code>cp /usr/local/apache-tomcat-5.5.16/server/lib/catalina-ant.jar /Developer/Java/Ant/lib
</code></pre>

<p>Note that this installs the Tomcat tasks to the default Developer Tools install of Ant.  If you&#8217;ve installed Ant manually, you&#8217;ll need to change the paths above accordingly.</p>

<p>Once the <code>.jar</code> is copied over, in your <code>build.xml</code> files for your various projects, you&#8217;ll need to include the following tags:</p>

<pre><code>&lt;taskdef name="deploy" classname="org.apache.catalina.ant.DeployTask" /&gt;
&lt;taskdef name="undeploy" classname="org.apache.catalina.ant.UndeployTask" /&gt;
</code></pre>

<p>These task definitions only cover <code>deploy</code> and <code>undeploy</code> tasks. To use them in your project:</p>

<pre><code>&lt;target name="undeploy"&gt;    
    &lt;undeploy url="${tomcat.manager}"
        username="${tomcat.username}"
        password="${tomcat.password}"
        path="/yourwebapp" /&gt;
&lt;/target&gt;
</code></pre>

<p>Where <code>tomcat.manager</code> is your URL to your Tomcat manager. Usually <code>http://localhost:8080/manager</code>. <code>tomcat.username</code> and <code>tomcat.password</code> are self-explanatory. Then just substitute <code>yourwebapp</code> with the name of your tomcat application directory located inside the <code>webapp</code> directory. For my current coursework, this is <code>webquiz</code>.</p>

<p>The <code>deploy</code> task is very similar:</p>

<pre><code>&lt;target name="deploy" depends="war"&gt;
    &lt;deploy url="${tomcat.manager}"
        username="${tomcat.username}"
        password="${tomcat.password}"
        path="/${ant.project.name}"
        update="true"
        localWar="${war.dir}/${ant.project.name}.war" /&gt;
&lt;/target&gt;
</code></pre>

<p>I have another target that creates a WAR file of my entire web application. This is what I&#8217;ll use to deploy my application. The only additional attributes in the <code>deploy</code> task are <code>update</code> and <code>localWar</code>. <code>update</code> will replace an existing application if it already exists so that you have the latest working copy. <code>localWar</code> is the location of the WAR file you want to deploy.</p>

<p>Simple. Hope I&#8217;ve explained this clear enough.</p>

<p>As of writing this, I&#8217;m having some trouble getting this working with my iBook, which I assumed had the same set-up as my Intel iMac &#8211; of which, the above tasks are working perfectly.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidwinter.me.uk/articles/2006/03/21/using-tomcat-ant-tasks/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Tomcat on Mac OS X Tiger</title>
		<link>http://davidwinter.me.uk/articles/2006/02/20/tomcat-on-mac-os-x-tiger/</link>
		<comments>http://davidwinter.me.uk/articles/2006/02/20/tomcat-on-mac-os-x-tiger/#comments</comments>
		<pubDate>Mon, 20 Feb 2006 09:02:55 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[howto]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://davidwinter.me.uk/articles/2006/10/13/tomcat-on-mac-os-x-tiger/</guid>
		<description><![CDATA[Download the &#8216;Core&#8217; .tar.gz version of Tomcat (as of this writing 5.5.15) from http://tomcat.apache.org/download-55.cgi. Extract and move the folder: sudo mv ~/Desktop/apache-tomcat-5.5.15 /usr/local/ That&#8217;s all you need to do to actually install Tomcat&#8211;nice and simple. Now to create some start and stop scripts&#8230; cd /usr/local/bin sudo nano start_tomcat Enter the following and save: #!/bin/sh export [...]]]></description>
			<content:encoded><![CDATA[<p>Download the &#8216;Core&#8217; .tar.gz version of Tomcat (as of this writing 5.5.15) from http://tomcat.apache.org/download-55.cgi. Extract and move the folder: </p>

<pre><code>sudo mv ~/Desktop/apache-tomcat-5.5.15 /usr/local/
</code></pre>

<p>That&#8217;s all you need to do to actually install Tomcat&#8211;nice and simple. Now to create some start and stop scripts&#8230; </p>

<pre><code>cd /usr/local/bin
sudo nano start_tomcat
</code></pre>

<p>Enter the following and save:</p>

<pre><code>#!/bin/sh
export CATALINA_HOME=/usr/local/apache-tomcat-5.5.15
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
$CATALINA_HOME/bin/startup.sh
</code></pre>

<p>Now a stop script:</p>

<pre><code>sudo nano stop_tomcat
</code></pre>

<p>Enter the following:</p>

<pre><code>#!/bin/sh
export CATALINA_HOME=/usr/local/apache-tomcat-5.5.15
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
$CATALINA_HOME/bin/shutdown.sh
</code></pre>

<p>Voila! Now to start Tomcat, use <code>/usr/local/bin/start_tomcat</code> and to stop it use <code>/usr/local/bin/stop_tomcat</code>.</p>

<p>If you have <code>/usr/local/bin</code> included in your PATH environment variable, then you can start and stop Tomcat using <code>start_tomcat</code> and <code>stop_tomcat</code> respectively straight from the Terminal.</p>

<p>When Tomcat is started, you can see the installation by going to <a href="http://localhost:8080/">http://localhost:8080/</a>. In order to manage Tomcat, you&#8217;ll need to modify the <code>tomcat-users.xml</code> file.</p>

<pre><code>cd /usr/local/apache-tomcat-5.5.15/conf
sudo nano tomcat-users.xml
</code></pre>

<p>Inside this file, modify it so it includes the following tags:</p>

<pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;tomcat-users&gt;
  &lt;role rolename="manager"/&gt;
  &lt;role rolename="admin"/&gt;
  &lt;user username="davidwinter" password="123" roles="admin,manager"/&gt;
&lt;/tomcat-users&gt;
</code></pre>

<p>Where <code>davidwinter</code> is the username you want to use, and <code>123</code> being the password you desire.</p>

<p>You can then manage your Tomcat applications using this link; <a href="http://localhost:8080/manager/html">http://localhost:8080/manager/html</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidwinter.me.uk/articles/2006/02/20/tomcat-on-mac-os-x-tiger/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
