<<

Contents

Search

>>

 

Apache Tomcat

 

Apache Tomcat is a free servlet supporting  webserver which can be used also in a local network.

 

The current version can be downloaded under http://tomcat.apache.org/.

 

 

How to Install an Ebus Html Program in Apache Tomcat

 

When a Html program is generated a file <Programmname>.war is created. The file contains all data which needs the webserver.

 

In the Tomcat Web Application Manager (e.g. http://localhost:8080/manager/html) the war file can be deploeyed in the section WAR file to deploy:

 

 

After depoying the war file the program can be started immediately by clicking the command Start or by entering the appropriate address in the browser (e.g. http://localhost:8080/Testprog). This requires that the Ebus-2T-Server is running (see Html program).

 

If the Tomcat Manager does not start the following lines have to be inserted into the file tomcat-users.xml in the subdirectory conf of the Tomcat directory:

 

<role rolename="admin"/>

<role rolename="manager"/>

<user name="" password="" roles="admin,manager"/>

 

 

Install Apache Tomcat under Windows

 

Start the installation program apache-tomcat-6.0.32.exe and follow the instructions.

 

When User Name and Password is to be entered it is recommended to specify admin with the Roles.

Admin is an application for managing users and groups of web applications.

Admin.war is on the Ebus-J-CD in the directory tomcat and can be deployed like any other web application (see above).

 

 

 

Install Apache Tomcat under Linux

 

1. Login as root.

 

2. Create a directory for Tomcat, e.g: mkdir /tomcat

 

3. Copy the tomcat archive in this directory: cp apache-tomcat-6.0.32.tar.gz /tomcat

 

4. Unpack the archive, a subdirectory apache-tomcat-6.0.32 will be created: tar -zxvf apache-tomcat-6.0.32.tar.gz

 

5. If the java runtime is not already installed install it (see below).

 

6. In order for Tomcat to startup and shutdown, you will need to add an environment variable pointing to the Tomcat directory (CATALINA_HOME), and one variable pointing to your Java SDK directory (JAVA_HOME). Insert the following lines inside /etc/profile or /root/.bashrc or /etc/bash.bashrc (depending on the Linux version):

 

export JAVA_HOME=/java/jre1.6.0_17

export CATALINA_HOME=/tomcat

 

7. Restart the computer or logoff and logon as root again.

 

8. Check whether the environment variables are set: echo $CATALINA_HOME

 

9. Set execution rights: chmod a+x $CATALINA_HOME/bin/*.sh

 

You can start Tomcat with $CATALINA_HOME/bin/startup.sh and shitdown with $CATALINA_HOME/bin/shutdown.sh

 

 

Install Java Runtime under Linux

 

1. Login as root.

 

2. Create a directory for Java, e.g: mkdir /java

 

3. Copy the java runtime in this directory: cp jre-6u17-linux-i586.bin /java

 

4. Start the installation program, a subdirectory jre1.6.0_17 will be created: ./jre-6u17-linux-i586.bin

 

6. Add the bin directory to the environment variable PATH. Insert the following line inside /etc/profile or /root/.bashrc or /etc/bash.bashrc (depending on the Linux version)::

 

PATH=/java/ jre1.6.0_17/bin:$PATH

 

 

Specify username and password

 

When a web application has to be protected by username and passwort the Tomcat Web Server Administration Tool can be used.

Admin.war is on the Ebus-J-CD in the directory tomcat and can be deployed like any other web application (see above).

 

 

For each program (e.g. Prog1) a Role has to be created. (Attention: Consider capitalization: First letter uppercase, the following letters lowercase !)

The allowed users have to be assigned to the specific role.

 

The entries for username and password can also be added manually to the files web.xml and tomcat-users.xml. These files are in the directory conf of the Apache Tomcat, e.g. this is C:\Apache\conf when Apache Tomcat is installed in C:\Apache.

 

Example: The Html Program Prog1 has to be protected by username Smith and password rhino.

 

In web.xml additional sections <security-constraint> , <security-role> and <login-confige> must be added:

 

<security-constraint>

    <web-resource-collection>

       <web-resource-name>web</web-resource-name>

       <url-pattern>/Prog1</url-pattern>

    </web-resource-collection>

    <auth-constraint>

       <role-name>Prog1</role-name>

    </auth-constraint>

</security-constraint>

 

<security-role>

   <role-name>Prog1</role-name>

</security-role>

 

<login-config>

   <auth-method>BASIC</auth-method>

   <realm-name>Prog1</realm-name>

</login-config>

 

In tomcat-users.xml the following lines must be added in the section <tomcat-users>:

 

<role rolename="Prog1"/>

<user username="Smith" password="rhino" roles="Prog1"/>