日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux java静默安装软件,linux纯净版脚本执行安装JDK、静默安装Weblogic

發(fā)布時間:2024/9/30 linux 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux java静默安装软件,linux纯净版脚本执行安装JDK、静默安装Weblogic 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

一、首先準備JDK、weblogic安裝包,本次使用的安裝包版本為jdk-7u80-linux-x64.rpm、fmw_12.1.3.0.0_wls.jar,以此為例

進行JDK腳本安裝,需要用ROOT用戶

vi jdk_create.sh

#!/bin/bash

#檢查JDK安裝包是否存在

if [ -f jdk-*.rpm ]; then

echo '下面開始安裝JDK'

sleep 1

rpm -ivh jdk-*.rpm

#將JDK添加到全局變量中

cat >>/etc/profile << EOF

export JAVA_HOME=/usr/java/jdk1.7.0_80

export JRE_HOME=/usr/java/jdk1.7.0_80/jre

export CLASSPATH=\$CLASSPATH:\$JAVA_HOME/lib:\$JAVA_HOME/jre/lib

export PATH=\$JAVA_HOME/bin:\$JRE_HOME/bin:\$PATH

EOF

source /etc/profile #加載全局變量

java -version #查看JDK是否安裝成功,也可以設(shè)置if語句進行驗證

#java -version

#if [ $? -eq 0 ] then

# echo 'jdk is create successful!'

echo 'Next we will change the conf!'

sed -i 's/file:\/dev\/urandom/file:\/dev\/.\/urandom/g' /usr/java/jdk1.7.0_80/jre/lib/security/java.security

if [ $? -eq 0 ]; then

echo 'conf is changed over!'

else

echo 'conf is not changed!please changed by yourself!'

fi

else

echo '沒有jdk安裝包!'

exit

fi

執(zhí)行 sh jdk_create.sh

二、開始創(chuàng)建weblogic用戶組、用戶和家目錄,需要root用戶

vi user_add.sh

echo '下面開始安裝weblogic!'

read -p '請輸入應(yīng)用用戶群組:' group

echo '群組名為:$group'

read -p '請輸入用戶名:' user

echo '應(yīng)用用戶名為:$user'

read -p '請輸入用戶密碼:' password

echo '用戶密碼為:$password'

read -p '請輸入用戶家目錄:' path

echo '家目錄為:$path'

groupadd $group

useradd -g $group -m -d $home_path $user

chown -R weblogic:weblogic /home/weblogic/

添加用戶可以手動添加,這個腳本只是保留批量的時候能夠用到

三、下面進入正題,進行靜默安裝weblogic已經(jīng)靜默安裝domain 執(zhí)行此腳本使用weblogic用戶

vi weblogic_create.sh

#!/bin/bash

#檢查WEBLOGIC安裝包是否存在

if [ -f fmw*.jar ]; then #判斷是否有軟件包

#編寫靜默安裝weblogic配置文件

cat >/home/weblogic/oraInst.loc <

#Oracle Installer Location File Location

inst_group=$group

inventory_loc=/home/weblogic/oraInventory

EOF

echo -e '\e[32;1m[oraInst.loc配置文件已經(jīng)完成]\e[0m'

read -p '請輸入ORACLE_HOME路徑(/home/weblogic/Oracle):' home

#編寫靜默安裝weblogic配置文件

cat >/home/weblogic/wls.rsp <

[ENGINE]

#DO NOT CHANGE THIS.

Response File Version=1.0.0.0.0

[GENERIC]

#The oracle home location. This can be an existing Oracle Home or a new Oracle Home

ORACLE_HOME=$home

#Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence, Complete with Examples.

INSTALL_TYPE=WebLogic Server

#Provide the My Oracle Support Username. If you wish to ignore Oracle Configuration Manager configuration provide empty string for user name.

MYORACLESUPPORT_USERNAME=

#Provide the My Oracle Support Password

MYORACLESUPPORT_PASSWORD=

#Set this to true if you wish to decline the security updates. Setting this to true and providing empty string for My Oracle Support username will ignore the Oracle Configuration Manager configuration

DECLINE_SECURITY_UPDATES=true

#Set this to true if My Oracle Support Password is specified

SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

#Provide the Proxy Host

PROXY_HOST=

#Provide the Proxy Port

PROXY_PORT=

#Provide the Proxy Username

PROXY_USER=

#Provide the Proxy Password

PROXY_PWD=

#Type String (URL format) Indicates the OCM Repeater URL which should be of the format [scheme[Http/Https]]://[repeater host]:[repeater port]

COLLECTOR_SUPPORTHUB_URL=

EOF

echo -e '\e[32;1m[wls.rsp配置文件已經(jīng)完成]\e[0m'

if [ -f '/home/weblogic/wls.rsp' ]; then #判斷編寫的配置文件是否存在

echo -e "\e[32;1m[You can check /tmp/weblogic.log]\e[0m"

java -jar fmw_12.1.3.0.0_wls.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc >/tmp/weblogic.log

if [ -d $home ]; then #通過手動輸入可以設(shè)定控制臺賬號密碼端口號,如果是批量創(chuàng)建可以將賬號密碼端口號進行固定,根據(jù)需求改動

mkdir -p $home/user_projects/domains/

read -p 'Console控制臺賬號:' console_user

read -p 'Console控制臺密碼:' console_passwd

read -p 'weblogic監(jiān)聽端口號:' port1

read -p 'weblogic_ssl監(jiān)聽端口號:' port2

#根據(jù)變量創(chuàng)建安裝domain的配置文件

#指定JDK路徑需要手動更改JavaHome

#通過變量$port1指定weblogic監(jiān)聽端口

#通過變量$port2指定SSL監(jiān)聽端口,此項可省略,如果省略需要把上面變量注釋掉

#指定控制臺賬號密碼$console_passwd

#指定安裝路徑

cat >/home/weblogic/create_domain.rsp <

read template from "/home/weblogic/Oracle/wlserver/common/templates/wls/wls.jar";

set JavaHome "/usr/java/jdk1.7.0_80";

set ServerStartMode "dev";

find Server "AdminServer" as AdminServer;

set AdminServer.ListenAddress "";

set AdminServer.ListenPort "$port1";

set AdminServer.SSL.Enabled "true";

set AdminServer.SSL.ListenPort "$port2";

find User "weblogic" as u1;

set u1.password "$console_passwd";

write domain to "/home/weblogic/Oracle/user_projects/";

close template;

EOF

#通過配置文件create_domain.rsp進行域的靜默安裝

sh /home/weblogic/Oracle/wlserver/common/bin/config.sh -mode=silent -silent_script=/home/weblogic/create_domain.rsp -logfile=/home/weblogic/create_domain.log

fi

else

echo 'No wls.rsp in the path!'

exit

fi

else

echo '沒有安裝包!'

exit

fi

本次腳本里面編寫配置文件用的是EOF格式,也可以用echo格式添加配置文件,哪種方式?jīng)]有區(qū)別。

腳本編寫僅僅是為了打發(fā)時間,如有問題或建議歡迎留言,勿噴!

總結(jié)

以上是生活随笔為你收集整理的linux java静默安装软件,linux纯净版脚本执行安装JDK、静默安装Weblogic的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。