Linux CentOS7 离线运行Tomcat
2020-04-06 本文已影响0人
夹板儿孩
我感觉我好像是有点在水文章了
首先你得拥有这么一个压缩包 apache-tomcat-8.5.40.tar.gz 提取码:csh4
然后解压
tar -zxf apache-tomcat-8.5.40.tar.gz
你会得到一个文件夹 apache-tomcat-8.5.40

切换到bin目录下
cd /apache-tomcat-8.5.40/bin
启动tomcat
./startup.sh
若遇到这个报错
[root@localhost bin]# ./startup.sh
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
那就是jdk没有安装如何安装JDK
好了,结束...
访问测试
使用命令
curl http://127.0.0.1:8080
若返回了tomcat的页面,则是成功了。

如果用浏览器访问页面是遭遇了无法访问,多半应该是防火墙把端口拦截了防火墙添加8080端口