Build a java environment in linux and a java environment in linux
We recommend that you use EXCEL to view
Prepare files
Tomcat web container apache-tomcat-7.0.57.tar
Server-jre-7u76-linux-x64.tar java jdk java Runtime Environment
Putty.exe ssh connection Tool
Pscp.exe ssh upload and download Tool
File Installation File Upload
C: \ pscp.exe-r local file path user @ target ip: target path
Directory Creation
Mkdir/usr/local/java environment directory
Mkdir/usr/local/java/jdk directory
Mkdir/usr/local/java/tomcat directory
Music apache-tomcat-7.0.57.tar.gz/usr/local/java/tomcat/
Music server-jre-7u76-linux-x64.tar.gz/usr/local/java/jdk/
Decompress the file
Tar zxvf/usr/local/java/tomcat/apache-tomcat-7.0.57.tar.gz.
Tar zxvf/usr/local/java/tomcat/server-jre-7u76-linux-x64.tar.gz.
Install Jdk 1. Set JDK Environment Variables
Vi/etc/profile
ExportJAVA_HOME =/usr/local/java/jdk/jdk1.7.0 _ 76
ExportJAVA_BIN =/usr/local/java/jdk/jdk1.7.0 _ 76/bin
Export PATH = $ PATH: $ JAVA_HOME/bin
ExportCLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export JAVA_HOME JAVA_BIN PATH CLASSPATH
./Etc/profile
2. Set quick reference for java and javac
Switch to the/usr/bin directory
Reset the reference addresses of java and javac
Ln-s-f/usr/local/java/jdk/jdk1.7.0 _ 76/jre/bin/java
Ln-s-f/usr/local/java/jdk/jdk1.7.0 _ 76/bin/javac
3. view the version number
Tomcat installation 1. Design tomcat Environment Variables
Vi/etc/profile
ExportTOMCAT_HOME =/usr/local/java/tomcat/apache-tomcat-7.0.57
./Etc/profile
Configuration 1. tomcat removes project name access
Add <Context path = "" docBase = "item"/>
Item: Your project name.
2. Set tomcat to port 80
<Connector port = "8080" protocol = "HTTP/1.1" connectionTimeout = "20000" redirectPort = "8443"/> change port to 80
Note: Port ing
Vi/etc/sysconfig/iptables
Replace the command that has opened port 22 with port 8080:
-A input-m state -- state NEW-m tcp-p tcp -- dport 8080-j ACCEPT
-A input-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT
Service iptables restart
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.