LinTut

How to install Tomcat 8.0.0 RC5 on Ubuntu 12.04/12.10/13.04/13.10

Apache tomcat is a Java based application server released by the Apache Software Foundation. It is a web server and a servlet container for Java web applications.

What’s new in Tomcat 8

Apache Tomcat 8 is aligned with Java EE 7. In addition to supporting updated versions of the Java EE specifications, Tomcat 8 includes a number of improvements compared to Tomcat 7. The notable changes include:

In this tutorial i will show you how to installTomcat 8.0.0 RC5 on Ubuntu 12.04/12.10/13.04/13.10 server. 

Apache Tomcat 8.0.0-RC5 installation

Before you install Tomcat 8.0.0 RC5, you need to install Java.

# sudo apt-get install openjdk-7-jdk

Now, download Apache Tomcat 8.0.0 RC5:

# wget http://apache.osuosl.org/tomcat/tomcat-8/v8.0.0-RC5/bin/apache-tomcat-8.0.0-RC5.tar.gz

Extract and move to /usr/local/ Apache Tomcat package:

# tar -xvf apache-tomcat-8.0.0-RC5.tar.gz
#sudo mv mv apache-tomcat-8.0.0-RC5 /usr/local/

Create tomcat8 file in /etc/init.d/

# sudo vim /etc/init.d/tomcat8

and paste following code:

#!/bin/bash
export CATALINA_HOME=/usr/local/apache-tomcat-8.0.0-RC5
PATH=/sbin:/bin:/usr/sbin:/usr/bin
start() {
 sh $CATALINA_HOME/bin/startup.sh
}
stop() {
 sh $CATALINA_HOME/bin/shutdown.sh
}
case $1 in
  start|stop) $1;;
  restart) stop; start;;
  *) echo "Run as $0 <start|stop|restart>"; exit 1;;
esac
/etc/init.d/tomcat8

This file will create a service named tomcat8. Please change CATALINA_HOME in the code according to your path.
Modify /etc/init.d/tomcat8 file permissions:

# sudo chmod 755 /etc/init.d/tomcat8

Set username and password to manage tomcat and add to:

#sudo vim /usr/local/apache-tomcat-8.0.0-RC5/conf/tomcat-users.xml

and add following line:

role rolename="manager-gui"
role rolename="admin-gui"
user username="rasho" password="password" roles="manager-gui,admin-gui"

Set username and password to manage tomcat


Start tomcat 8 service:
 sudo /etc/init.d/tomcat8 start

and type this command to start service automatically during reboot:

# sudo update-rc.d tomcat8 defaults

Now open http://serverip:8080 in your browser.

Tomcat 8 default page
Tomcat server status page
Tomcat virtual host manager
Exit mobile version