Preface
The server environment was often deployed before, but the whole process was not properly sorted, and now it is finally sorted out, hoping to provide a reference for friends who are in need of a web environment, and then leave a record for themselves.
I. Environment and software preparation
Before you build a Web project, you need to deploy the environment that you need.
1, the system selected is the Centos7.2 64-bit
2, the JDK version is jdk-7u71-linux-x64.tar.gz
3, tomcat version is nginx-1.7.6.tar.gz
4, Firewall is iptables
Second, the installation of JDK
1, the JDK decompression, and then modify the directory name
TAR-ZVXF jdk-7u71-linux-x64.tar.gz
After the decompression, modify the directory
MV Jdk1.7.0_71 jdk1.7
2. Configure Environment variables
Vi/etc/profile
Add the following to the back of the file
Export java_home=/data/jdk1.7
Classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin
Save the file and exit, and then execute
Source/etc/profile
Whether the test was successful
Java-version
Third, the installation of Tomcat
1, decompression tomcat, and then modify the directory
TAR-ZVXF apache-tomcat-7.0.55.tar.gz
After the decompression, modify the directory
MV apache-tomcat-7.0.55 TOMCAT7
2. Configure Environment variables
Vi/etc/profile
Add the following:
Export TOMCAT_HOME=/DATA/TOMCAT7
Save and exit, and then execute
Source/etc/profile
3. Start Tomcat
Cd/data/tomcat7
./startup.sh
Iv. Configuration of Firewalls
1. Close Firewall
Service Firewalld Stop
power-on Disable Startup
Systemctl Disable Firewalld.service
2, install iptables, open 80, 8080 ports
Yum Install Iptables-services
Modify configuration file Iptables
Vi/etc/sysconfig/iptables
Add the following content
-A input-p tcp-m State--state new-m TCP--dport 80-j ACCEPT
-A input-p tcp-m State--state new-m TCP--dport 8 080-j ACCEPT
Save exit, open Iptables Service
Service iptables Start
Set startup on
Systemctl Enable Iptables.service