安裝Java環(huán)境
步驟一:安裝所需要系統(tǒng)庫相關(guān)庫文件
# yum install wget
# yum install lrzsz (rz是上傳命令)
# yum -y groupinstall "Perl Support"
# yum groupinstall "Development Tools"
# yum install -y gcc gcc-c++ gcc-g77 autoconf automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel* make vim bison cmake
# yum install -y gcc gcc-c++ openssl openssl-devel ncurses ncurses-devel cmake
步驟二:上傳jdk文件到 /mydata文件夾下
tar xzvf jdk-8u112-linux-x64.gz
將jdk解壓到 /mydata/setup/java/ 文件夾下
步驟三:添加到系統(tǒng)PATH
# vim /etc/profile
末尾添加
export JAVA_HOME=/mydata/java/jdk1.8.0_112
export ANDROID_JAVA_HOME=$JAVA_HOME
export JRE_HOME=/mydata/java/jdk1.8.0_112/jre
export CLASSPATH=/mydata/java/jdk1.8.0_112/lib
export PATH=$JAVA_HOME/bin:$PATH
步驟四:執(zhí)行java -version命令浸船,驗證jdk是否安裝成功:
source /etc/profile
安裝tomcat
步驟一:上傳tomcat文件到 /mydata 文件夾下
tar xzvf apache-tomcat-7.0.47.tar.gz
將tomcat文件解壓到 /mydata/setup 文件夾下
步驟二:vim /etc/profile? 設(shè)置環(huán)境變量,在環(huán)境變量文件最后加入以下內(nèi)容:
export JAVA_HOME=/mydata/setup/java/jdk1.8.0_112
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export TOMCAT_HOME=/mydata/setup/apache-tomcat-7.0.47
export CATALINA_HOME=/mydata/setup/apache-tomcat-7.0.47
export PATH=$PATH:$TOMCAT_HOME/bin
步驟三:執(zhí)行
source /etc/profile
步驟四:啟動tomcat
cd /mydata/setup/apache-tomcat-7.0.47/
./startup.sh
步驟五:關(guān)閉防火墻
service iptables stop --停止
service iptables start --啟動