码迷,mamicode.com
首页 > 其他好文 > 详细

TOMCAT安装

时间:2015-07-15 23:11:49      阅读:242      评论:0      收藏:0      [点我收藏+]

标签:tomcat安装

环境:CentOs 6.5(最小化安装)


编译安装JDK(CentOS默认安装了Openjdk,需要把它删除或者PATH=$JAVA_BIN:$PATH):

[root@CentOS software]# rpm -qa|grep java
java-1.7.0-openjdk-1.7.0.65-2.5.1.2.el6_5.x86_64
tzdata-java-2014g-1.el6.noarch
java-1.6.0-openjdk-1.6.0.0-11.1.13.4.el6.x86_64
[root@CentOS software]# yum -y remove java tzdata-java
[root@CentOS software]# tar -zxvf jdk-8u45-linux-x64.gz &>/dev/null
[root@CentOS software]# mv jdk1.8.0_45/ /usr/local/jdk
[root@CentOS software]# tail -n 5 /etc/profile
JAVA_HOME=/usr/local/jdk
JAVA_BIN=/usr/local/jdk/bin
PATH=$PATH:$JAVA_BIN
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
[root@CentOS software]#
[root@CentOS software]# source /etc/profile
[root@CentOS software]# java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
[root@CentOS software]#

部署tomcat:

[root@CentOS software]# tar -zxvf apache-tomcat-7.0.61.tar.gz &>/dev/null
[root@CentOS software]# mv apache-tomcat-7.0.61 /usr/local/tomcat
[root@CentOS software]# cd /usr/local/tomcat/bin/
[root@CentOS bin]# ./catalina.sh start
Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/local/jdk
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
[root@CentOS bin]#
[root@CentOS bin]# netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name  
tcp        0      0 0.0.0.0:22                  0.0.0.0:*                   LISTEN      1807/sshd            
tcp        0      0 127.0.0.1:631               0.0.0.0:*                   LISTEN      1626/cupsd          
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      1946/master          
tcp        0      0 127.0.0.1:6010              0.0.0.0:*                   LISTEN      2270/sshd            
tcp        0      0 0.0.0.0:41342               0.0.0.0:*                   LISTEN      1594/rpc.statd      
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN      1456/rpcbind        
tcp        0      0 :::22                       :::*                        LISTEN      1807/sshd            
tcp        0      0 ::1:631                     :::*                        LISTEN      1626/cupsd          
tcp        0      0 ::1:25                      :::*                        LISTEN      1946/master          
tcp        0      0 ::1:6010                    :::*                        LISTEN      2270/sshd            
tcp        0      0 ::ffff:127.0.0.1:8005       :::*                        LISTEN      2324/java            
tcp        0      0 :::8009                     :::*                        LISTEN      2324/java            
tcp        0      0 :::55786                    :::*                        LISTEN      1594/rpc.statd      
tcp        0      0 :::111                      :::*                        LISTEN      1456/rpcbind        
tcp        0      0 :::8080                     :::*                        LISTEN      2324/java            
udp        0      0 0.0.0.0:55232               0.0.0.0:*                               1594/rpc.statd      
udp        0      0 0.0.0.0:68                  0.0.0.0:*                               1638/dhclient        
udp        0      0 0.0.0.0:111                 0.0.0.0:*                               1456/rpcbind        
udp        0      0 0.0.0.0:631                 0.0.0.0:*                               1626/cupsd          
udp        0      0 0.0.0.0:783                 0.0.0.0:*                               1456/rpcbind        
udp        0      0 127.0.0.1:922               0.0.0.0:*                               1594/rpc.statd      
udp        0      0 :::111                      :::*                                    1456/rpcbind        
udp        0      0 :::45183                    :::*                                    1594/rpc.statd      
udp        0      0 :::783                      :::*                                    1456/rpcbind        
[root@CentOS bin]#
[root@CentOS bin]# ps -ef|grep tomcat |grep -v grep
root       2324      1  4 01:55 pts/0    00:00:04 /usr/local/jdk/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/tomcat/endorsed -classpath /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
[root@CentOS bin]#

访问http://172.24.17.130:8080(默认是8080,可在/usr/local/tomcat/conf/server.xml中修改

技术分享

技术分享

[root@localhost ~]# echo "source /etc/profile" >>/etc/rc.local
[root@localhost ~]# echo "/usr/local/tomcat/bin/catalina.sh start" >>/etc/rc.local


本文出自 “鹏城-酱油瓶” 博客,请务必保留此出处http://yfshare.blog.51cto.com/8611708/1674972

TOMCAT安装

标签:tomcat安装

原文地址:http://yfshare.blog.51cto.com/8611708/1674972

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!