Tomcat在Centos上的安装

Tomcat在Centos上的安装

1、首先从tomcat网站上下载安装包

http://tomcat.apache.org/download-80.cgi

2、通过ftp上传文件bin模式下

3、tar xzvfapache-tomcat-8.0.8.tar.gz 解压到apache-tomcat-8.0.8

4、将目录改名为tomcat

[root@localhost local]# ls

apache-tomcat-8.0.8         etc      jre1.7.0_60  libexec                 sbin

apache-tomcat-8.0.8.tar.gz  games   lib          OSA_BETA_V1.0.5         share

bin                         include  lib64       OSA_BETA_V1.0.5.tar.gz  src

[root@localhost local]# mv apache-tomcat-8.0.8/ tomcat

[root@localhost local]# ls

apache-tomcat-8.0.8.tar.gz  include     libexec                 share

bin                         jre1.7.0_60  OSA_BETA_V1.0.5         src

etc                         lib          OSA_BETA_V1.0.5.tar.gz  tomcat

games                       lib64        sbin

[root@localhost local]#

5、设置环境变量vi/etc/profile

export PYTHONPATH

export JAVA_HOME=/usr/local/jdk1.7.0_60

exportCATALINA_HOME=/usr/local/tomcat

exportCLASSPATH=.$JAVA_HOME/lib:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/lib

export PATH=$PATH:$JAVA_HOME/bin:$CATALINA_HOME/bin

export JRE_HOME=$JAVA_HOME/jre

"/etc/profile" 75L, 1665C written

[root@localhost local]# source /etc/profile

[root@localhost local]#

6、启动tomcat

 

[root@localhost ~]# catalina.sh run

Using CATALINA_BASE:   /usr/local/tomcat

Using CATALINA_HOME:   /usr/local/tomcat

Using CATALINA_TMPDIR:/usr/local/tomcat/temp

Using JRE_HOME:        /usr/local/jdk1.7.0_60/jre

Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

22-Jun-2014 03:06:47.414 INFO [main]org.apache.catalina.core.AprLifecycleListener.init The APR based Apache TomcatNative library which allows optimal performance in production environments wasnot found on the java.library.path:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

22-Jun-2014 03:06:48.646 INFO [main]org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler["http-nio-8080"]

22-Jun-2014 03:06:48.747 INFO [main]org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a sharedselector for servlet write/read

22-Jun-2014 03:06:48.752 INFO [main]org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler["ajp-nio-8009"]

22-Jun-2014 03:06:48.755 INFO [main]org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a sharedselector for servlet write/read

22-Jun-2014 03:06:48.756 INFO [main]org.apache.catalina.startup.Catalina.load Initialization processed in 2938 ms

22-Jun-2014 03:06:48.869 INFO [main]org.apache.catalina.core.StandardService.startInternal Starting serviceCatalina

22-Jun-2014 03:06:48.870 INFO [main]org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine:Apache Tomcat/8.0.8

22-Jun-2014 03:06:48.978 INFO[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectoryDeploying web application directory /usr/local/tomcat/webapps/docs

22-Jun-2014 03:06:50.217 INFO[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectoryDeployment of web application directory /usr/local/tomcat/webapps/docs hasfinished in 1,219 ms

22-Jun-2014 03:06:50.218 INFO[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectoryDeploying web application directory /usr/local/tomcat/webapps/examples

22-Jun-2014 03:06:52.088 INFO[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectoryDeployment of web application directory /usr/local/tomcat/webapps/examples hasfinished in 1,870 ms

22-Jun-2014 03:06:52.102 INFO[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectoryDeploying web application directory /usr/local/tomcat/webapps/host-manager

22-Jun-2014 03:06:52.188 INFO[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectoryDeployment of web application directory /usr/local/tomcat/webapps/host-managerhas finished in 100 ms

22-Jun-2014 03:06:52.189 INFO[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectoryDeploying web application directory /usr/local/tomcat/webapps/ROOT

22-Jun-2014 03:06:52.261 INFO[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectoryDeployment of web application directory /usr/local/tomcat/webapps/ROOT hasfinished in 72 ms

22-Jun-2014 03:06:52.261 INFO[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectoryDeploying web application directory /usr/local/tomcat/webapps/manager

22-Jun-2014 03:06:52.674 INFO[localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectoryDeployment of web application directory /usr/local/tomcat/webapps/manager hasfinished in 412 ms

22-Jun-2014 03:06:52.693 INFO [main]org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler["http-nio-8080"]

22-Jun-2014 03:06:52.710 INFO [main]org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler["ajp-nio-8009"]

22-Jun-2014 03:06:52.712 INFO [main]org.apache.catalina.startup.Catalina.start Server startup in 3956 ms

7、验证tomcat

[root@localhost ~]# netstat -ntl | grep8080

tcp       0      0 :::8080                     :::*                        LISTEN     

[root@localhost ~]# netstat -ntl | grep8009

tcp       0      0 :::8009                     :::*                        LISTEN

 

http://192.168.1.102:8080

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值