标签:
首先已经安装完JDK
1.下载apache-tomcat-7.0.57.tar.gz
2.复制到/opt 解压
[root@iZ2873rjubzZ opt]# cp /root/apache-tomcat-7.0.57.tar.gz /opt/ [root@iZ2873rjubzZ opt]# tar -xzvf apache-tomcat-7.0.57.tar.gz
3. 设置环境变量
[root@iZ2873rjubzZ opt]# vi /etc/profile ##shift+g定位到文件末尾,添加以下代码 export CATALINA_HOME=/opt/apache-tomcat-7.0.57
export JAVA_HOME PATH CLASSPATH
##执行以下命令让配置文件生效
[root@iZ2873rjubzZ opt]# source /etc/profile
4.启动tomcat
[root@iZ2873rjubzZ opt]# apache-tomcat-7.0.57/bin/startup.sh Using CATALINA_BASE: /opt/apache-tomcat-7.0.57 Using CATALINA_HOME: /opt/apache-tomcat-7.0.57 Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.57/temp Using JRE_HOME: /opt/jdk1.7.0_51 Using CLASSPATH: /opt/apache-tomcat-7.0.57/bin/bootstrap.jar:/opt/apache-t omcat-7.0.57/bin/tomcat-juli.jar Tomcat started.
通过http://localhost:8080 访问有没有启动成功
5. 关闭tomcat
[root@iZ2873rjubzZ opt]# apache-tomcat-7.0.57/bin/shutdown.sh Using CATALINA_BASE: /opt/apache-tomcat-7.0.57 Using CATALINA_HOME: /opt/apache-tomcat-7.0.57 Using CATALINA_TMPDIR: /opt/apache-tomcat-7.0.57/temp Using JRE_HOME: /opt/jdk1.7.0_51 Using CLASSPATH: /opt/apache-tomcat-7.0.57/bin/bootstrap.jar:/opt/apache-t omcat-7.0.57/bin/tomcat-juli.jar [root@iZ2873rjubzZ opt]#
至此 tomcat已经安装完成
标签:
原文地址:http://www.cnblogs.com/yyh19890221/p/4182943.html