CentOS6.4下搭建tomcat7

分类:CentOS教程 阅读:63518 次

  1. 检查java版本信息

java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

如果没有则安装:

yum -y install java-1.7.0-openjdk

2. 下载并解压缩tomcat

#cd/tmp #wgethttp://www.us.apache.org/dist/tomcat/tomcat-7/v7.0.54/bin/apache-tomcat-7.0.54.tar.gz

#tarxzfapache-tomcat-7.0.54.tar.gz #mvapache-tomcat-7.0.54/usr/local/tomcat7

3. 启动tomcat

#cd/usr/local/tomcat7 #./bin/startup.sh

[输出样例]

UsingCATALINA_BASE:/usr/local/tomcat7 UsingCATALINA_HOME:/usr/local/tomcat7 UsingCATALINA_TMPDIR:/usr/local/tomcat7/temp UsingJRE_HOME:/opt/jdk1.8.0_05/jre UsingCLASSPATH:/usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar Tomcatstarted.


4. 访问http://ip:8080

CentOS6.4下搭建tomcat7

5. 设置用户账户

<rolerolename="admin-gui"/> <rolerolename="admin-script"/> <rolerolename="manager-gui"/> <rolerolename="manager-script"/> <rolerolename="manager-jmx"/> <rolerolename="manager-status"/> <userusername="tomcat"password="tomcat"roles="manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui"/>

6. 重启tomcat服务

 #./bin/shutdown.sh #./bin/startup.sh