Quick Links to:
Download and Install Tomcat 7
If you encounter any broken links, go to the Apache Tomcat web site and select the Tomcat version for the DOWNLOAD section.
- Go to the Apache Apache Tomcat download site. Scroll down until you reach the 7.0.29 section. Under Binary Distributions Core:, select the format for your OS and save the downloaded file to your workstation.
For older versions of Tomcat
If you are looking for an archieve version of Tomcat, go to the Apache Apache Tomcat download site. Scroll down until you reach the Quick Navigation section and click on Archives. Select the version of Tomcat the you want, then click on bin and select the Tomcat format for your OS and save the downloaded file to your workstation. - Unzip/untar the binaries to a new folder (e.g. /tomcat/7.0.9).
- Create an environment variable CATALINA_HOME which contains the path to your Tomcat installation. For example: CATALINA_HOME=/tomcat/7.0.9/
Download and Install Tomcat 7 is now complete
Configure Tomcat 7
- Configure tomcat-users.xml
Open ${CATALINA_HOME}/conf/tomcat-users.xml with a text editor. Create the following 2 uses:• The script user will be used to deploy your application to the Tomcat server.<user username="script" password="XXXXXXXX" roles="manager-script,admin"/> <user username="gui" password="YYYYYYYY" roles="manager-gui,admin"/>
• The gui user will be used to access the Tomcat Manager.
Be sure to change the passwords to passwords of your choice.
When you are satisified that everything is correct, save your changes. - Install the ojdbc14-10.2.0.5.jar
Install the ojdbc14-10.2.0.5.jar in either the ${CATALINA_HOME}/lib or the ${CATALINA_HOME}/common/lib directory. The ojdbc14-10.2.0.5.jar has to go into only one directory. If you do not have the ojdbc14-10.2.0.5.jar, you can download the ojdbc14-10.2.0.5.jar now and save it to your workstation. - Configure context.xml
Open ${CATALINA_HOME}/conf/context.xml with a text editor.- For non-Windows systems, change the <context> tag to the following:
For Windows systems, change the <context> tag to the following"
<Context crossContext="true" useHttpOnly="false">
<Context antiResourceLocking="true" crossContext="true" useHttpOnly="false">
If true, Tomcat will prevent any file locking. This will significantly impact startup time of applications, but allows full webapp hot deploy and undeploy on platforms or configurations where file locking can occur. If not specified, the default value is false.
antiJARLocking is a subset of antiResourceLocking and therefore, to prevent duplicate work and possible issues, only one of these attributes should be set to true at any one time.
Please note that setting this to true has some side effects, including the disabling of JSP reloading in a running server: see Bugzilla 37668.
Please note that setting this flag to true in applications that are outside the appBase for the Host (the webapps directory by default) will cause the application to be deleted on Tomcat shutdown. You probably don't want to do this, so think twice before setting antiResourceLocking=true on a webapp that's outside the appBase for its Host.
- add the following anywhere beteen the <context> and </context> tags:
If your project's JNDI name is something other than MitsisDS, then you must change MitsisDS in the above to your project's JNDI name. If you don't know what JNDI name to use, your team leader can get it for you.
<Resource name="jdbc/MitsisDs" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@//earth-vault-2.mit.edu:1523/sundev2" username="XXXXXXXX" password="YYYYYYYY" maxActive="20" maxIdle="10" maxWait="-1" removeAbandoned="true" removeAbandonedTimeout="30" logAbandoned="true" />
Be sure to change the username and password.
When you are satisified that everything is correct, save the changes.
- For non-Windows systems, change the <context> tag to the following:
- Test the Tomcat installation
- Open a cmd window, cd to ${CATALINA_HOME}/bin and start the tomcat server.
- Open a browse and go to the URL: http://localhost:8080/manager/html
.
- When prompted for the username and password, use gui for the user name and enter the password that you choose in Step 1 above.
If everything was done correctly, you will have the following page displayed: