首先下载压缩包
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
[root@bogon 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
[root@bogon src]# cd apache-tomcat-7.0.78/
[root@bogon apache-tomcat-7.0.78]# ls
bin lib logs RELEASE-NOTES temp work
conf LICENSE NOTICE RUNNING.txt webapps
[root@bogon apache-tomcat-7.0.78]# cd bin
[root@bogon 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
[root@bogon 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
给个成功效果图