Tomcat + JDK in a JAVA environment in Linux

Source: Internet
Author: User

Tomcat + JDK in a JAVA environment in Linux


System Environment: CentOS 6.5
JDK: jdk-7u60-linux-x64.tar.gz
Tomcat: apache-tomcat-7.0.54.tar.gz


1: Create an installation directory
# Mkdir/doiido/soft
# Mkdir/doiido/apps
# Mkdir/doiido/server


2: Upload jdk-7u60-linux-x64.tar.gz to/doiido/soft
# Cd/doiido/soft/
# Tar zxvf jdk-7u60-linux-x64.tar.gz
# Mv jdk1.7.0 _ 60 // doiido/server/


3: Set the JDK you just installed to the default JDK.
# Update-alternatives -- install/usr/bin/java/doiido/server/jdk1.7.0 _ 60/bin/java 300
# Update-alternatives -- install/usr/bin/javac/doiido/server/jdk1.7.0 _ 60/bin/javac 300


4. Set Environment Variables
# Vi/etc/profile
# Add the following parameters at the end
Java_HOME =/doiido/server/jdk1.7.0 _ 60
PATH = $ Java_HOME/bin: $ PATH
CLASSPATH =.: $ Java_HOME/lib/tools. jar: $ Java_HOME/lib/dt. jar
Export Java_HOME PATH CLASSPATH


5. Activate the configuration.
# Source/etc/profile


6: Check the Java version to see if the configuration is appropriate.
# Java-version


7: Upload apache-tomcat-7.0.54.tar.gz to/doiido/soft
# Cd/doiido/soft
# Tar zxvf apache-tomcat-7.0.54.tar.gz
# Mv apache-tomcat-7.0.54/doiido/apps/tomcat7


8: Set tomcat Permissions
# Cd/doiido/apps/tomcat7/bin/
# Chmod 777 *. sh


9: start tomcat
# Sh startup. sh


10: Open firewall ports
#/Sbin/iptables-I INPUT-p tcp -- dport 8080-j ACCEPT
#/Etc/rc. d/init. d/iptables save


11. Set startup.
# Echo "/doiido/apps/tomcat7/bin/startup. sh">/etc/rc. local

Now you can access


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.