java服务部署
[root@localhost ~]# hostnamectl set-hostname tomcat-server
[root@localhost ~]# bash
[root@tomcat-server ~]# yum -y install java
[root@tomcat-server bin]# java -version
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
tomcat部署
[root@tomcat-server opt]# cd /opt/
[root@tomcat-server opt]# wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-9/v9.0.48/bin/apache-tomcat-9.0.48.tar.gz
[root@tomcat-server opt]# tar xf apache-tomcat-9.0.48.tar.gz
[root@tomcat-server opt]# ls
apache-tomcat-9.0.48 apache-tomcat-9.0.48.tar.gz
[root@tomcat-server opt]# ln -s apache-tomcat-9.0.48 /usr/local/tomcat
[root@tomcat-server opt]# mv apache-tomcat-9.0.48 tomcat
[root@tomcat-server opt]# mv tomcat/ /usr/local/
[root@tomcat-server opt]# /usr/local/tomcat/bin/startup.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Tomcat started.
查看版本信息
[root@tomcat-server opt]# /usr/local/tomcat/bin/version.sh
Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Using CATALINA_OPTS:
Server version: Apache Tomcat/9.0.48
Server built: Jun 10 2021 09:22:01 UTC
Server number: 9.0.48.0
OS Name: Linux
OS Version: 3.10.0-1127.el7.x86_64
Architecture: amd64
JVM Version: 1.8.0_292-b10
JVM Vendor: Red Hat, Inc.
查看服务是否正常
[root@tomcat-server opt]# ps -ef |grep java
root 1556 1 16 21:51 pts/0 00:00:02 /usr/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
root 1584 1293 0 21:51 pts/0 00:00:00 grep --color=auto java
[root@tomcat-server opt]# netstat -lnp |grep java
tcp6 0 0 :::8080 :::* LISTEN 1556/java
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 1556/java
启动脚本目录文件
[root@tomcat-server bin]# tree /usr/local/tomcat/bin/ -if
/usr/local/tomcat/bin
/usr/local/tomcat/bin/bootstrap.jar
/usr/local/tomcat/bin/catalina.bat
/usr/local/tomcat/bin/catalina.sh
/usr/local/tomcat/bin/catalina-tasks.xml
/usr/local/tomcat/bin/ciphers.bat
/usr/local/tomcat/bin/ciphers.sh
/usr/local/tomcat/bin/commons-daemon.jar
/usr/local/tomcat/bin/commons-daemon-native.tar.gz
/usr/local/tomcat/bin/configtest.bat
/usr/local/tomcat/bin/configtest.sh
/usr/local/tomcat/bin/daemon.sh
/usr/local/tomcat/bin/digest.bat
/usr/local/tomcat/bin/digest.sh
/usr/local/tomcat/bin/makebase.bat
/usr/local/tomcat/bin/makebase.sh
/usr/local/tomcat/bin/setclasspath.bat
/usr/local/tomcat/bin/setclasspath.sh
/usr/local/tomcat/bin/shutdown.bat
/usr/local/tomcat/bin/shutdown.sh
/usr/local/tomcat/bin/startup.bat
/usr/local/tomcat/bin/startup.sh
/usr/local/tomcat/bin/tomcat-juli.jar
/usr/local/tomcat/bin/tomcat-native.tar.gz
/usr/local/tomcat/bin/tool-wrapper.bat
/usr/local/tomcat/bin/tool-wrapper.sh
/usr/local/tomcat/bin/version.bat
/usr/local/tomcat/bin/version.sh
0 directories, 27 files
网友评论