我是靠谱客的博主 勤奋大白,这篇文章主要介绍nginx+tomcat+resin+jdk一键自动化安装脚本(4--resin安装脚本),现在分享给大家,希望可以做个参考。

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash # this shell will be installed resin*.tar.gz #author: wangjiulong #global variables resin_pkg=`cat $tmp_resin` resin_tar=`cat $tmp_resin | awk -F.tar.gz '{print $1}'` resin_num=`cat $tmp_resin | awk -F.tar.gz '{print $1}' | awk -F- '{print $2}'` resin_path=/usr/local/resin datef(){ date "+%Y/%m/%d %H:%M" ; } #custom log print_log(){         if [[ -d $log_dir  ]];then                 echo "[$(datef)]  $1" >> $log         else                 echo "[$(datef)] log path does not exist,created first" >>$log                 mkdir -p $log_dir                 echo "[$(datef)]  $1" >> $log         fi } #检查本机是否安装了jdk,如果已经安装了,则继续安装tomcat,不然先安装jdk,再去安装tomcat check_jdk_install(){         jdk_local_path=/data/java         jdk_local_version=`java -version > /dev/null 2>&1;echo $?`         if [ $jdk_local_version -eq 0  ];then                 print_log "本机jdk已经安装,可以安装继续安装resin"                 install_resin         else                 #不管是否之前安装了jdk,默认安装jdk1.7的                 echo "jdk-1.7.0_17.tar.gz" > $tmp_jdk                 source ./install_jdk.sh                 source /etc/profile                 print_log "jdk-1.7已经安装,接下来安装resin"                 install_resin         fi } install_resin(){         #resin安装时的参数,请根据自己业务的需求,做相应的修改         cd $tar_dir         tar zxf $resin_pkg         cd $resin_tar         ./configure --prefix=/usr/local/resin --enable-jni --enable-64bit --enable-linux-smp --with-java-home=/data/java/jdk && make && make install         if [[ $? != "0" ]];then                 echo "[$(datef)] ins_resin(): install error!"                 exit         fi         #判断用户安装的resin的版本,不同的版本,替换不同的配置文件。         case $resin_num in                 4.0.23)                 print_log "复制替换4.0.23版的resin文件"                 cp -fv $file_dir/resin_pro_4.0.23.xml /usr/local/resin/conf/resin.xml                 cp -fv $file_dir/resin_pro_4.0.23 /etc/init.d/resin                 ;;                 3.0.21)                 print_log "复制替换3.0.21版的resin文件"                 cp -fv $file_dir/resin.conf /usr/local/resin/conf/resin.conf                 cp -fv $file_dir/resin /etc/init.d/resin                 ;;                 *)                 ;;         esac         cp -fv $file_dir/license.jar /usr/local/resin/lib         chkconfig --add resin         chmod 755 /etc/init.d/resin         [ ! -d  /data/log/resin ] && mkdir -m777 -p /data/log/resin         add_user } add_user(){         print_log "**************** Begin change www user mode *********************"         if ! grep "^www" /etc/passwd         then                 groupadd www                 useradd -g www -s /bin/bash -d /data/www www         fi                 [[ -d /usr/local/resin ]] && chown -R www:www /usr/local/resin         print_log "*************** End change www user mode ************************"         finished } finished(){         # install complete         print_log ""         print_log "###########################################################"         print_log "# [$(datef)] congratulagions!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"         print_log "# [$(datef)] don't forget to modify configuration files!!!"         print_log "# [$(datef)] based on your system resources like mem size "         print_log "###########################################################"         print_log "" } check_jdk_install

    

转载于:https://my.oschina.net/u/2322690/blog/611329

最后

以上就是勤奋大白最近收集整理的关于nginx+tomcat+resin+jdk一键自动化安装脚本(4--resin安装脚本)的全部内容,更多相关nginx+tomcat+resin+jdk一键自动化安装脚本(4--resin安装脚本)内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(58)

评论列表共有 0 条评论

立即
投稿
返回
顶部