!!Apache Tomcat Deployment on Ubuntu or Debian goto [Tomcat]

----
!Another Debian Setup Method

As the Debian way of managing Linux gets more attention I'd like to
see a more recent version of the Debian package, e.g. the nightly build
in ''unstable'' configuration.

I have installed Tomcat by "apt-get install tomcat5.5".
This led to a very conservative configuration in terms of security.
I had to perform 4 changes in order to get JSPWiki running:

__1. create a directory /p, change the owner to "tomcat55"__

__2. change in /etc/init.d/tomcat5.5__

{{{
from >TOMCAT5_SECURITY=yes<

to   >TOMCAT5_SECURITY=no<
}}}

__3. change in /etc/init.d/tomcat5.5__

{{{
from >find "$CATALINA_BASE"/temp/ -mindepth 1 -exec rm -f {} +<

to   >find "$CATALINA_BASE"/temp/ -mindepth 1 -exec rm -fr {} +<
}}}

__4. [change Tomcat to UTF-8 | TomcatAndUTF8]__

Also if you go for __container managed authentication__ the explenation in [Checklist For Container Managed Authentication] has to be adapted as follows:

*do not change ''catalina.policy'', instead drop ''jspwiki.policy'' into the folder ''/etc/tomcat5.5/policy.d/''
**it gets copied to catalina.policy at Tomcat startup
*you may omit the setting of ''CATALINA_OPTS''

!Explanation:

!! 1. The default page directory
The "/" root directory is by default not accessable to user tomcat55
while dropping the downloaded JSPWiki.war file tries to create
/p/web/www-data/jspwiki.
Alternatively you may start JSPWiki in tomcat, ignoring the error that
tomcat connot start it.
This will extract the .war file giving you access to change
WEB-DE/jspwiki.properties.
BTW: I would recommend to fallback creating the default where
java.io.tmpdir is pointing to.

!! 2. Java security
Using the Java security manager would hinder JSPWiki from start
leading to some security exceptions.
BTW: If I do have the time I will investigate this subject as many
people feel afraid these days switching off security. Currently I don't.

!! 3. Lucene temp files
Lucene is creating folders in Tomcats temp-dir. If you do not
recursively delete the content from tomcats temp-dir tomcat fails to
restart.
To my opinion this seems to be a debian packaging/installation error.
However, I do not know where to report this bug.

!! 4. [UTF-8 | TomcatAndUTF8] is not the default when installed with ''apt-get install''


--[Rolf Schumacher|mailto:mailinglist@august.de], 06-Oct-2007



----

It turns out that all the way up to Gutsy - because it doesn't deploy a *.war file it stuff up. 

\\
\\Suppose you go
{{{
apt-get install jspwiki
}}}

Then you still need to create:
{{{
/usr/share/tomcat5.5/conf/Catalina/localhost/jspwiki.xml
}}}
with the following contents
{{{
<!--
    Context configuration file for the JSPWiki
-->

<Context path="/jspwiki" docBase="/usr/share/jspwiki"
   debug="0" privileged="true" allowLinking="true">
</Context>

}}}

\\
\\Then do
{{{
/etc/init.d/tomcat5.5 restart
}}}

Before you can really do anything. This is effectively a bug in the Debian/Ubuntu package distribution. 
\\
\\This page is really useful too :[http://roshan18.wordpress.com/2007/11/18/using-servlets-in-ubuntu-gutsy-gibbon/]


--AnonymousCoward, 24-May-2008