Linux under tomcat6.0 and JDK installation

Source: Internet
Author: User

Linux under tomcat6.0 and JDK installation

The steps are as follows:

1. Upload apache-tomcat-6.0.37.tar.gz and Jdk-6u13-linux-i586.bin to/usr/local

Add executable permissions to these two files

# chmod +x apache-tomcat-6.0.37.tar.gz  jdk-6u13-linux-i586.bin

2. Install Tomcat by executing the following command:

#cd/usr/local#tar zxvf Apache-tomcat-6.0.37.tar.gz

Rename apache-tomcat-6.0.37.tar.gz to Tomcat after the decompression is complete

# MV Apache-tomcat-6.0.37.tar.gz Tomcat (note the way this is renamed)

3. Execute the following command to install the JDK

#./jdk-6u13-linux-i586.bin

4. Configure Environment variables:
Edit the profile file under/etc, plus the following:

Java_home= "/usr/local/jdk1.6.0_13"

Class_path= "$JAVA _home/lib: $JAVA _home/jre/lib"

Path= ".: $PATH: $JAVA _home/bin"

Catalina_home= "/usr/local/tomcat"

Export Java_home Catalina_home

When you are finished editing, execute the following command to make it effective immediately:

#source/etc/profile

5. Start Tomcat

#  Sh/usr/local/tomcat/startup.sh

Enter http://localhost:8080, if you see the cat's page that Tomcat and JDK installed successfully

6. Turn off Tomcat

#  Sh/usr/local/tomcat/shurdown.sh

7. Restart the Tomcat script

#vim Restarttomcat.shsh   /usr/local/tomcat//usr/local/tomcat/startup.sh

After saving,

Add Execute Permission:

chmod +x  restarttomcat.sh

Then execute the script to restart Tomcat

8. Deploying the project in Tomcat is fully consistent with Windows,

But Linux is used to putting projects under the/var/www directory.

9. Configure Tomcat to boot from

The simplest method:

#vi/etc/rc.local

In the last line add:

Export java_home= "/usr/local/jdk1.6.0_13"/path/bin/startup.sh of your Tomcat
Introduction of Tmcat Record

Tomcat directory structure
    bin    //Command script file for Tomcat
    conf    // Various configuration files for the Tomcat server, most notably Server.xml
    lib    //store Tomcat Server support jar package
    Logs    //storing log files
    temp    //storing temporary files
    WebApps//web the directory in which the application resides, Directory of external access to Web resources
    work    //TOMCAT working directory

Directory structure for Web Apps
WebApp--The directory where the Web application resides
|---html, JSP, CSS, JS files, etc.-these files are generally in the root directory of the Web application, the files under the root directory can be directly accessed by the outside world.
|---web-inf directory-java classes, JAR packages, Web configuration files exist in this directory, the outside world is not directly accessible, the WEB server is responsible for the call.
|---Classes Directory--Java class
|---lib directory--the jar package required for Java classes to run
|---web. xml file--configuration file

Linux under tomcat6.0 and JDK installation

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.