1.使用wget下载apache-tomcat-7.0.55.tar.gz
wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.55/bin/apache-tomcat-7.0.55.tar.gz
2.下载完成之后要解压apache-tomcat-7.0.55.tar.gz(linux文件后缀带gz的都要gzip解压下)
gzip -d apache-tomcat-7.0.55.tar.gz
3.gzip -d之后文件名会变成apache-tomcat-7.0.55.tar.gz没有了.gz了,再用tar解压
tar xvf apache-tomcat-7.0.55.tar
4.执行第三步之后会解压出来一个apache-tomcat-7.0.55目录,其实就己经装完了,cd到apache-tomcat-7.0.55/bin
cd apache-tomcat-7.0.55/bin
5.启动tomcat(一定进入tomcat的bin目录才执行的)
sh startup.sh
6.用ps检查tomcat是否启动好
ps -ef | grep java
执行之后结果如下就证明启动好了
[root@localhost bin]# ps -ef | grep java
root 15828 1 6 12:20 pts/1 00:00:05 /usr/bin/java -Djava.util.logging.config.file=/home/web/apache-tomcat-7.0.55/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/home/web/apache-tomcat-7.0.55/endorsed -classpath /home/web/apache-tomcat-7.0.55/bin/bootstrap.jar:/home/web/apache-tomcat-7.0.55/bin/tomcat-juli.jar -Dcatalina.base=/home/web/apache-tomcat-7.0.55 -Dcatalina.home=/home/web/apache-tomcat-7.0.55 -Djava.io.tmpdir=/home/web/apache-tomcat-7.0.55/temp org.apache.catalina.startup.Bootstrap start
root 16240 16929 0 12:22 pts/1 00:00:00 grep java
7.在浏览器里面输入测试(60.28.198.21要改成你主机的ip)
http://60.28.198.21:8080/