rhel6.4部署tomcat
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了rhel6.4部署tomcat相关的知识,希望对你有一定的参考价值。
先把tomcat和jdk包下好
http://tomcat.apache.org/download-70.cgi
http://www.Oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
安装jdk
[[email protected] ~]# ls jdk* jdk-8u131-linux-x64.rpm [[email protected] ~]# rpm -ivh jdk-8u131-linux-x64.rpm
配置环境变量
[[email protected] ~]# vim /etc/profile export JAVA_HOME=/usr/java/default export JAVA_BIN=$JAVA_HOME/bin export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH [[email protected] ~]# source /etc/profile [[email protected] ~]# java -version java version "1.8.0_131" Java(TM) SE Runtime Environment (build 1.8.0_131-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
解压安装tomcat
[[email protected] ~]# tar -zxvf apache-tomcat-7.0.77.tar.gz [[email protected] ~]# cd apache-tomcat-7.0.77 [[email protected] ~]# cd apache-tomcat-7.0.77/bin/ [[email protected] bin]# ./startup.sh Using CATALINA_BASE: /root/apache-tomcat-7.0.77 Using CATALINA_HOME: /root/apache-tomcat-7.0.77 Using CATALINA_TMPDIR: /root/apache-tomcat-7.0.77/temp Using JRE_HOME: /usr/java/default Using CLASSPATH: /root/apache-tomcat-7.0.77/bin/bootstrap.jar:/root/apache-tomcat-7.0.77/bin/tomcat-juli.jar Tomcat started.
关闭防火墙或者加一条允许8080端口通过
/sbin/iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
[[email protected] bin]# service iptables stop iptables:清除防火墙规则: [确定] iptables:将链设置为政策 ACCEPT:filter [确定] iptables:正在卸载模块: [确定]
浏览器测试:http://ip:8080
增加web管理账号和角色,再<tomcat-users>标签里写入下面2条,指定
[[email protected] ~]# vim apache-tomcat-7.0.77/conf/tomcat-users.xml <tomcat-users> <role rolename="kurolz"/> <user username="kurolz" password="kurolz" role="kurolz"/> </tomcat-users>
本文出自 “谢育政” 博客,请务必保留此出处http://kurol.blog.51cto.com/11433546/1927332
以上是关于rhel6.4部署tomcat的主要内容,如果未能解决你的问题,请参考以下文章
tomcat:部署:“无法调用 Tomcat 管理器:连接被拒绝”
在Tomcat的安装目录下conf目录下的server.xml文件中增加一个xml代码片段,该代码片段中每个属性的含义与用途