Install JDK and Tomcat in CentOS5.5

Source: Internet
Author: User

1. Check whether the built-in JDK of CentOS is installed. If it has been installed and uninstalled

# Rpm-qa | grep jdk

# Rpm-qa | grep gcj

# Yum-y remove java-*-gcj-comat

2. Install JDK

Download jdk-6u18-linux-i586.bin or jdk-6u18-linux-i586-rpm.bin, this installation uses jdk-6u18-linux-i586.bin

# Mkdir/usr/local/java

# Cd. usr/local/java

# Chmod + x jdk-6u18-linux-i586.bin

#./Jdk-6u18-linux-i586.bin

Select YES

3. Configure Environment Variables

# Vi/etc/profile

Add the following lines at the end

Export JAVA_HOME =/usr/local/java/jdk1.6.0 _ 18
Export CLASSPATH =.: $ JAVA_HOME/jre/lib/rt. jar: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ JAVA_HOME/bin

4. # reboot

5. Check

[Root @ nagios conf] # echo $ JAVA_HOME
/Usr/local/java/jdk1.6.0 _ 18

[Root @ nagios conf] # echo $ PATH
/Usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin: /usr/bin:/usr/local/java/jdk1.6.0 _ 18/bin:/root/bin

[Root @ nagios conf] # echo $ CLASSPATH
. :/Usr/local/java/jdk1.6.0 _ 18/jre/lib/rt. jar:/usr/local/java/jdk1.6.0 _ 18/lib/dt. jar:/usr/local/java/jdk1.6.0 _ 18/lib/tools. jar

[Root @ nagios conf] # java-version
Java version "1.6.0 _ 18"
Java (TM) SE Runtime Environment (build 1.6.0 _ 18-b07)
Java HotSpot (TM) Client VM (build 16.0-b13, mixed mode, sharing)

6. Download tomcat

# Tar-zxvf apache-tomcat-6.0.18.tar.gz

# Mv apache-tomcat-6.0.18/usr/local/tomcat

Start tomcat

[Root @ nagios conf] #/usr/local/tomcat/bin/startup. sh
Using CATALINA_BASE:/usr/local/tomcat
Using CATALINA_HOME:/usr/local/tomcat
Using CATALINA_TMPDIR:/usr/local/tomcat/temp
Using JRE_HOME:/usr/local/java/jdk1.6.0 _ 18

Access http: // localhost: 8080 by default. The default page is displayed, indicating that the installation is successful.

Register your own project and put it in/usr/local/tomcat/webapps

Put sms. war in/usr/local/tomcat/webapps

Modify the default port in/usr/localtomcat/conf/server. xml.

Disable tomcat

[Root @ nagios conf] #/usr/local/tomcat/bin/shutdown. sh
Using CATALINA_BASE:/usr/local/tomcat
Using CATALINA_HOME:/usr/local/tomcat
Using CATALINA_TMPDIR:/usr/local/tomcat/temp
Using JRE_HOME:/usr/local/java/jdk1.6.0 _ 18

# Vi/etc/rc. d/rc. local

JAVA_HOME =/usr/local/java/jdk1.6.0 _ 18

Export JAVA_HOME

/Usr/local/tomcat/bin/shutdown. sh boot

 

My SMS sending page sends SMS messages for subsequent nagios monitoring calls

From: ppzlyg's column

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.