CentOS 64-bit下安装JDK和Tomcat并设置Tomcat开机启动操作步骤

CentOS 64-bit下安装JDK和汤姆cat并安装汤姆cat开机运维操作步骤

粮草先行未雨策动文件如下:

1.CentOS-6.4-x86_64-bin-DVD1.iso

2.jdk-7u67-linux-x64.rpm

3.apache-tomcat-7.0.55.tar.gz

安装步骤如下:

一、安装JDK

[[email protected]
/]# java -version
bash: java: command not found

[[email protected]
/]# rpm -ivh /soft/jdk-7u67-linux-x64.rpm
Preparing…               
###########################################
[100%]
  1:jdk                   
###########################################
[100%]
Unpacking JAR files…
    rt.jar…
    jsse.jar…
    charsets.jar…
    tools.jar…
    localedata.jar…
    jfxrt.jar…
[[email protected]
/]#

[[email protected]
/]# java -version
java version “1.7.0_67”
Java(TM) SE Runtime Environment (build 1.7.0_67-b01)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)

[[email protected]
/]# cd /usr/java
[[email protected]
java]# ls
default  jdk1.7.0_67  latest
[[email protected]
java]#

二、安装Tomcat

rm -rf /usr/local/tomcat7
cd /usr
cd /usr/local/tomcat7
ls
ls

cd /
tar zxvf /soft/apache-tomcat-7.0.55.tar.gz
mv /apache-tomcat-7.0.55 /usr/local/tomcat7
chmod +x /usr/local/tomcat7

三、设置碰着变量

进行vim /etc/profile命令,增多情状变量代码如下

#jdk config
export JAVA_HOME=/usr/java/jdk1.7.0_67
export CALSSPATH=$JAVA_HOME/lib/*.* 
#tomcat config
export TOMCAT_HOME=/usr/local/tomcat7
export CATALINA_HOME=/usr/local/tomcat7
#path config
export PATH=$PATH:$JAVA_HOME/bin:$TOMCAT_HOME/bin

施行命令source /etc/profile刷新情状变量

四、启动Tomcat

sh /usr/local/tomcat7/bin/startup.sh

在火狐浏览器中张开网站

关闭Tomcat命令
sh /usr/local/tomcat7/bin/shutdown.sh

五、开机运维汤姆cat脚本

5.1、施行命令vi /etc/rc.d/init.d/tomcat生成脚本文件,内容如下

#!/bin/bash

#

# /etc/rc.d/init.d/tomcat

# init script for tomcat precesses

#

# processname: tomcat

# description: tomcat is a j2se server

# chkconfig: 2345 86 16

# description: Start up the Tomcat servlet engine.

if [ -f /etc/init.d/functions ]; then

. /etc/init.d/functions

elif [ -f /etc/rc.d/init.d/functions ]; then

. /etc/rc.d/init.d/functions

else

echo -e “atomcat: unable to locate functions lib. Cannot continue.”

exit -1

fi

RETVAL=$?

CATALINA_HOME=”/usr/local/tomcat7″ #tomcat安装目录

case “$1” in

start)

if [ -f $CATALINA_HOME/bin/startup.sh ];

then

echo $”Starting Tomcat”

$CATALINA_HOME/bin/startup.sh

fi

;;

stop)

if [ -f $CATALINA_HOME/bin/shutdown.sh ];

then

echo $”Stopping Tomcat”

$CATALINA_HOME/bin/shutdown.sh

fi

;;

*)

echo $”Usage: $0 {start|stop}”

exit 1

;;

esac

exit $RETVAL

 

5.2、增多权限chmod 755 /etc/rc.d/init.d/tomcat,使得脚本文件可进行

5.3、运行:chkconfig –add /etc/rc.d/init.d/tomcat #将其加到服务中

5.4、在vim /usr/local/tomcat7/bin/catalina.sh文件中参加以下语句:

#auto startup tomcat config
export JAVA_HOME=/usr/java/jdk1.7.0_67
export CATALINA_HOME=/usr/local/tomcat7
export CATALINA_BASE=/usr/local/tomcat7
export CATALINA_TMPDIR=/usr/local/tomcat7/temp

启动tomcat服务: service tomcat start
停止tomcat服务: service tomcat stop

Linux下Apache与两个Tomcat 集群负载均衡

Nginx 汤姆cat 集群负载均衡消除笔记

实例详细明白汤姆cat组件安装+Nginx反向代理Tomcat+Apache使用mod_jk和mod_proxy反向代理和负载均衡

CentOS 6.5下行使路虎极光syslog+LogAnalyzer+MySQL布置日志服务器

Apache+汤姆cat 景况搭建(JK铺排进度)

汤姆cat 的事必躬亲介绍:请点这里
汤姆cat 的下载地址:请点这里

本文永远更新链接地址:

64-bit下安装JDK和汤姆cat并安装汤姆cat开机运行操作步骤 希图像和文字件如下:
1.CentOS-6.4-x86_64-bin-DVD1.iso 2.jdk-7u67-linux-x64.rpm
3.apache-tomcat-7.0.55.tar…

发表评论

电子邮件地址不会被公开。 必填项已用*标注