#!/bin/bash
#---------------------------------------------------------------------
#
# Author : 大象无形
# Date : --
# Mail : wxqian_wxq@.com
# Description: Install tomcat7 and JDK1.
# Equipment :
# )Run this script as root
#
#--------------------------------------------------------------------- #Script's structure
#)Determines if the root user
#)Test the machine JDK version
#)Determine if the file exists
#)install JDK
#)Add the environment variable to /etc/profile
#)Install tomcat
#)Configure tomcat #)Determines if the root user
if [ "$(whoami)" != 'root' ]; then
echo "install need root user"
exit
fi
#)Test the machine JDK version
for i in $(rpm -qa | grep java | grep -v grep)
do
echo "Deleting rpm -> "$i
rpm -e --nodeps $i
done
#)Determine if the file exists
file1=./jdk-8u101-linux-x64.tar.gz
if [ ! -f "$file1" ]; then
echo "need jdk-8u101-linux-x64.tar.gz"
exit
fi file2=./apache-tomcat-7.0..tar.gz
if [ ! -f "$flie2" ]; then
echo "need apache-tomcat-7.0.73.tar.gz"
exit
fi
#)install JDK
echo "========================jdk is installing======================"
tar zxvf jdk-8u101-linux-x64.tar.gz
mv jdk1..0_101 /opt/jdk
echo "jdk1.8.0_101 is rename jdk"
sleep ; #)Add the environment variable to /etc/profile
echo "export JAVA_HOME=/opt/jdk" >> /etc/profile
echo "export PATH=$JAVA_HOME/bin:$PATH" >> /etc/profile
echo "export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar" >> /etc/profile
sleep ;
source /etc/profile
#)Install tomcat
echo "====================apache-tomcat is installing==================="
tar zxvf apache-tomcat-7.0..tar.gz
mv apache-tomcat-7.0. /usr/local/tomcat
cp -p /usr/local/tomcat/bin/catalina.sh /etc/init.d/tomcat
#)Configure tomcat
sed -i '1a\. /etc/init.d/functions' /etc/init.d/tomcat
sed -i '2a\:' /etc/init.d/tomcat
sed -i '3a\JAVA_HOME=/usr/local/jdk/' /etc/init.d/tomcat
sed -i '4a\CATALINA_HOME=/usr/local/tomcat' /etc/init.d/tomcat
sleep ;
chmod /etc/init.d/tomcat
chkconfig --add tomcat
chkconfig tomcat on
/usr/local/tomcat/bin/startup.sh

