Search This Blog

Showing posts with label tomcat7. Show all posts
Showing posts with label tomcat7. Show all posts

Monday, October 22, 2012

Configuring administration on Tomcat 7


In a previous blog (http://opendesignarch.blogspot.ca/2012/10/how-to-install-tomcat-7-on-ubuntu-1204.html), I walked through the steps of installing Tomcat 7 on Ubuntu. In this post, I would like to enable administrator access to allow deployment of webapps or Web Archive (.war files). Lets go through the steps.

When you access the default Tomcat 7 Administration page on http://localhost:8080/manager  or similar, you will see a username password prompt. Cancelling it you will see a screen like below.


As indicated, we need to install tomcat7-admin page to access the manager webapp. As shown in the last step of our previous post, this is done as following...

We will also need to obtain the tomcat7-admin package by entering the following

> sudo apt-get install tomcat7-admin


If we now do a search for all folders in /usr/share prefixed with tomcat we should see the following

tomcat7
tomcat7-admin
tomcat7-root

> ls /usr/share/tomcat*



Also, if we browse the folder /var/lib/tomcat7, we should see the faimilar structure from previous generation Tomcat instances

> ls /var/lib/tomcat*



To configure administration, we need to enable the manager. Clicking on the link for manager in the Tomcat home page (http://localhost:8080/manager), will show the following screen with the steps to be followed.


As indicated, the conf folder is installed under /var/lib/tomcat7. Lets go there and open the tomcat-users.xml file for editing as follows

> cd /var/lib/tomcat7/conf
> ls
> sudo gedit tomcat-users.xml




This should open the file for editing. Add the following lines

<role rolename="manager-gui"/>
<user username="manager" password="manager" roles="manager-gui"/>



Save the file and exit

Next, restart the tomcat7 service from the command line as follows.

> sudo /etc/init.d/tomcat7 restart

The service should stop and restart.


Next access the page http://localhost:8080/manager

You will see a prompt to enter the username and password for the manager. Go ahead and enter the username/ password we just created. In my case it was manager/ manager.


Voila, we can see the Tomcat administration screen as shown below.


There you go!

Sunday, October 21, 2012

Download and Install Tomcat 7 on Ubuntu 12.04


In the blog, we will see how to install Tomcat 7 on Ubuntu 12.04. This follows the following steps

  1. Check you JRE version
  2. Install Tomcat Server

First step is easy. First check that you have the right version of Java runtime installed by typing

> java -version







On my machine, it seems I have the latest java version, that comes pre-installed with Ubuntu 12.04.


In case, you have multiple versions of Java and the version displayed is not the one you want, you can switch between versions easily. Just follow the steps on my blog post.

So, lets go ahead and install Tomcat 7. Installing it is easy.


The system prompts to download Tomcat 7 and install it. Go ahead and say Yes.


Now, the installation will continue and download and install the components.


The installation, downloads and sets up tomcat in /usr/share/tomcat7 location.

It also sets up the daemon process and starts it up.

Open up a browser and access http://localhost:8080/

You should see a page as following....


We will also need to obtain the tomcat7-admin package by entering the following

> sudo apt-get install tomcat7-admin


Now that Tomcat 7 is setup, we can set up additional components on top of it.

In my next blog, I show how to install the admin and manager components on top of Tomcat 7.

http://opendesignarch.blogspot.com/2012/10/configuring-administration-on-tomcat-7.html

Good luck.