重庆分公司,新征程启航
为企业提供网站建设、域名注册、服务器等服务
安装Tomcat笔记:
创新互联公司坚持“要么做到,要么别承诺”的工作理念,服务领域包括:成都网站设计、做网站、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的金山网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!
软件:
jdk:jdk-8u5-linux-i586.gz
下载地址:http://download.oracle.com/otn-pub/java/jdk/8u5-b13/jdk-8u5-linux-i586.tar.gz?AuthParam=1403144208_59294832a3097c8f36b5e2e2df5e340a
更多版本jdk下载:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
tomcat:apache-tomcat-6.0.41.tar.gz
下载地址:http://apache.fayea.com/apache-mirror/tomcat/tomcat-6/v6.0.41/bin/apache-tomcat-6.0.41.tar.gz
[root@node1 bin]# rpm -qa |grep java //查看当前系统是否安装了rpm包的jdk
java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64
java_cup-0.10k-5.el6.x86_64
gcc-java-4.4.7-4.el6.x86_64
[root@node1 bin]# rpm -e java-1.5.0-gcj-1.5.0.0-29.1.el6.x86_64 --nodeps //卸载掉rpm装的jdk
一、安装配置jdk
1、解压,并移动到/usr/local下面
[root@node1 tmp]# tar -xf jdk-8u5-linux-i586.gz
[root@node1 tmp]# mv jdk1.8.0_05/ /usr/local/jdk
2、设置java环境变量
[root@node1 tmp]# vi /etc/profile
JAVA_HOME=/usr/local/jdk
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export JAVA_HOME CLASSPATH
[root@node1 tmp]# source /etc/profile
3、查看jdk是否生效
[root@node1 tmp]# java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) Client VM (build 25.5-b02, mixed mode)
二、安装配置tomacat
1、解压,并移动到/usr/local下
[root@node1 tmp]# tar xf apache-tomcat-6.0.41.tar.gz
[root@node1 tmp]# mv apache-tomcat-6.0.41 /usr/local/tomcat
2、设置tomcat环境变量
[root@node1 tmp]# vi /etc/profile
export CATALINA_HOME="/usr/local/tomcat"
export CATALINA_BASE="/usr/local/tomcat"
[root@node1 tmp]# source /etc/profile
3、启动tomcat
[root@node1 ~]# cd /usr/local/tomcat/bin/
[root@node1 bin]# ./startup.sh
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
[root@node1 local]# netstat -anlpt |grep java
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN 3489/java
tcp 0 0 :::8009 :::* LISTEN 3489/java
tcp 0 0 :::8080 :::* LISTEN 3489/java
4、访问tomcat
http://ip:8080
5、关闭tomcat
[root@node1 ~]# cd /usr/local/tomcat/bin/
[root@node1 bin]# ./shutdown.sh