实验环境:Centos7.3操作系统,
实验步骤:
(1)配置JAVA环境,并且关闭防火墙
[root@localhost ~]# systemctl stop firewalld 关闭防火墙
[root@localhost yfr]# tar zxf jdk-7u65-linux-x64.gz 解压JDK的包
[root@localhost yfr]# mkdir /usr/local/java
[root@localhost yfr]# mv jdk1.7.0_65/ /usr/local/java 移动到指定目录
[root@localhost yfr]# vim /etc/profile 配置JAVA的环境变量
export JAVA_HOME=/usr/local/java
export PATH=$PATH:$PATH_HOME/bin
[root@localhost yfr]# . /etc/profile 将我们配置的JAVA环境生效
[root@localhost yfr]# java -version 检测JAVA配置
openjdk version "1.8.0_102"
OpenJDK Runtime Environment (build 1.8.0_102-b14)
OpenJDK 64-Bit Server VM (build 25.102-b14, mixed mode)
至此,我们的java环境变量配置成功了
(2)解压Tomcat的包、开启Tomcat并且访问
[root@localhost yfr]# tar zxf apache-tomcat-7.0.54.tar.gz 解压Tomcat的源码包
[root@localhost yfr]# mv apache-tomcat-7.0.54 /usr/local/tomcat7 移动源码包到指定目录
[root@localhost yfr]# /usr/local/tomcat7/bin/startup.sh 开启Tomcat
Using CATALINA_BASE: /usr/local/tomcat7
Using CATALINA_HOME: /usr/local/tomcat7
Using CATALINA_TMPDIR: /usr/local/tomcat7/temp
Using JRE_HOME: /usr/local/java
Using CLASSPATH: /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar
Tomcat started.
[root@localhost yfr]# netstat -anpt | grep 8080 查看Tomcat的端口信息
tcp6 0 0 :::8080 :::* LISTEN 14248/java
[root@localhost yfr]# firefox 192.168.0.20:8080 访问Tomcat
[root@localhost tomcat7]# ls
bin lib logs RELEASE-NOTES temp work
conf LICENSE NOTICE RUNNING.txt webapps
主要目录说明:
bin /启动和关闭tomcat的脚本文件·
conf /存放tomcat服务器的各种全局配置文件,其中最重要的是server.xml和web.xml
lib /存放tomcat运行需要的库文件(JARS)
logs /LOG文件
webapps /主要web发布目录(包括应用程序实例)
work /存放jsp编译后产生的class文件
标签:tomcat,部署,root,tomcat7,usr,yfr,local,localhost From: https://www.cnblogs.com/smile020420/p/16914559.html