<?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>SlickDev &#187; Mods</title>
	<atom:link href="http://www.slickdev.com/category/mods/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.slickdev.com</link>
	<description>Freelance Web and Software Developer</description>
	<lastBuildDate>Sat, 15 May 2010 02:27:32 +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>Java 5 JDK and Jakarta Tomcat 5.5 in Ubuntu Server Installation</title>
		<link>http://www.slickdev.com/2008/09/13/java-5-jdk-and-jakarta-tomcat-55-in-ubuntu-server-installation/</link>
		<comments>http://www.slickdev.com/2008/09/13/java-5-jdk-and-jakarta-tomcat-55-in-ubuntu-server-installation/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 04:19:33 +0000</pubDate>
		<dc:creator>Chaoz</dc:creator>
				<category><![CDATA[Code Library]]></category>
		<category><![CDATA[Mods]]></category>
		<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.slickdev.com/?p=23</guid>
		<description><![CDATA[These are the steps I took to install Jakarta Tomkat 5.5 in conjunction with Java 2 SDK in Ubuntu server. Login as root, you can also use &#8220;su&#8221; though I prefer to login as root. apt-get install sun-java5-jdk This will install Java 2 SDK (1.5), ubuntu will start downloading packages that are not found in [...]]]></description>
			<content:encoded><![CDATA[<p>These are the steps I took to install Jakarta Tomkat 5.5 in conjunction with Java 2 SDK in Ubuntu server.</p>
<ol>
<li>Login as root, you can also use &#8220;<strong>su</strong>&#8221; though I prefer to login as root.</li>
<li><strong>apt-get install sun-java5-jdk</strong></li>
<ul>
<li>This will install Java 2 SDK  (1.5), ubuntu will start downloading packages that are not found in your system.</li>
</ul>
<li><strong>apt-get install tomcat5.5 tomcat5.5-admin tomcat5.5-webapps</strong></li>
<ul>
<li>Of course jakarta-tomcat 5.5, I&#8217;m using 5.5 since this supports java 1.5</li>
</ul>
<li>Now here&#8217;s the tricky part, location for Java and jakarta-tomcat</li>
<ul>
<li>Java&#8217;s location is in <strong>/usr/lib/jvm/java-1.5.0-sun</strong></li>
<li>Jakarta-Tomcat&#8217;s location is in <strong>/usr/share/tomcat5.5</strong></li>
<ul>
<li>We will need these location for the export configurations to be written in the <strong>.bashrc</strong></li>
</ul>
</ul>
<li>Now, open <strong>.bashrc</strong> in your favorite text editor, I used <strong>vim</strong></li>
<li>At the end of the file add these:<br />
<code><br />
export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun<br />
export CLASSPATH="/usr/share/tomcat5.5/common/lib/jsp-api.jar;/usr/share/tomcat5.5/common/lib/servlet-api.jar"<br />
export CATALINA_HOME=/usr/share/tomcat5.5<br />
</code></li>
<li>Now save the file and exit, then log back in. This is required for the export script to be set.</li>
<li>Before starting the server, the default port the installer set is 8180 instead of the 8080 port that Tomcat uses. To change this, go to <strong>/usr/share/tomcat5.5/conf/</strong> and open the file <strong>server.xml</strong>. Locate the line:<br />
<code><br />
...Connector port="8180" maxHttpHeaderSize="8192"...<br />
</code><br />
and change <strong>8180 </strong>to<strong> 8080</strong>. Save and exit. Now your ready to test the server.</li>
<li>Now try the server if it starts, <strong>/usr/share/tomcat5.5/bin/startup.sh</strong>  You should see  something like this:<br />
<code><br />
Using CATALINA_BASE:   /usr/share/tomcat5.5<br />
Using CATALINA_HOME:   /usr/share/tomcat5.5<br />
Using CATALINA_TMPDIR: /usr/share/tomcat5.5/temp<br />
Using JRE_HOME:       /usr/lib/jvm/java-1.5.0-sun<br />
</code></li>
<li>Shutting down the server is just <strong>/usr/share/tomcat5.5/bin/</strong><strong>shutdown.sh</strong></li>
<li>Now, during installation of tomcat, Ubuntu automatically adds a startup and shutdown script for ubuntu to use as it starts up or shutsdown in <strong>/etc/init.d/</strong> folder. Filename is <strong>tomcat5.5</strong>. As the server finishes starting up, you will notice tomcat isn&#8217;t running at all. One possible problem is that the script didn&#8217;t use the correct path for the java 2 sdk.  You can check the boot log in <strong>/var/log/</strong>. Check if during boot up, tomcat5.5 encountered problems. For the problem stated above, you can fix this by going to <strong>/etc/default/</strong> and edit the <strong>tomcat5.5</strong> file. Locate the line: <strong><br />
</strong><br /><code><strong>#JAVA_HOME=/usr/lib/j2sdk1.4-sun</strong></code></p>
<p>remove the <strong>&#8216;#&#8217;</strong> and change it to&#8230;<br />
<br /><code><strong>JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun</strong></code></p>
<p>or wherever your java directory is.After that, restart the server and see if tomcat was successfully started. <strong><br />
</strong><br /><code><strong>/etc/init.d/tomcat5.5 status</strong></code></li>
</ol>
<p><strong>Edit: Problem encountered:</strong></p>
<ul>
<li><strong>Tomcat does not load in Ubuntu 8.04</strong></li>
</ul>
<ul>
	Found a little problem loading Tomcat 5.5 under Ubuntu 8.04, it either fails or white screen just appears. I don&#8217;t know what happened from 6.04 to 8.04 but once I compared the <em>init.d/tomcat5.5</em> startup script from 6.04 and 8.04, there WERE changes to the scripts. I replaced the new tomcat5.5 script in 8.04 with the old one from 6.04 and the server started properly after a server restart. I don&#8217;t know why but this may have something to do with permissions and I have yet to trace the script.</p>
</ul>
<ul>
<li><strong>java.lang.ClassNotFoundException: org.apache.jasper.tagplugins.jstl.If</strong></li>
</ul>
<ol>
<ul>
<li>The problem here is that the above name is incomplete&#8230; what it should have been is  <strong>org.apache.jasper.tagplugins.jstl.core.*</strong></li>
<li>Now, to fix the problem, locate <span style="color: #000000"><code></span><strong><span style="color: #000000">/var/lib/tomcat5.5/webapps/jsp-examples/WEB-INF/tagPlugins.xml</span></strong></code> and open it with your text editor&#8230; I used <em>vim</em>. Now edit each line of code that has  <em><strong>org.apache.jasper.tagplugins.jstl</strong></em> in it and add &#8220;<strong>.core</strong>&#8221; after <strong>jstl</strong>. What you will see after editing the code will be&#8230;</li>
<p><code></p>
<p>org.apache.taglibs.standard.tag.rt.core.IfTag</p>
<p>org.apache.jasper.tagplugins.jstl.core.If</p>
<p>org.apache.taglibs.standard.tag.common.core.ChooseTag</p>
<p>org.apache.jasper.tagplugins.jstl.core.Choose</p>
<p>org.apache.taglibs.standard.tag.rt.core.WhenTag</p>
<p>org.apache.jasper.tagplugins.jstl.core.When</p>
<p>org.apache.taglibs.standard.tag.common.core.OtherwiseTag</p>
<p>org.apache.jasper.tagplugins.jstl.core.Otherwise</p>
<p>org.apache.taglibs.standard.tag.rt.core.ForEachTag</p>
<p>org.apache.jasper.tagplugins.jstl.core.ForEach</p>
<p></code>
</ul>
</ol>
<ul>
<li><strong>SEVERE: The scratchDir you specified: [folder_path] is unusable. </strong></li>
</ul>
<ul>
<ul>
<li>Sidenote: took me 2 days to figure out why this was happening (X_x)</li>
<li>Based from the Catalina logs, the folders under <em>webapps</em> was not accessible by tomcat5.</li>
<li>Now looking under all processes running ( ps command ), most bootup services were running under root (mysql, apache, etc ) but tomcat5 was not.</li>
<li>If I start tomcat5 when I logged into the console as root, the problem disappears. This lead me to believe this might have been the Tomcat5 user was not given the correct privileges.</li>
<li><strong>Work-around 1:</strong> Elevate Tomcat5 user to root access level.</li>
<li><strong>Work-around 2: </strong>Go to <em><strong>/etc/init.d/ </strong></em>and open <strong>Tomcat5.5</strong> under any text editor ( I used vim ). Locate the line <strong>TOMCAT5_USER=tomcat55</strong> and change it to <strong>TOMCAT5_USER=<em>root</em></strong> . Restart your server or you can also execute the restart command for <em><strong>Tomcat5.5</strong></em> in <strong><em>init.d</em></strong> folder</li>
</ul>
</ul>
<p><span style="color: #000000" />sources:</p>
<ul>
<li><a target="_blank" href="http://wiki.oss-watch.ac.uk/UbuntuDapper/Remaster">Ubuntu/Drapper Remaster</a></li>
<li><a target="_blank" href="http://www.linuxjournal.com/article/4576">linux journal</a></li>
<li><a target="_blank" href="http://doc.gwos.org/index.php/Install_tomcat_5.5">Ubuntu Install Tomcat</a></li>
<li><a target="_blank" href="http://www.netadmintools.com/art340.html">Net Admin Tools</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.slickdev.com/2008/09/13/java-5-jdk-and-jakarta-tomcat-55-in-ubuntu-server-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
