1. 程式人生 > >tomcat+jdk部署

tomcat+jdk部署

linux運維

tar zxf jdk-8u66-linux-x64.tar.gz

mkdir /application/java/ -p

mv /home/oldboy/tools/jdk1.8.0_66 /application/java/


#在環境變量文件中加入一下內容

vim /etc/profile

export JAVA_HOME=/application/java/

export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOMR/bin


#查看安裝的jdk是否是剛才自己新裝的1.8.0_66

java -version


#[[email protected] bin]# java -version

#java version "1.8.0_66"

#Java(TM) SE Runtime Environment (build 1.8.0_66-b17)

#Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)


安裝tomcat

cd /home/oldboy/tools/

tar zxf apache-tomcat-8.0.26.tar.gz

mv /home/oldboy/tools/apache-tomcat-8.0.26 /application/

cd /application/

ln -s /application/apache-tomcat-8.0.26 /application/tomcat

#將下面內容放入到catalina.sh中

#CATALINA_HOME=/usr/local/apache-tomcat-6.0.30/

vim /application/tomcat/bin/catalina.sh

#啟動tomcat服務

/application/tomcat/bin/catalina.sh start

#跟蹤tomcat啟動情況,看到start Server startup in 959 ms的字樣,就代表tomcat啟動成功,需要註意的是,需要查看啟動時是否有error,如果有error請聯系公司開發人員

tail -f /application/tomcat/logs/catalina.out

#28-Jul-2016 17:33:05.735 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]

#28-Jul-2016 17:33:05.743 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]

#28-Jul-2016 17:33:05.745 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 959 ms


#在瀏覽器中輸入http://localhost:8080/ 如果不是本機就輸入相應服務器的IP地址。如:http://192.168.1.43:8080

如果沒有問題的話,就會在瀏覽器上出現tomcat的測試頁面


本文出自 “11308959” 博客,請務必保留此出處http://11318959.blog.51cto.com/11308959/1957249

tomcat+jdk部署