1. 程式人生 > >JDK與Tomcat安裝

JDK與Tomcat安裝

配置 說明 conf apache pat root 配置環境變量 eba ron

提示:所有涉及到java應用都需要安裝

源碼安裝方式

tar xf jdk-8u60-linux-x64.tar.gz -C /application/
ln -s /application/jdk1.8.0_60 /application/jdk

配置環境變量
sed -i.ori ‘$a export JAVA_HOME=/application/jdk\nexport PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH\nexport CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar‘ /etc/profile
source /etc/profile

檢查
java -version

或者手動添加環境變量

export JAVA_HOME=/application/jdk
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar

Tomcat安裝


tar xf apache-tomcat-8.0.27.tar.gz -C /application/
ln -s /application/apache-tomcat-8.0.27 /application/tomcat

echo ‘export TOMCAT_HOME=/application/tomcat‘>>/etc/profile
source /etc/profile
chown -R root.root /application/jdk/ /application/tomcat/

/application/tomcat/bin/version.sh

Tomcat目錄結構說明

[[email protected] tools]# cd /application/tomcat/
[[email protected] tomcat]# tree -L 1
.
├── bin   # startup.sh shutdown.sh catalina.sh(核心)
├── conf  # server.xml(主配置文件) tomcat-users.xml
├── lib
├── LICENSE
├── logs  # 日誌目錄  catalina.out tomcat實時日誌
├── NOTICE
├── RELEASE-NOTES
├── RUNNING.txt
├── temp
├── webapps  # 站點目錄
└── work

7 directories, 4 files

JDK與Tomcat安裝