Install JDK + Tomcat in RedHat Linux 5.5 and deploy Java Projects

Source: Internet
Author: User
Tags nginx reverse proxy

Install JDK + Tomcat in RedHat Linux 5.5 and deploy Java Projects

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 @ bkjia java] # source/etc/profile
[Root @ bkjia 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 In Ubuntu (with Clojure download)

Install JDK 12.04 in Ubuntu

Install Oracle JDK 14.04 on Ubuntu 1.8 LTS

CentOS6.3 install JDK and environment Configuration

Install JDK 8 on Ubuntu 14.04

Install JDK graph analysis in 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 Linux

Nginx Tomcat Cluster load balancing solution notes

Instance details Tomcat component installation + Nginx reverse proxy Tomcat + Apache use mod_jk and mod_proxy Reverse Proxy and load balancing

Deploy a log server using Rsyslog + LogAnalyzer + MySQL in CentOS 6.5

Build an Apache + Tomcat environment (JK deployment process)

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.

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.