標籤:tomcat安裝
1、檢查java版本資訊
[[email protected] ~]# java -versionjava version "1.8.0_20"Java(TM) SE Runtime Environment (build 1.8.0_20-b26)Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)[[email protected] ~]#
2、解壓和安裝apache-tomcat-7.0.54.tar.gz
[[email protected] ~]# cd /root/Downloads/[[email protected] Downloads]# lltotal 147536-rw-r--r--. 1 root root 8886891 Oct 3 19:23 apache-tomcat-7.0.54.tar.gz-rw-r--r--. 1 root root 142183549 Sep 30 21:29 jdk-8u20-linux-x64.rpm[[email protected] Downloads]# tar zxvf apache-tomcat-7.0.54.tar.gz
3、啟動tomcat
[[email protected] Downloads]# mv apache-tomcat-7.0.54 /usr/local/tomcat7[[email protected] Downloads]# cd /usr/local/tomcat7/[[email protected] tomcat7]# ./bin/startup.sh Using CATALINA_BASE: /usr/local/tomcat7Using CATALINA_HOME: /usr/local/tomcat7Using CATALINA_TMPDIR: /usr/local/tomcat7/tempUsing JRE_HOME: /usr/java/jdk1.8.0_20/jreUsing CLASSPATH: /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jarTomcat started.[[email protected] tomcat7]#
4、訪問http://192.168.1.200:8080
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/4B/8E/wKioL1QuirDQNGFAAAZMrzgaWjM480.jpg" title="QQ20141003193614.jpg" alt="wKioL1QuirDQNGFAAAZMrzgaWjM480.jpg" />
5、設定使用者帳號
[[email protected] tomcat7]# pwd/usr/local/tomcat7#在<tomcat-users>這裡新增內容,如下</tomcat-users><tomcat-users><role rolename="admin-gui"/><role rolename="admin-script"/><role rolename="manager-gui"/><role rolename="manager-script"/><role rolename="manager-jmx"/><role rolename="manager-status"/><user username="tomcat" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui"/></tomcat-users>###########[[email protected] tomcat7]# vi conf/tomcat-users.xml <?xml version=‘1.0‘ encoding=‘utf-8‘?><!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.--><tomcat-users><!-- NOTE: By default, no user is included in the "manager-gui" role required to operate the "/manager/html" web application. If you wish to use this app, you must define such a user - the username and password are arbitrary.--><!-- NOTE: The sample user and role entries below are wrapped in a comment and thus are ignored when reading this file. Do not forget to remove <!.. ..> that surrounds them.--><!-- <role rolename="tomcat"/> <role rolename="role1"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="both" password="tomcat" roles="tomcat,role1"/> <user username="role1" password="tomcat" roles="role1"/>--><role rolename="admin-gui"/><role rolename="admin-script"/><role rolename="manager-gui"/><role rolename="manager-script"/><role rolename="manager-jmx"/><role rolename="manager-status"/><user username="tomcat" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-script,admin-gui"/></tomcat-users>"conf/tomcat-users.xml" 43L, 1850C written
6、重啟服務
[[email protected] tomcat7]# ./bin/shutdown.shUsing CATALINA_BASE: /usr/local/tomcat7Using CATALINA_HOME: /usr/local/tomcat7Using CATALINA_TMPDIR: /usr/local/tomcat7/tempUsing JRE_HOME: /usr/java/jdk1.8.0_20/jreUsing CLASSPATH: /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar[[email protected] tomcat7]# ./bin/startup.shUsing CATALINA_BASE: /usr/local/tomcat7Using CATALINA_HOME: /usr/local/tomcat7Using CATALINA_TMPDIR: /usr/local/tomcat7/tempUsing JRE_HOME: /usr/java/jdk1.8.0_20/jreUsing CLASSPATH: /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jarTomcat started.[[email protected] tomcat7]#
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/4B/8F/wKioL1Quj-CAYYV6AAQ9uB95TTU575.jpg" title="QQ20141003195839.jpg" alt="wKioL1Quj-CAYYV6AAQ9uB95TTU575.jpg" />
本文出自 “Jerry” 部落格,請務必保留此出處http://alipay.blog.51cto.com/7119970/1560500
CentOS-6.4-x86_64中安裝apache-tomcat-7.0.54.tar.gz