RedHatLinux5.5 install JDK + Tomcat and deploy a Java Project

Source: Internet
Author: User
I would like to share with you the steps to install JDK + Tomcat and deploy the Java project in RedHatLinux5.5, hoping to help you. Example: Download jdk of this version online. upload it to the Linux system as a root user and grant it the execution permission # mkdir/usr/java # cd

I would like to share with you the steps for installing JDK + Tomcat in RedHat Linux 5.5 and deploying a Java project.

1. Download and install jdk

Install RedHat Linux 5.5 64-bit Enterprise Edition on a virtual machine,

Take jdk-7u75-linux-x64.tar.gz as an example.

Download jdk of this version from the Internet

Upload the file to Linux as a root user and grant it the execution permission.

# Mkdir/usr/java
# Cd/usr/java
# Tar-xvzf jdk-7u75-linux-x64.tar.gz
# Mv jdk1.7.0 _ 75/jdk7
# Ls-l
Total 139056
Drwxr-xr-x 8 uucp 143 4096 Dec 19 jdk7
-Rw-r -- 1 root 142245547 Feb 9 jdk-7u75-linux-x64.tar.gz

# Vi/etc/profile

JAVA_HOME =/usr/java/jdk7
CLASSPATH =.: $ JAVA_HOME/lib/tools. jar: $ JAVA_HOME/lib/dt. jar: $ CLASSPATH
PATH = $ JAVA_HOME/bin: $ PATH
Export JAVA_HOME CLASSPATH PATH

[Root @ linuxidc java] # source/etc/profile
[Root @ linuxidc java] # echo $ JAVA_HOME
/Usr/java/jdk7


# Java-version
Java version "1.7.0 _ 75"
Java (TM) SE Runtime Environment (build 1.7.0 _ 75-b13)
Java HotSpot (TM) 64-Bit Server VM (build 24.75-b04, mixed mode)

Install JDK 7 (with Clojure download) http://www.linuxidc.com/Linux/2012-10/71557.htm under Ubuntu

Install JDK1.7 http://www.linuxidc.com/Linux/2012-06/62239.htm in Ubuntu 12.04

Ubuntu 14.04 LTS install Oracle JDK 1.8 http://www.linuxidc.com/Linux/2014-11/109216.htm

CentOS6.3 install JDK and environment configuration http://www.linuxidc.com/Linux/2012-09/70780.htm

Ubuntu 14.04 install JDK8 http://www.linuxidc.com/Linux/2014-09/106218.htm

Install JDK graph analysis http://www.linuxidc.com/Linux/2014-09/107291.htm under Ubuntu

2. Download and install tomcat
Download apache-tomcat-7.0.59.tar.gz

# Tar-xzvf apache-tomcat-7.0.59.tar.gz
# Mv apache-tomcat-7.0.59/usr/java/tomcat7
# Cd/usr/java/
Ls-l
Total 139060
Drwxr-xr-x 8 uucp 143 4096 Dec 19 jdk7
-Rw-r -- 1 root 142245547 Feb 9 jdk-7u75-linux-x64.tar.gz
Drwxr-xr-x 9 root 4096 Feb 9 Tomcat 7

# Vi/etc/profile

TOMCAT_HOME = '/usr/java/tomcat7'
PATH = $ PATH: $ TOMCAT_HOME/bin
Export TOMCAT_HOME PATH

# Source/etc/profile
# Echo $ TOMCAT_HOME
/Usr/java/tomcat7

Start

# Startup. sh
Using CATALINA_BASE:/usr/java/tomcat7
Using CATALINA_HOME:/usr/java/tomcat7
Using CATALINA_TMPDIR:/usr/java/tomcat7/temp
Using JRE_HOME:/usr/java/jdk7
Using CLASSPATH:/usr/java/tomcat7/bin/bootstrap. jar:/usr/java/tomcat7/bin/tomcat-juli.jar
Tomcat started.

Close

# Shutdown. sh

Access

Http: // localhost: 8080/

Access outside the VM

Http: // 192.168.10.40: 8080/

192.168.10.40 is the ip address of the Virtual Machine linux system.

If it cannot be opened externally, it indicates a network problem. You can check whether the ip address resolution is correct, whether the firewall is disabled, and whether port 8080 is enabled.

Load Balancing between Apache and multiple Tomcat clusters in LinuxHttp://www.linuxidc.com/Linux/2012-01/51731.htm

Nginx Tomcat Cluster load balancing solution notes http://www.linuxidc.com/Linux/2013-07/86827.htm

Example details Tomcat component installation + Nginx reverse proxy Tomcat + Apache use mod_jk and mod_proxy Reverse Proxy and load balancing http://www.linuxidc.com/Linux/2013-06/85290.htm

Deploy the log server http://www.linuxidc.com/Linux/2014-06/103836.htm using Rsyslog + LogAnalyzer + MySQL in CentOS 6.5

Apache + Tomcat environment setup (JK deployment process) http://www.linuxidc.com/Linux/2012-11/74474.htm

3. Deploy a Java Project

Package the Java project into *. war or copy all content of webContent to a directory, such as test. war, and upload it to linux.

# Mv test. war/usr/java/tomcat7/webapps/

Access path

Http: // 192.168.10.40: 8080/test/

4. Summary

The installation of JDK and Tomcat on Linux copies the installation file to the Linux system. The configuration of Tomcat environment variables is not necessary, but for ease of use. The deployment of Java projects is no different on Linux and Windows.

For more information about RedHat, see RedHat topic page http://www.linuxidc.com/topicnews.aspx? Tid = 10

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-02/113528.htm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.