CentOS6.7 Build Tomcat development environment

Source: Internet
Author: User

Introduction: This article mainly introduces the CentOS6.7 (also applies in other versions) environment installs Tomcat, constructs the Java Background development environment.
Installing JDK Download

can use wget directly in the VPS download:

Wget-o jdk-8u91-linux-x64.rpm http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm? Authparam=1462113460_69041470e8ae80a6e6408f08c5aeec72

You can also use ARIA2C to download directly:

ARIA2C http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.rpm? Authparam=1462113460_69041470e8ae80a6e6408f08c5aeec72
installation

After downloading, perform RPM-IVH jdk-8u91-linux-x64.rpm installation, after installation which Java View Java installation path:/usr/bin/java, execute: Java-version Verify that the installation is correct. Vi/etc/profile Add the following at the end of the file:

Export java_home=/usr/java/jdk1.8.0_91
export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH
Export Classpath= $JAVA _home/lib: $JAVA _home/jre/lib: $CLASSPATH
Download Install Tomcat

Then download Tomcat,wget http://mirror.olnevhost.net/pub/apache/tomcat/tomcat-8/v8.0.33/bin/apache-tomcat-8.0.33.tar.gz, Our choice is the official website binary distributions under the core of tar.gz (PGP, MD5, SHA1).

Create a new directory tomcat in the/usr/local directory, and then extract the downloaded compressed packets to/usr/local/tomcat so that the Tomcat installation process is OK. Start Tomcat

Execute in the/usr/local/tomcat/bin directory./startup.sh, you can see the following information:

Using catalina_base:   /usr/local/tomcat
using catalina_home:   /usr/local/tomcat
using Catalina_ Tmpdir:/usr/local/tomcat/temp
using jre_home:        /usr/java/jdk1.8.0_91
using CLASSPATH:       /usr/local/ Tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.

Input IP address in the browser: http://**.**.**.**:8080 to see the cute Tom Cat said Tomcat set up OK.
Note: There are no environment variables configured for Tomcat! a little bit of processing

Every time you go down to the/usr/local/tomcat directory to perform startup and shutdown is inconvenient, you can execute the following command:

Ln-s/usr/local/tomcat/bin/shutdown.sh/usr/local/bin/shutdown.sh
ln-s/usr/local/tomcat/bin/startup.sh/usr/ local/bin/startup.sh

This allows startup.sh and shutdown.sh to be executed anywhere. Set Manager-gui

VI tomcat-users.xml, remove the comments at the beginning of <role> and replace them with the following:

<role rolename= "Manager-gui"/> <user username= "Tomcat" password= "Tomcat" roles= "Manager-gui"/>

You can then click on the Manager app on the home page of Tomcat, but there is no egg to use. optimize turn off

New Tomcat File:

#!/bin/bash tomcat=/usr/local/tomcat/bin case "in
start"
sudo sh ${tomcat}/startup.sh
;;
stop)
sudo sh ${tomcat}/shutdown.sh
;;
restart)
sudo sh ${tomcat}/shutdown.sh
sudo sh ${tomcat}/startup.sh
;;
*)
echo "Usage:start|stop|restart"
;;
Esac
Exit 0

Add executable permissions, and then copy to/usr/local/bin

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.