tomcat7+jdk1.8一键安装脚本的更多相关文章

  1. jdk1.8一键安装脚本(linux环境)

    1.下载jdk安装包和安装脚本 下载地址:https://pan.baidu.com/s/1bo6ADQ3 其中包括: jdk安装包:jdk-8u151-linux-x64.tar.gz jdk一键安 ...

  2. CentOS 6、7下pptp vpn一键安装脚本

    之前有折腾过<CentOS 6.7下IPSEC/L2TP VPN一键安装脚本>,不稳定.不支持IOS,因此换成pptp,并已经添加到<lnmp一键安装包>.这个脚本可以单独使用 ...

  3. LAMP最新源码一键安装脚本

    Linux+Apache+MySQL+PHP (脚本可以选择是否安装+Pureftpd+User manager for PureFTPd+phpMyAdmin+memcache),添加虚拟主机请执行 ...

  4. LNMP、LAMP、LANMP一键安装脚本(定期更新)[转]

    这个脚本是使用shell编写,为了快速在生产环境上部署LNMP/LAMP/LANMP(Linux.Nginx/Tengine.MySQL/MariaDB/Percona.PHP),适用于CentOS/ ...

  5. SSR服务端一键安装脚本

    支持新协议混淆,SSR服务端一键安装脚本   Shadowsocks-R 是项目 shadowsocks 的增强版,用于方便地产生各种协议接口.实现为在原来的协议外套一层编码和解码接口,不但可以伪装成 ...

  6. Centos7搭建pptp一键安装脚本

    废话不多说,先上脚本地址:Centos7一键pptp 使用: wget http://files.cnblogs.com/files/wangbin/CentOS7-pptp-host1plus.sh ...

  7. centos shell编程5 LANMP一键安装脚本 lamp sed lnmp 变量和字符串比较不能用-eq cat > /usr/local/apache2/htdocs/index.php <<EOF重定向 shell的变量和函数命名不能有横杠 平台可以用arch命令,获取是i686还是x86_64 curl 下载 第三十九节课

    centos shell编程5  LANMP一键安装脚本 lamp  sed  lnmp  变量和字符串比较不能用-eq  cat > /usr/local/apache2/htdocs/ind ...

  8. L2TP/IPSec一键安装脚本

    本脚本适用环境:系统支持:CentOS6+,Debian7+,Ubuntu12+内存要求:≥128M更新日期:2017 年 05 月 28 日 关于本脚本:名词解释如下L2TP(Layer 2 Tun ...

  9. *** Python版一键安装脚本

    本脚本适用环境:系统支持:CentOS 6,7,Debian,Ubuntu内存要求:≥128M日期:2018 年 02 月 07 日 关于本脚本:一键安装 Python 版 *** 的最新版.友情提示 ...

随机推荐

  1. 我理解的IOC技术在Java和C#中比较分析

    一直想用心写这个系列的文章,其实看得越多,也就越觉得自己在这方面的功力太浅,也就越不想班门弄斧啦,作为一个开篇,我想把这个技术深层次化,在之前的.net的一个MVC系列文章其实已经涉及到了,只是.ne ...

  2. Error : An error occurred while creating the WebJob schedule: Response status code does not indicate success: 409 (Conflict).

    How to fix the error? the answer is simple switch from Free to Standard...

  3. Android中使用Handler造成内存泄露的分析和解决

    什么是内存泄露?Java使用有向图机制,通过GC自动检查内存中的对象(什么时候检查由虚拟机决定),如果GC发现一个或一组对象为不可到达状态,则将该对象从内存中回收.也就是说,一个对象不被任何引用所指向 ...

  4. jQuery ajax的traditional参数的作用///////////////////////////////////zzzzzzzzzzz

    jQuery ajax的traditional参数的作用 i33 发布时间: 2013/04/03 10:05 阅读: 9859 收藏: 9 点赞: 1 评论: 0 一般的,可能有些人在一个参数有多个 ...

  5. TortoiseGit上传项目到GitHub////////////////////////////z

    1.安装msysgit和TortoiseGit : 2.TortoiseGit 设置: (1).确保安装成功: (2).设置用户名和邮箱: 3.登陆github并进入设置页面: 4.添加 SSH Ke ...

  6. Apache2.4开启GZIP功能

    HTTP协议上的GZIP编码是一种用来改进WEB应用程序性能的技术.大流量的WEB站点常常使用GZIP压缩技术来让用户感受更快的速度.这一般是指WWW服务器中安装的一个功能,当有人来访问这个服务器中的 ...

  7. 数据库中老师学生家长表添加自动同意好友自动(AgreeAddingFriend ),默认为True

    数据库中老师学生家长表添加自动同意好友自动(AgreeAddingFriend ),默认为True alter table Sys_User add AgreeAddingFriend bit alt ...

  8. c#制作一个屏幕保护程序

    代码已上传github 实现思路:纯黑窗体去边框,加入标签. 使用Timmer让windows 10标签运动.限制标签的行为. 代码: int deltX = 10;       int deltY ...

  9. opencv的学习笔记5

    总结原博文中的一些边缘检测算子和滤波器.(Canny算子,  Sobel算子,  Laplace算子以及Scharr滤波器) 首先,一般的边缘检测包括三个步骤: 1)滤波:边缘检测的算法主要是基于图像 ...

  10. VB.NET中Form窗体运行时,按F1进入全屏状态

    1.在KeyDown事件中添加: If e.KeyValue = 112 Then Me.WindowState = FormWindowState.Maximized End If 注:1.其中11 ...