[root@iZ2zeeh47kp5evidpgzz7gZ /]# cd /usr/local
[root@iZ2zeeh47kp5evidpgzz7gZ local]# ls
aegis bin etc games include lib lib64 libexec sbin share src
[root@iZ2zeeh47kp5evidpgzz7gZ local]# mkdir java
[root@iZ2zeeh47kp5evidpgzz7gZ local]# ls
aegis bin etc games include java lib lib64 libexec sbin share src
[root@iZ2zeeh47kp5evidpgzz7gZ local]# mkdir tomcat
[root@iZ2zeeh47kp5evidpgzz7gZ local]# ls
aegis bin etc games include java lib lib64 libexec sbin share src tomcat
[root@iZ2zeeh47kp5evidpgzz7gZ local]# mkdir mysql
[root@iZ2zeeh47kp5evidpgzz7gZ local]# ls
aegis bin etc games include java lib lib64 libexec mysql sbin share src tomcat
[root@iZ2zeeh47kp5evidpgzz7gZ local]#
二.安装JDK,配置环境变量
进入java目录解压jdk
tar -zxvf jdk-8u212-linux-x64.tar.gz
看看你解压之后的文件名,如果太复杂可以改成简单点的
[root@iZ2zeeh47kp5evidpgzz7gZ java]# ls
jdk1.8.0_212 jdk-8u212-linux-x64.tar.gz
[root@iZ2zeeh47kp5evidpgzz7gZ java]# mv jdk1.8.0_212 /usr/local/java/jdk1.8
[root@iZ2zeeh47kp5evidpgzz7gZ java]# ls
jdk1.8 jdk-8u212-linux-x64.tar.gz
[root@iZ2zeeh47kp5evidpgzz7gZ java]#
[root@iZ2zeeh47kp5evidpgzz7gZ java]# vi /etc/profile
使用vi编辑器打开配置文件后使用 i 命令进行编写 ,esc键 退出编辑模式 , :wq 保存退出
让环境变量生效
source /etc/profile
验证,查看jdk版本
[root@iZ2zeeh47kp5evidpgzz7gZ jdk1.8]# java -version
java version "1.8.0_212"
Java(TM) SE Runtime Environment (build 1.8.0_212-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.212-b10, mixed mode)
三 . 安装tomcat
进入tomcat目录,并解压tomcat
[root@iZ2zeeh47kp5evidpgzz7gZ /]# cd /usr/local/tomcat
[root@iZ2zeeh47kp5evidpgzz7gZ tomcat]# ls
apache-tomcat-8.5.40 (1).tar.gz
[root@iZ2zeeh47kp5evidpgzz7gZ tomcat]# tar -zxvf apache-tomcat-8.5.40\ \(1\).tar.gz
查看解压后文件,并改名,和之前的jdk一样
[root@iZ2zeeh47kp5evidpgzz7gZ tomcat]# ls
apache-tomcat-8.5.40 apache-tomcat-8.5.40 (1).tar.gz
[root@iZ2zeeh47kp5evidpgzz7gZ tomcat]# mv apache-tomcat-8.5.40 tomcat8
[root@iZ2zeeh47kp5evidpgzz7gZ tomcat]# ls
apache-tomcat-8.5.40 (1).tar.gz tomcat8
[root@iZ2zeeh47kp5evidpgzz7gZ tomcat]#
进入tomcat的bin目录启动tomcat
[root@iZ2zeeh47kp5evidpgzz7gZ tomcat]# cd tomcat8/
[root@iZ2zeeh47kp5evidpgzz7gZ tomcat8]# ls
bin BUILDING.txt conf CONTRIBUTING.md lib LICENSE logs NOTICE README.md RELEASE-NOTES RUNNING.txt temp webapps work
[root@iZ2zeeh47kp5evidpgzz7gZ tomcat8]# cd bin
[root@iZ2zeeh47kp5evidpgzz7gZ bin]# ls
bootstrap.jar catalina.sh commons-daemon.jar configtest.bat daemon.sh digest.sh setclasspath.sh shutdown.sh startup.sh tomcat-native.tar.gz tool-wrapper.sh version.sh
catalina.bat catalina-tasks.xml commons-daemon-native.tar.gz configtest.sh digest.bat setclasspath.bat shutdown.bat startup.bat tomcat-juli.jar tool-wrapper.bat version.bat
[root@iZ2zeeh47kp5evidpgzz7gZ bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/tomcat/tomcat8
Using CATALINA_HOME: /usr/local/tomcat/tomcat8
Using CATALINA_TMPDIR: /usr/local/tomcat/tomcat8/temp
Using JRE_HOME: /usr/local/java/jdk1.8
Using CLASSPATH: /usr/local/tomcat/tomcat8/bin/bootstrap.jar:/usr/local/tomcat/tomcat8/bin/tomcat-juli.jar
Tomcat started.
[root@iZ2zeeh47kp5evidpgzz7gZ bin]#