tomcat7+jdk1.8一键安装脚本
#!/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一键安装脚本的更多相关文章
- jdk1.8一键安装脚本(linux环境)
1.下载jdk安装包和安装脚本 下载地址:https://pan.baidu.com/s/1bo6ADQ3 其中包括: jdk安装包:jdk-8u151-linux-x64.tar.gz jdk一键安 ...
- CentOS 6、7下pptp vpn一键安装脚本
之前有折腾过<CentOS 6.7下IPSEC/L2TP VPN一键安装脚本>,不稳定.不支持IOS,因此换成pptp,并已经添加到<lnmp一键安装包>.这个脚本可以单独使用 ...
- LAMP最新源码一键安装脚本
Linux+Apache+MySQL+PHP (脚本可以选择是否安装+Pureftpd+User manager for PureFTPd+phpMyAdmin+memcache),添加虚拟主机请执行 ...
- LNMP、LAMP、LANMP一键安装脚本(定期更新)[转]
这个脚本是使用shell编写,为了快速在生产环境上部署LNMP/LAMP/LANMP(Linux.Nginx/Tengine.MySQL/MariaDB/Percona.PHP),适用于CentOS/ ...
- SSR服务端一键安装脚本
支持新协议混淆,SSR服务端一键安装脚本 Shadowsocks-R 是项目 shadowsocks 的增强版,用于方便地产生各种协议接口.实现为在原来的协议外套一层编码和解码接口,不但可以伪装成 ...
- Centos7搭建pptp一键安装脚本
废话不多说,先上脚本地址:Centos7一键pptp 使用: wget http://files.cnblogs.com/files/wangbin/CentOS7-pptp-host1plus.sh ...
- 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 ...
- L2TP/IPSec一键安装脚本
本脚本适用环境:系统支持:CentOS6+,Debian7+,Ubuntu12+内存要求:≥128M更新日期:2017 年 05 月 28 日 关于本脚本:名词解释如下L2TP(Layer 2 Tun ...
- *** Python版一键安装脚本
本脚本适用环境:系统支持:CentOS 6,7,Debian,Ubuntu内存要求:≥128M日期:2018 年 02 月 07 日 关于本脚本:一键安装 Python 版 *** 的最新版.友情提示 ...
随机推荐
- (Java) 2014年1月1日减一个月涉及时间与字符的转换
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; impor ...
- H5唤起APP一些坑
$(function () { function _openAppUrl(appUrl){ var ua = navigator.userAgent.toLocaleLowerCase(), open ...
- Magento后台简单更换favicon.ico
刚才需要更换网站的favicon.ico,就是浏览器url前面的那个小图标. 网上稍微搜搜一下,然后就震惊了,号多方法是替换文件的方法,而且文件散步在网站的各个角落. 其实,后台是有直接上传更换的方法 ...
- 判断访问的是移动端还是PC端,如果是移动端跳转页面
<script type="text/javascript"> var mobileAgent = new Array("iphone", &quo ...
- docker-compose编写(英文)
原文地址:https://docker.github.io/compose/compose-file/ Compose file reference The Compose file is a YAM ...
- java.sql.SQLException: Incorrect key file for table 'C:\Windows\TEMP\#sql578_6e2_68d.MYI'; try to repair it
java.sql.SQLException: Incorrect key file for table 'C:\Windows\TEMP\#sql578_6e2_68d.MYI'; try to re ...
- 几个js函数
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- 在Excel表格中输入一大段文字
1.有时为了注释的需要,在excel中需要输入一大段文字,这时候可以使用—视图-工具-绘图,然后选择下面的文本框,即可自定义文本框大小,如需要文本框和表格边框完全重合,在鼠标画文本框时按住 Alt键.
- git push :推送本地更改到远程仓库的三种模式
摘要:由于在git push过程中,no-fast-forward 的push会被拒绝,如何解决git push失败的问题?这里面有三种方法,分别会形成merge形式的提交历史,线性形式的提交历史,覆 ...
- MySQL的create table as 与 like区别
对于MySQL的复制相同表结构方法,有create table as 和create table like 两种,区别是什么呢? ? 1 create table t2 as select * fro ...