The following uses the Linux CentOS system
First, the installation of the JDK
1. Download jdk-8u111-linux-x64.tar.gz
2. Unzip the file and copy the extracted files to the/usr/local/jdk1.7 directory.
Here the jdk1.7 directory is the content of my extracted files.
3. Configure Environment variables
Enter the ETC directory to edit the profile
File contents:
View Code
To add a configuration about the JDK environment variable: Add the following code at the end of the file
Java_home= "/usr/local/jdk1.7" class_path= "$JAVA _home/lib: $JAVA _home/jre/lib" path= ".: $PATH: $JAVA _home/bin"
Export Java_home
4. Test whether the installation is successful
A. Make the changed file take effect immediately; Execute command: source/etc/profile
B. Input command java-version results
second, the installation of Tomcat
1. Download Tomcat apache-tomcat-7.0.70.tar.gz
2. Move the extracted files to/usr/local/tomcat1.7
3. Configure Environment variables
Add the following at the end of the/etc/profile file
Catalina_home= "/usr/local/tomcat1.7" Export catalina_home
4. Test whether Tomcat is installed successfully
A. Make the changed file take effect immediately; Execute command: source/etc/profile
B. Enter the Tomcat bin directory to execute the command./startup.sh
C. Visit 127.0.0.1:8080 to see if the Tomcat home page appears
In general, the environment variables of JDK and Tomcat we will write together at the end of the/etc/profile file, add the following:
Java_home= "/usr/local/jdk1.7" class_path= "$JAVA _home/lib: $JAVA _home/jre/lib" path= ".: $PATH: $JAVA _home/bin" Catalina_home= "/usr/local/tomcat1.7" Export Java_home catalina_home
Three, open port
Centos 7 uses FIREWALLD instead of the original iptables. The following records how to open a Linux port using FIREWALLD:
1. Open Port Execution command: firewall-cmd--zone=public--add-port=80/tcp--permanent command meaning:--zone #作用域--add-port=80/tcp #添加端口 in the format: Port/ Communication protocol--permanent #永久生效 without this parameter restart after 2, restart Firewall command: Firewall-cmd--reload
Iv. Viewing tomact logs
Command:
View Tomcat run log tail-f catalina.out
View logs by keyword search Cat Jeewx-2015-09-20.log | grep Verification Code
View fixed time logs Cat Jeewx-2015-09-20.log | grep ' 2015-09-20 18:50:15 '
View the last 50 rows of logs tail-n 50-f catalina.out
Description :
Cat Displays the entire file
Tail tail command to display the end lines of a text file
Head is viewed from the head of the text file, and the head command is used to view the beginning of a text file
More view logs as percentages
Less is similar to more, but less supports flipping through files before and after
Installing the Web development environment under Linux