JDK and Tomcat installation and configuration

1. Download or upload the downloaded compressed package through wget, and decompress it


 unzip command

tar -zxvf jdk-7u7-linux-i586.tar.gz

tar -zxvf apache-tomcat-7.0.61.tar.gz

2. Configure system-level environment variables (JDK)

vi /etc/profile

Add configuration at the end:

#JAVA_HOME

export JAVA_HOME=/opt/jdk1.7.0_07

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

Reload environment variables

source /etc/profile

3. Enable firewall whitelist (Tomcat)

vi /etc/sysconfig/iptables

Add configuration:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

restart firewall

service iptables restart

4. Verify

java -version


 

http://192.168.0.201:8080/


 
 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326525911&siteId=291194637