Install Tomcat in Linux

Source: Internet
Author: User

I. Introduction

Tomcat is a free and open-source Serlvet container. It is a core project of the Jakarta project of the Apache Foundation, developed by Apache, sun, and other companies and individuals. With Sun's participation and support, the latest Servlet and JSP specifications can always be reflected in Tomcat.

Tomcat is a solid and independent web server and servlet container. However, its Web server functions are not as complete as many more sound Web servers, such as Apache Web servers (for example, tomcat does not have many selective modules ). However, Tomcat is a free open-source software, and many experts are committed to its development.

Install j2sdk (Java 2 software development kit), that is, JDK, before installing Tomcat.

Ii. System Environment

System Platform: RHEL 5.4 (system requirements: Linux 2.6 + kernel)

Nginx version: nginx/1.0.15

MySQL version: 5.1.35-log Source Distribution

PHP version: php-5.2.10

3. Install JDK

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 is located, enter the command

# Chmod + 755 jdk-6u1-linux-i586-rpm.bin; // Add execution permissions.

3) execute the command

#./Jdk-6u1-linux-i586-rpm.bin; // generate a file for the jdk-6u1-linux-i586.rpm.

4) execute the command

# Chmod + 755 jdk-6u1-linux-i586.rpm; // Add execution permissions to the jdk-6u1-linux-i586.rpm.

5) execute the command

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

6) The installation interface displays the authorization protocol. Press enter to accept the protocol and install JDK in/usr/Java/jdk1.6.0 _ 01.

7) set the environment variables and add the following content to/etc/profile (you can use VI to edit the profile ):

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) run the Java-version command on the terminal. If JDK version is jdk1.6.0 _ 01, the JDK has been successfully installed.

4. install Tomcat

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

2) # tar-zxvf apache-tomcat-6.0.10.tar.gz; // Extract

3) Copy APACHE-Tomcat-6.0.10 to/usr/local/and rename it Tomcat

[Root @ Linux bin] # cp-r APACHE-Tomcat-6.0.10/usr/local/tomcat;

4) start Tomcat

[Root @ Linux bin] #/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/JDK/jdk1.6.0 _ 17
Using classpath:/usr/local/tomcat/bin/Bootstrap. Jar
[Root @ Linux bin] #

Tomcat has been installed

V. Test

Restart Apache or nginx and use a browser to access http: // server: 8080. The default Tomcat page appears, indicating that the installation is successful.

 

You can access the JSP Example in the following URLProgramTo check whether the JSP program runs normally.

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.