概述
Tomcat下载:http://tomcat.apache.org/download-80.cgi
//判断系统自带的jdk
[root@localhost zyjh6666]# java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)
//解压tomcat
[root@localhost zyjh6666]# tar zxvf apache-tomcat-8.5.32.tar.gz
apache-tomcat-8.5.32/conf/
.···········
apache-tomcat-8.5.32/bin/startup.sh
apache-tomcat-8.5.32/bin/tool-wrapper.sh
apache-tomcat-8.5.32/bin/version.sh
//移动文件位置
[root@localhost zyjh6666]# mv apache-tomcat-8.5.32 /usr/local
//进入文件目录
[root@localhost zyjh6666]# cd /usr/local/apache-tomcat-8.5.32/bin
//启动服务器
[root@localhost bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-8.5.32
Using CATALINA_HOME: /usr/local/apache-tomcat-8.5.32
CLASSPATH: /usr/local/apache-tomcat-8.5.32/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.32/bin/tomcat-juli.jar
Tomcat started.
//测试是否启动
[root@localhost bin]# wget http://localhost:8080
--2018-07-20 14:40:00-- http://localhost:8080/
正在解析主机 localhost (localhost)... ::1, 127.0.0.1
正在连接 localhost (localhost)|::1|:8080... 已连接。
已发出 HTTP 请求,正在等待回应... 200
长度:未指定 [text/html]
正在保存至: “index.html”
[ <=> ] 11,230 --.-K/s 用时 0s
2018-07-20 14:40:00 (310 MB/s) - “index.html” 已保存 [11230]
//在防火墙中打开8080端口
[root@localhost bin]# firewall-cmd –zone=public –add-port=8080/tcp –permanent
usage: see firewall-cmd man page
firewall-cmd: error: unrecognized arguments: –zone=public –add-port=8080/tcp –permanent
//重启防火墙
[root@localhost bin]# systemctl restart firewalld.service
[root@localhost bin]#
[root@localhost bin]#
[root@localhost bin]#
[root@localhost bin]# ./startup.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-8.5.32
Using CATALINA_HOME: /usr/local/apache-tomcat-8.5.32
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.32/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/apache-tomcat-8.5.32/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.32/bin/tomcat-juli.jar
Tomcat started.
//关闭服务器
[root@localhost bin]# ./shutdown.sh
Using CATALINA_BASE: /usr/local/apache-tomcat-8.5.32
Using CATALINA_HOME: /usr/local/apache-tomcat-8.5.32
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.32/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/apache-tomcat-8.5.32/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.32/bin/tomcat-juli.jar
Using CATALINA_TMPDIR: /usr/local/apache-tomcat-8.5.32/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/apache-tomcat-8.5.32/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.32/bin/tomcat-j
最后
以上就是勤恳豌豆为你收集整理的Linux下安装配置Tomcat的全部内容,希望文章能够帮你解决Linux下安装配置Tomcat所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复