9/05/2014

Building and installing Apache Tomcat 7.0 from sources (no sudo needed)

You will need ant though. If you have a package manager and the appropriate rights it's super easy, either "apt-get install ant" on Ubuntu or "portmaster devel/apache-ant" on FreeBSD - or download and put ant to ~/tools. You will also need to update your PATH so that ant can be found.
cd ~/tools
svn co http://svn.apache.org/repos/asf/tomcat/tc7.0.x/trunk ~/tools/apache-tomcat-7-sources
cd ~/tools/apache-tomcat-7-sources
ant -Dbase.path=~/tools/apache-tomcat-7-sources/base download-compile
ant -Dbase.path=~/tools/apache-tomcat-7-sources/base deploy
mkdir -p ~/tools/apache-tomcat-7
mv ~/tools/apache-tomcat-7-sources/output/build/* ~/tools/apache-tomcat-7/
ln -s ~/tools/apache-tomcat-7 ~/tools/tomcat
That concludes the installation. In case you need some JDBC drivers and alike (unfortunately Tomcat 7 does not manage our dependencies like Karaf), here is a sample:
cd ~/tools/tomcat/lib/
wget http://repo1.maven.org/maven2/org/hsqldb/hsqldb/2.3.2/hsqldb-2.3.2.jar
wget http://repo1.maven.org/maven2/org/postgresql/postgresql/9.3-1102-jdbc41/postgresql-9.3-1102-jdbc41.jar
wget http://repo1.maven.org/maven2/javax/activation/activation/1.1.1/activation-1.1.1.jar
wget http://repo1.maven.org/maven2/javax/mail/mail/1.5.0-b01/mail-1.5.0-b01.jar
You may need to add this to ~/.profile file:
export JAVA_HOME=$HOME/tools/jdk

No comments:

Post a Comment