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

Centos7 下安装配置tomcat7

程序员文章站 2022-05-17 21:57:43
...

首先下载压缩包
wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-7/v7.0.78/bin/apache-tomcat-7.0.78.zip
解压
unzip apache-tomcat-7.0.78.zip

[aaa@qq.com src]# ls
apache-tomcat-7.0.78      kernels       linux-3.10.1.tar.gz  upload
apache-tomcat-7.0.78.zip  linux-2.6.1   linux-3.4.16         utility
debug                     linux-3.10.1  readme
[aaa@qq.com src]# cd apache-tomcat-7.0.78/
[aaa@qq.com apache-tomcat-7.0.78]# ls
bin   lib      logs    RELEASE-NOTES  temp     work
conf  LICENSE  NOTICE  RUNNING.txt    webapps
[aaa@qq.com apache-tomcat-7.0.78]# cd bin
[aaa@qq.com bin]# ls
bootstrap.jar                 daemon.sh         startup.sh
catalina.bat                  digest.bat        tomcat-juli.jar
catalina.sh                   digest.sh         tomcat-native.tar.gz
catalina-tasks.xml            setclasspath.bat  tool-wrapper.bat
commons-daemon.jar            setclasspath.sh   tool-wrapper.sh
commons-daemon-native.tar.gz  shutdown.bat      version.bat
configtest.bat                shutdown.sh       version.sh
configtest.sh                 startup.bat
[aaa@qq.com bin]# 

需要给该目录下的三个文件执行权限chmod 755
这三个文件你分别是catalina.sh shutdown.sh startup.sh
开启tomcat需要执行./startup.sh
关闭tomcat需要执行./shudown.sh
浏览器打开localhost:8080进行访问
啥,不能访问,喜欢简单粗暴的就直接关闭防火墙,绅士一点就让防火墙通过8080端口吧,即执行以下命令
iptables -I INPUT -p tcp –dport=8080 -j ACCEPT
给个成功效果图
Centos7 下安装配置tomcat7