tomcat 安装部署

系统环境:

[root@ORACLE logs]# uname -a
Linux ORACLE 2.6.18-308.el5 #1 SMP Fri Jan 27 17:17:51 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@ORACLE logs]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.8 (Tikanga)

安装包:

jdk-7u45-linux-x64.gz

apache-tomcat-6.0.43.tar.gz

安装过程:

首先安装jdk环境,要看jdk安装请查看上一篇jetty安装 http://www.cnblogs.com/cheerong/p/4375894.html

1、配置系统环境,修改~/.bash_profile文件,添加一下内容:

TOMCAT_HOME=/usr/local/tomcat6.0
CATALINA_HOME=/usr/local/tomcat6.0
CATALINA_BASE=/usr/local/tomcat6.0
JAVA_HOME=/usr/local/jdk1.7
JAVA_BIN=/usr/local/jdk1.7/bin
PATH=$PATH:$JAVA_BIN:/usr/local/maven/bin:$HOME/bin
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH JETTY_HOME TOMCAT_HOME CATALINA_HOME CATALINA_BASE
运行 source ~/.bash_profile,使配置生效

2、解压安装包:

tar -xf apache-tomcat-6.0.43.tar.gz -C /usr/local/
ln -s apache-tomcat-6.0.43 tomcat6.0

3、启动tomcat

[root@ORACLE bin]# ./catalina.sh start
Using CATALINA_BASE:   /usr/local/tomcat6.0
Using CATALINA_HOME:   /usr/local/tomcat6.0
Using CATALINA_TMPDIR: /usr/local/tomcat6.0/temp
Using JRE_HOME:        /usr/local/jdk1.7
Using CLASSPATH:       /usr/local/tomcat6.0/bin/bootstrap.jar
[root@ORACLE bin]# ps aux|grep java
root      3971 12.2  5.7 539088 59084 pts/0    Sl   16:44   0:04 /usr/local/jdk1.7/bin/java -Djava.util.logging.config.file=/usr/local/tomcat6.0/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/tomcat6.0/endorsed -classpath /usr/local/tomcat6.0/bin/bootstrap.jar -Dcatalina.base=/usr/local/tomcat6.0 -Dcatalina.home=/usr/local/tomcat6.0 -Djava.io.tmpdir=/usr/local/tomcat6.0/temp org.apache.catalina.startup.Bootstrap start
root      4048 78.3  5.9 656604 60564 pts/0    Sl   16:44   0:04 /usr/local/jdk1.7/bin/java -Djava.util.logging.config.file=/usr/local/tomcat6.0/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/tomcat6.0/endorsed -classpath /usr/local/tomcat6.0/bin/bootstrap.jar -Dcatalina.base=/usr/local/tomcat6.0 -Dcatalina.home=/usr/local/tomcat6.0 -Djava.io.tmpdir=/usr/local/tomcat6.0/temp org.apache.catalina.startup.Bootstrap start
root      4061  0.0  0.0  61176   724 pts/0    R+   16:44   0:00 grep java
[root@ORACLE bin]# netstat -tpln|grep 8080
[root@ORACLE bin]# netstat -tpln|grep 8088
tcp        0      0 :::8088                     :::*                        LISTEN      3971/java      

如上图,查看tomcat进程,tomcat端口号默认为8080,这里是我更改为8088之后运行的。

修改tomcat端口号为修改server.xml文件:

<Connector port="8088" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" /> 

 

转载于:https://www.cnblogs.com/cheerong/p/4387449.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值