安装环境:CentOS-6.5
安装方式:源码安装
软件:apache-tomcat-7.0.29.tar.gz
下载地址:http://tomcat.apache.org/download-70.cgi
将apache-tomcat-7.0.55.tar.gz文件上传到/usr/local中执行以下操作:
[root@admin local]# cd /usr/local |
启动Tomcat
执行以下操作:
[root@admin ~]# /usr/local/tomcat/bin/startup.sh //启动tomcat |
出现以上的打印信息说明已经成功启动。
防火墙开放8080端口
增加8080端口到防火墙配置中,执行以下操作:
[root@admin ~]# vi + /etc/sysconfig/iptables |
重启防火墙
[root@admin java]# service iptables restart |
检验Tomcat安装运行
通过以下地址查看tomcat是否运行正常:
开机自启动:
vim /etc/rc.d/rc.local 打开后用下面代码覆盖即可
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
export JAVA_HOME=/usr/java/jdk1.6.0_38
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar :$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
export CATALINA_HOME=/home/anjubao/apache-tomcat-7.0.55
/home/anjubao/apache-tomcat-7.0.55/bin/startup.sh
/usr/bin/ykqServer &
touch /var/lock/subsys/local
* 注:jdk和tomcat写真实安装路径