DBA Hub

📋Steps in this guide1/6

Apache Tomcat 7 Installation on Windows

A guide to installation of Apache Tomcat 7 on Windows.

oracle miscconfigurationintermediate
by OracleDba
13 views
1

Downloads

The Java 1.7 JRE and the binary distribution of Tomcat 7 for Windows is available from the links below. - Java 1.7 JRE - Tomcat 7 Downloads
2

Installation

Install the Java 1.7 JRE as directed by the Web page linked above. You can use the default options for everything, but you may want to uncheck the installation of the browser toolbar. Unzip the Tomcat 7 software into an appropriate location. In this case I unzipped it into the "D:\apache-tomcat-7.0.33" directory. This directory is known as the CATALINA_HOME. Create a file called "D:\apache-tomcat-7.0.33\bin\setenv.bat" with the following contents, adjusted to your installation locations. You can now start and stop Tomcat using the following scripts. The default page is visible on port 8080, so on the server itself you can access it using this URL "http://localhost:8080". Remember to unblock the port on the firewall if you want to access the site from other servers on the network.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
set "JRE_HOME=%ProgramFiles%\Java\jre7"
set "CATALINA_HOME=D:\apache-tomcat-7.0.33"
exit /b 0

%CATALINA_HOME%\bin\startup.bat
%CATALINA_HOME%\bin\shutdown.bat
3

Running Tomcat as a Service

Running Tomcat as a service is very simple. From the command prompt, change directory to the "%CATALINA_HOME%\bin\" directory and run the following command. If you want you can set the environment variables before calling the command, but for a single installation of Tomcat, this is not necessary. The service can now be started and stopped from the Service dialog, or the command line.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
service.bat install

set "JRE_HOME=%ProgramFiles%\Java\jre7"
set "CATALINA_HOME=D:\apache-tomcat-7.0.33"
service.bat install

C:\> net start "Apache Tomcat 7"
C:\> net stop "Apache Tomcat 7"
4

Enabling HTML Management Access

Edit the "%CATALINA_HOME%\conf\tomcat-users.xml" file, adding a new role and user with admin privileges. Restart Tomcat for the configuration to take effect. The management application is now available from the "http://localhost:8080/manager/html" URL.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
<role rolename="manager-gui"/>
<user name="tomcat" password="password" roles="manager-gui" />

%CATALINA_HOME%\bin\shutdown.bat
%CATALINA_HOME%\bin\startup.bat

Or

C:\> net start "Apache Tomcat 7"
C:\> net stop "Apache Tomcat 7"
5

Configuration Files

The main locations of configuration and log information are shown below.

Code/Command (click line numbers to comment):

1
2
3
4
Release Notes        : %CATALINA_HOME%
Bin Directory        : %CATALINA_HOME%\bin
Webapps              : %CATALINA_HOME%\webapps
Logs                 : %CATALINA_HOME%\logs
6

Deploying Applications

You can get a sample application WAR file to test with from " http://tomcat.apache.org/tomcat-7.0-doc/appdev/sample/ ". If this is a redeployment, delete the existing deployment from the "%CATALINA_HOME%\webapps" directory. Place the "sample.war" file in the "%CATALINA_HOME%\webapps" directory and Tomcat with automatically deploy it. You will see a "sample" directory appear. You don't need to stop and start Tomcat for this to work, but you can if you want. For more information see: - Apache Tomcat - Windows service HOW-TO - Linux HTTP and FTP Server Configuration (RHCSA) - Linux HTTP Server Configuration (RHCE) - Apache : Reverse Proxy Configuration Hope this helps. Regards Tim...

Comments (0)

Please to add comments

No comments yet. Be the first to comment!