centos7 配置tomcat8
原创    loonbs    发表于:2018-05-29 10:41:08
  阅读 :93   收藏   编辑

centos6 安装配置java jdk8u73

注意 java 和tomcat 目录均为 /install 

下载tomcat8

wget  wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-8/v8.5.31/bin/apache-tomcat-8.5.31.tar.gz

tar -zxvf apache-tomcat-8.5.31.tar.gz 

mv apache-tomcat-8.5.31 tomcat8080

配置环境变量

vim /etc/profile

# tomcat8080 conf 
CATALINA_8080_BASE=/install/tomcat8080
CATALINA_8080_HOME=/install/tomcat8080
TOMCAT_8080_HOME=/install/tomcat8080
export CATALINA_8080_BASE CATALINA_8080_HOME TOMCAT_8080_HOME
# tomcat8080 conf

配置生效

source /etc/profile

配置tomcat8080变量

vim tomcat8080/bin/startup.sh  
 
第二行下新增

export JAVA_HOME=/install/jdk1.8
export JAVA=$JAVA_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/lib
export CATALINA_HOME=$CATALINA_8080_HOME
export CATALINA_BASE=$CATALINA_8080_BASE

vim tomcat8080/bin/shutdown.sh 
 
第二行下新增

export JAVA_HOME=/install/jdk1.8
export JAVA=$JAVA_HOME/bin:$PATH
export CLASSPATH=$JAVA_HOME/lib
export CATALINA_HOME=$CATALINA_8080_HOME
export CATALINA_BASE=$CATALINA_8080_BASE

启动

./tomcat8080/bin/startup.sh

Using CATALINA_BASE:   /install/tomcat8080
Using CATALINA_HOME:   /install/tomcat8080
Using CATALINA_TMPDIR: /install/tomcat8080/temp
Using JRE_HOME:        /install/jdk1.8/jre
Using CLASSPATH:       /install/tomcat8080/bin/bootstrap.jar:/install/tomcat8080/bin/tomcat-juli.jar

查看log

29-May-2018 10:23:27.966 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.31
29-May-2018 10:23:27.969 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Apr 27 2018 20:24:25 UTC
29-May-2018 10:23:27.969 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.31.0
29-May-2018 10:23:27.969 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
29-May-2018 10:23:27.969 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.10.0-693.el7.x86_64
29-May-2018 10:23:27.969 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
29-May-2018 10:23:27.969 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /install/jdk1.8/jre
29-May-2018 10:23:27.969 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_73-b02
29-May-2018 10:23:27.970 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
29-May-2018 10:23:27.970 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /install/tomcat8080
29-May-2018 10:23:27.970 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /install/tomcat8080


评论
条评论

推荐阅读