Reahat5.5 installing JDK, Tomcat, and deploying Java projects

Source: Internet
Author: User


1 Download and install the JDK virtual machine installed Redhat5.5 64-bit Enterprise Edition,

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

Download to this version of the JDK online, or click here to download (Access password 375a)

Upload to the Linux system as root and give it permission to execute

# mkdir/usr/java# cd/usr/java# tar-xvzf jdk-7u75-linux-x64.tar.gz # mv jdk1.7.0_75/jdk7# ls-ltotal 139056drwxr-xr-x 8 UUCP  143      4096 Dec 09:04 jdk7-rw-r--r--1 root root 142245547 Feb  9 21:17 jdk-7u75-linux-x64.tar.gz# Vi/et C/profilejava_home=/usr/java/jdk7classpath=.: $JAVA _home/lib/tools.jar: $JAVA _home/lib/dt.jar: $CLASSPATHPATH =$ Java_home/bin: $PATHexport java_home CLASSPATH path[[email protected] java]# source  /etc/profile[[email protected] java]# Echo $JAVA _home/usr/java/jdk7# java-versionjava 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)


2 Download and install Tomcat

Download apache-tomcat-7.0.59.tar.gz online or click here to download (Access password 285a)

# TAR-XZVF apache-tomcat-7.0.59.tar.gz # mv apache-tomcat-7.0.59/usr/java/tomcat7# cd/usr/java/ls-ltotal 139060drwxr- Xr-x 8 UUCP  143      4096 Dec 09:04 jdk7-rw-r--r--1 root root 142245547 Feb  9 21:17 jdk-7u75-linux-x64.tar.gzdr Wxr-xr-x 9 root root      4096 Feb  9 22:02 tomcat7# vi/etc/profiletomcat_home= '/usr/java/tomcat7 ' path= $PATH: $ Tomcat_home/bin export tomcat_home  path# source/etc/profile# echo $TOMCAT _home/usr/java/tomcat7


Start

# startup.shusing Catalina_base:   /usr/java/tomcat7using catalina_home:   /usr/java/tomcat7using CATALINA_ TMPDIR:/usr/java/tomcat7/tempusing jre_home:        /usr/java/jdk7using CLASSPATH:       /usr/java/tomcat7/bin/ Bootstrap.jar:/usr/java/tomcat7/bin/tomcat-juli.jartomcat started.

Shut down

# shutdown.sh


Access

http://localhost:8080/


accessing outside the virtual machine

http://192.168.10.40:8080/

192.168.10.40 for the IP of the virtual machine Linux system

If it does not open externally, this indicates a problem with the network, can be from IP resolution is correct, the firewall is closed, 8080 port is open several aspects check.


3. Deploying Java Projects

Package Java projects into *.war or copy all webcontent content into a directory, such as Test.war, upload to Linux


# MV Test.war/usr/java/tomcat7/webapps/

Access path

http://192.168.10.40:8080/test/


4. Summary

The installation of the JDK and Tomcat on Linux is a copy of the installation files to the Linux system, and the Tomcat environment variable configuration is not required, just for ease of use. The deployment of Java projects is no different on Linux than on Windows.









Reahat5.5 installing JDK, Tomcat, and deploying Java projects

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.