CentOSx64 configure the Java Web Server Runtime Environment (Tomcat7 + JDK7)

Source: Internet
Author: User

CentOSx64 configure the Java Web Server Runtime Environment (Tomcat7 + JDK7)

CentOSx64 configure the Java Web Server Runtime Environment (Tomcat7 + JDK7)

1. Install JDK 7

First download jdk-7u51-linux-x64.rpm on Oracle Official Website

# Install JDK 7

Rpm-ivh jdk-7u51-linux-x64.rpm

# Configure jdk Environment Variables

Vim/etc/profile

# Find the export PATH in the profile file and insert the following code before it

# Configure JAVA_HOME

JAVA_HOME = "/usr/java/default"

CLASS_PATH = "$ JAVA_HOME/lib: $ JAVA_HOME/jre/lib"

# Add JAVA to the environment variable PATH

PATH = ".: $ PATH: $ JAVA_HOME/bin"

# Set the main directory of tomcat

CATALINA_HOME = "/usr/local/tomcat7 ″

# Set JAVA_HOME and CATALINA_HOME as Environment Variables

ExportJAVA_HOME CATALINA_HOME

2. install Tomcat 7

Download apache-tomcat-7.0.53.tar.gz from apache.

# Decompress

Tarzxvf apache-tomcat-7.0.53.tar.gz

# Move to the corresponding directory and rename it to tomcat

Mvapache-tomcat-7.0.53/usr/local/tomcat7

# Edit the tomcat server configuration file, find appBase = "webapps", and modify the appBase value to your web page root directory.

Vim/usr/local/tomcat7/conf/server. xml

So, tomcat installation is complete. However, you need to assign a special user to tomcat, because if you run tomcat as root, tomcat has the system permission. Therefore, add a user tomcat that runs the service independently, and set the login to nologin to prevent the user from using the root permission to bring security risks to the system:

Useradd-d/usr/local/tomcat-s/usr/sbin/nologin tomcat

Chown-R tomcat: tomcat/usr/local/tomcat7

# Set boot start:

Vim/etc/rc. d/rc. local

# Add a line on the line of touch

/Usr/local/tomcat7/bin/startup. sh

After setting, if you are prompted that JAVA_HOME is not set, restart the VPS.

Install JDK + Tomcat in RedHat Linux 5.5 and deploy Java Projects

Tomcat authoritative guide (second edition) (Chinese/English hd pdf + bookmarks)

Tomcat Security Configuration and Performance Optimization

How to Use Xshell to view Tomcat real-time logs with Chinese garbled characters in Linux

Install JDK and Tomcat in CentOS 64-bit and set the Tomcat Startup Procedure

Install Tomcat in CentOS 6.5

Tomcat details: click here
Tomcat: click here

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.