Linux under Jdk+tomcat installation process

Source: Internet
Author: User

1. The steps to install the JDK are as follows:

The installation steps of the online check are as follows:

1) Download j2sdk, such as Jdk-6u1-linux-i586-rpm.bin

2) in the terminal to the directory where the Jdk-6u1-linux-i586-rpm.bin, enter the command

#chmod +x jdk-6u1-linux-i586-rpm.bin;//Add permissions to execute.

3) Execute the command

#./jdk-6u1-linux-i586-rpm.bin;//generates the jdk-6u1-linux-i586.rpm file.

4) Execute the command

#chmod +x jdk-6u1-linux-i586.rpm;//To add the Execute permission to jdk-6u1-linux-i586.rpm.

5) Execute the command

#rpm –IVH jdk-6u1-linux-i586.rpm;//install JDK.

6) The installation interface will appear the license agreement, press ENTER to accept, the JDK installed in the/usr/java/jdk1.6.0_01.

7) Set the environment variables, add the following in/etc/profile (you can edit profile with VI):

Java_home=/usr/java/jdk1.6.0_01
Classpath= $JAVA _home/lib: $JAVA _home/jre/lib
Path= $PATH: $JAVA _home/bin: $JAVA _home/jre/bin
Export PATH CLASSPATH Java_home

8) The version of the command JAVA–VERSION,JDK executed at the terminal is jdk1.6.0_01, which indicates that the JDK has been successfully installed.

The actual installation, the completion of the 5th step, did not appear 6th step, direct prompt:

[Email protected] ~]# cd/usr/local/share/

[Email protected] share]# chmod +x jre-6u45-linux-x64-rpm.bin

[Email protected] share]#./jre-6u45-linux-x64-rpm.bin

[Email protected] share]# chmod +x jre-6u45-linux-amd64.rpm

[Email protected] share]# RPM-IVH jre-6u45-linux-amd64.rpm

Preparing ... ########################################### [100%]

Package jre-1.6.0_45-fcs.x86_64 is already installed

The problem here is that you don't know which path the JDK is on, so:

Whereis Java

Instruction:/usr/bin/java

[Email protected] share]# ls-l/usr/bin/java

lrwxrwxrwx 1 root root 3 11:20/usr/bin/java-/usr/java/default/bin/java

[Email protected]140102165018353e25z share]# ls-l/usr/java/default/bin/java

-rwxr-xr-x 1 root root 50794 Mar 2013/usr/java/default/bin/java

This will find the installation path for Java/usr/java/default/bin/java

Then execute 7), configure Java_home What, that is, add the following content in the/etc/profile

Export Java_home=/usr/java/default
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

At this point you can view the Java configuration situation:

[Email protected] ~]# java-version

Java Version "1.6.0_45"

Java (TM) SE Runtime Environment (build 1.6.0_45-b06)

Java HotSpot (TM) 64-bit Server VM (build 20.45-b01, Mixed mode)

[Email protected] ~]# echo $JAVA _home

/usr/java/default

[Email protected] ~]# echo $PATH

/usr/java/default/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin :/usr/bin:/alidata/server/mysql/bin:/alidata/server/nginx/sbin:/alidata/server/php/sbin:/alidata/server/php/ Bin:/root/bin

Everything's fine!

2. Install Tomcat

The installation steps are as follows:

1) Download apache-tomcat-6.0.10.tar.gz

2) #tar-ZXVF apache-tomcat-6.0.10.tar.gz;//Unzip

3) #cp-R apache-tomcat-6.0.10/usr/local/tomcat;//Copy apache-tomcat-6.0.10 to/usr/local/and rename to Tomcat

4) then modify the Server.xml port number and the default app path under Tomcat/conf

5)/usr/local/tomcat/bin/startup.sh;//Start Tomcat

Display Using catalina_base:/usr/local/tomcat

Using Catalina_home:/usr/local/tomcat

Using Catalina_temdir:/usr/local/tomcat/temp

Using Java_home:/usr/java/jdk1.6.0_01

6)/usr/local/tomcat/bin/shutdown.sh;//Stop Tomcat

The tomcat server above has been installed for normal boot, then installed as service boot

Reference http://www.th7.cn/system/lin/201307/41998.shtml

This step I haven't dealt with, the reference process is as follows:

1. Environmental preparedness

GCC autoconf JDK

2. Configure Environment variables

Cd/opt

wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.42/bin/apache-tomcat-7.0.42.tar.gz

Tar zxvf apache-tomcat-7.0.42.tar.gz

Vi/etc/profile

. /etc/profile

3. Compiling jsvc

CD $CATALINA _home/bin
Tar Xvfz commons-daemon-native.tar.gz
CD Commons-daemon-1.0.x-native-src/unix
./configure
Make
CP Jsvc. /.

4. Making Daemon

CP $CATALINA _home/bin/daemon.sh/etc/init.d/tomcat

Vi/etc/init.d/tomcat

1> Setting the Chkconfig configuration

2> setting environment variables for system services


3> Modifying a Tomcat user

After modifying the Tomcat script, you can add system services:

Chkconfig--add Tomcat

Chkconfig Tomcat on

To start Tomcat:

Service Tomcat Start

Linux Jdk+tomcat installation process

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.