<% dim ModuleName,InfoID,ChannelShortName,CorrelativeArticle,InstallDir,ChannelDir,Keyword,PageTitle,ArticleIntro,Articlecontent Keyword=stripHTML("安装,防火墙") PageTitle=stripHTML("CentOS下安装Tomcat 8") ArticleIntro=stripHTML("CentOS下安装Tomcat 8,CentOS下安装Tomcat8安装Tomcat8去http://tomcat.apache.org/download-80.cgi下载Tomcat8的安装文件ap") Articlecontent=stripHTML("
CentOS下安装Tomcat 8安装Tomcat8去http://tomcat.apache.org/download-80.cgi下载Tomcat8的安装…") ModuleName = stripHTML("netadmin") InfoID = stripHTML("213009") ChannelShortName=stripHTML("网管") InstallDir=stripHTML("http://www.77169.com/") ChannelDir=stripHTML("netadmin") %> CentOS下安装Tomcat 8 - 华盟网 - http://www.77169.com
您现在的位置: 华盟网 >> 网管 >> Linux >> 正文

CentOS下安装Tomcat 8

2015/11/10 作者:不祥 来源: 互联网
导读 <% if len(ArticleIntro)<3 then Response.Write Articlecontent 'Response.Write "Articlecontent" else Response.Write ArticleIntro 'Response.Write "ArticleIntro" end if %>

CentOS下安装Tomcat 8

安装Tomcat8

去http://tomcat.apache.org/download-80.cgi下载Tomcat8的安装文件apache-tomcat-8.0.26.tar.gz。

将apache-tomcat-8.0.26.tar.gz文件放到/usr/local目录下,执行如下脚本

# cd /usr/local
# tar -zxvf apache-tomcat-8.0.26.tar.gz // 解压压缩包
# rm -rf apache-tomcat-8.0.26.tar.gz.tar.gz // 删除压缩包
# mv apache-tomcat-8.0.26 tomcat

启动Tomcat8

# /usr/local/tomcat/bin/startup.sh //启动tomcat

Using CATALINA_BASE: /usr/local/tomcat
Using CATALINA_HOME: /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: /usr/java/jdk1.8.0_60
Using CLASSPATH: /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.

如果出现下面错误:

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

则要注意提前设置java路径

在apache-tomcat-8.0.26/bin/setclasspath.sh中添加一下内容

export JAVA_HOME=/usr/java/jdk1.8.0_60
export JRE_HOME=/usr/java/jdk1.8.0_60/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH

防火墙开放8080端口

增加8080端口到防火墙配置中,执行以下操作:

# vi /etc/sysconfig/iptables

#增加以下代码

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT

重启防火墙

# service iptables restart

检验Tomcat8安装运行

通过以下地址查看tomcat是否运行正常:
http://192.168.11.52:8080/
看到tomcat系统界面,说明安装成功!

停止Tomcat8

# /usr/local/tomcat/bin/shutdown.sh //停止tomcat

更多Tomcat相关教程见以下内容:

CentOS 6.6下安装配置Tomcat环境 http://www.linuxidc.com/Linux/2015-08/122234.htm

redhat Linux 5.5安装JDK+Tomcat并部署Java项目 http://www.codesec.net/Linux/2015-02/113528.htm

Tomcat权威指南(第二版)(中英高清PDF版+带书签) http://www.codesec.net/Linux/2015-02/113062.htm

Tomcat 安全配置与性能优化 http://www.codesec.net/Linux/2015-02/113060.htm

Linux下使用Xshell查看Tomcat实时日志中文乱码解决方案 http://www.codesec.net/Linux/2015-01/112395.htm

CentOS 64-bit下安装JDK和Tomcat并设置Tomcat开机启动操作步骤 http://www.codesec.net/Linux/2015-01/111485.htm

CentOS 6.5下安装Tomcat http://www.codesec.net/Linux/2015-01/111415.htm

Tomcat 的详细介绍:请点这里
Tomcat 的下载地址:请点这里

更多CentOS相关信息见CentOS 专题页面 http://www.codesec.net/topicnews.aspx?tid=14

本文地址:http://www.codesec.net/Linux/2015-09/123118.htm


CentOS下安装Tomcat 8

本文系统(linux)相关术语:linux系统 鸟哥的linux私房菜 linux命令大全 linux操作系统