1(1)主要参考https://jingyan.baidu.com/article/3065b3b6e0fad2becff8a419.html(这个看后基本知道怎么安装tomcat)
其次参考:http://blog.csdn.net/wqs1028/article/details/63253070(看这个可以做后续操作)
http://www.cnblogs.com/xdp-gacl/p/4097608.html(很详细,适合出现比较复杂问题的时候看这个可以研究问题,包含怎么在linux的tomcat上发布项目)
注意:运行tomcat的命令是./startup.sh
2:[root@instance-z4q11n8b-1 bin]# java -version先检查jdk有没有安装好
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
[root@instance-z4q11n8b-1 bin]# firewall -cmd --firewall -cmd --检查有没有防火墙设置
-bash: firewall: command not found
[root@instance-z4q11n8b-1 bin]# firewall -cmd --
-bash: firewall: command not found
[root@instance-z4q11n8b-1 bin]# firewall-cmd --query-port=8080/tcp检查8080端口有没有被防火墙拦截
FirewallD is not running说明没有防火墙在运行,那么可以放心在tomcat的bin目录下运行tomcat了
[root@instance-z4q11n8b-1 bin]# ./startup.sh
Using CATALINA_BASE: /root/user/java/tomcat/apache-tomcat-7.0.82
Using CATALINA_HOME: /root/user/java/tomcat/apache-tomcat-7.0.82
Using CATALINA_TMPDIR: /root/user/java/tomcat/apache-tomcat-7.0.82/temp
Using JRE_HOME: /root/user/java/jdk/jdk1.8.0_144/jre
Using CLASSPATH: /root/user/java/tomcat/apache-tomcat-7.0.82/bin/bootstrap.jar:/root/user/java/tomcat/apache-tomcat-7.0.82/bin/tomcat-juli.jar
Tomcat started.说明tomcat启动成功了:
3:到底有没有启动成功呢
使用以下命令
# ps -ef |grep tomcat
如果返回类似以下信息说明tomcat没有启动
502 19258 8770 0 7:14下午 ttys000 0:00.01 grep tomcat
如果返回类似以下信息出现,说明tomcat是启动了,第一个是启动该进程的用户,第二个是该进程的id,第三个 是占用CPU的百分比,
第四个是占用内存的百分比
# ps -ef|grep tomcat
0 19372 1 0 7:18下午 ttys000 0:28.01 /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin/java -Djava.util.logging.config.file=/Applications/apache-tomcat-7.0.62/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/Applications/apache-tomcat-7.0.62/endorsed -classpath /Applications/apache-tomcat-7.0.62/bin/bootstrap.jar:/Applications/apache-tomcat-7.0.62/bin/tomcat-juli.jar -Dcatalina.base=/Applications/apache-tomcat-7.0.62 -Dcatalina.home=/Applications/apache-tomcat-7.0.62 -Djava.io.tmpdir=/Applications/apache-tomcat-7.0.62/temp org.apache.catalina.startup.Bootstrap start
0 19392 19342 0 7:18下午 ttys000 0:00.00 grep tomcat
4.linux下浏览器访问http://centOS IP:8080
5:linux下启动正常,但是浏览器访问不了
http://blog.csdn.net/itzhangdaopin/article/details/62044620
6:解压war包jar -xvf Setup.war
http://www.linuxidc.com/Linux/2012-12/75811.htm