Installing and configuring JDK and Tomcat under Linux (Starter Edition)

Source: Internet
Author: User
Tags gz file

JDK path:/usr/java/jdk1.6.0_25
Tomcat path:/usr/local/apache-tomcat

1. Download jdk6.0 (select ". Rpm.bin" End, 6u25 version)

Http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase6-419409.html

Xiao Kee:
In the 32-bit CentOS6.3, download the latest version of the JDK (Jdk-6u43-linux-i586-rpm.bin), when installed error,
Change to a lower version of (Jdk-6u41-linux-i586-rpm.bin) the installation is successful!

2. Download the tomcat6.0 (choose Binary Distributions------and Core-to-tar.gz (PGP, MD5) version)

http://tomcat.apache.org/download-60.cgi

3. Install the JDK and enter it in the terminal window

# chmod 777 Jdk-6u25-linux-i586-rpm.bin
# ./jdk-6u25-linux-i586-rpm.bin
# Follow the prompts to complete, the default installation path should be /usr/java/jdk1.6.0_25

4. Configuring the JDK

# vim/etc/profile

Add at Tail:

Export java_home=/usr/java/jdk1.6.0_25
Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH
Export classpath=.: $JAVA _home/lib: $JAVA _home/jre/lib: $CLASSPATH

Save and execute the command:

# Source/etc/profile

To test the installed Java:

# Java-version

appears as shown below.


5. Install Tomcat

Upload the downloaded apache-tomcat-6.0.36.tar.gz file to the server's /usr/local/src

# Tar apache-tomcat-6.0.36.tar.gz
# MV apache-tomcat-6.0.36 Usr/local/apache-tomcat
# Vim/etc/profile

Add at the end of the file:

Export Tomcat_home=/usr/local/apache-tomcat

Save execution:

# Source/etc/profile

6, configure the firewall, open 8080 port

Vim/etc/sysconfig/iptables

#添加如下规则到22 Ports under this rule, you can

-A input-m state--state new-m tcp-p TCP--dport 8080-j ACCEPT

#重启防火墙

/etc/init.d/iptables Restart  # or  service iptables restart

7. Start Tomcat

# cd/usr/local/apache-tomcat/bin/
# chmod 777 *.sh

# bash catalina.sh start
Or
#./start.sh (Recommended use, more concise)

Test:

#查看是否有Tomcat 8080 Ports

NETSTAT-NTLP | grep 8080

You can also enter the server's ip:8080 directly on the client, such as: "http://192.168.137.98:8080"


Can directly to my "Baidu network Disk" to download the above software: Enter the download page

Extended reading:

What is the command of source in Linux?

Resolves a host that cannot access a virtual machine site in CentOS | Update the CentOS firewall settings to turn on 80 port access

Installing and configuring JDK and Tomcat under Linux (Starter Edition)

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.