欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

centos7环境下配置tomcat

程序员文章站 2022-05-10 13:06:48
...
[aaa@qq.com local]# cp jdk-7u79-linux-x64.gz /usr/local/         //将jdk复制到/usr/local/目录下
[aaa@qq.com local]# cd /usr/local/                               //进入/usr/local/目录
[aaa@qq.com local]# tar -zxvf jdk-7u79-linux-x64.gz              //解压jdk安装包
[aaa@qq.com local]# ln -s  jdk1.7.0_79 jdk                       //设置jdk软连接
[aaa@qq.com local]# vim /etc/profile                             //修改环境变量,加入下面内容在文件尾
export JAVA_HOME=/usr/local/jdk                                      
export PATH=$JAVA_HOME/bin:$PATH
[aaa@qq.com ~]# source /etc/profile                              //生效环境变量
[aaa@qq.com ~]# java -version                                    //测试java环境版本
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

java环境安装完毕

[aaa@qq.com tmp]# cp apache-tomcat-6.0.20.tar.gz /usr/local/    //将tomcat复制到/usr/local目录下
[aaa@qq.com local]# tar -zxvf apache-tomcat-6.0.20.tar.gz       //解压tomcat安装包
[aaa@qq.com local]# ln -s apache-tomcat-6.0.20.tar.gz tomcat    //设置tomcat软连接
[aaa@qq.com tmp]# cd /usr/local/
[aaa@qq.com local]# vim /etc/profile                            //修改环境变量,加入下面内容在文件尾
export TOMECAT_HOME=/usr/local/tomcat
[aaa@qq.com tomcat]# /usr/local/tomcat/bin/startup.sh           //启动tomcat
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:       /usr/local/jdk

出现tomcat页面,tomcat服务器安装成功centos7环境下配置tomcat

[aaa@qq.com tomcat]# cd /usr/local/
[aaa@qq.com local]# vim linux.xml                              //新建linux.xml网页文件
[aaa@qq.com local]# cd /usr/local/tomcat/webapps/
[aaa@qq.com webapps]# mkdir text
[aaa@qq.com webapps]# cp /usr/local/linux.xml /usr/local/tomcat/webapps/text/
[aaa@qq.com webapps]# cp -r /usr/local/tomcat/webapps/ROOT/WEB-INF/ /usr/local/tomcat/webapps/text/
[aaa@qq.com webapps]# /usr/local/tomcat/bin/shutdown.sh 
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:       /usr/local/jdk
[aaa@qq.com webapps]# /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/local/jdk

centos7环境下配置tomcat

tomcat服务器下的网页搭建成功