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