WebLogic 12c CentOS7 静默安装
一、安装前环境准备
1.配置JAVA环境变量
# tar -zxvf jdk-8u191-linux-x64.tar.gz -C /opt # vi /etc/profile/java.sh # Java environment configuratione export JAVA_HOME=/opt/jdk1.8.0_191 export JAVA_BIN=/opt/jdk1.8.0_191/bin export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export JAVA_HOME JAVA_BIN PATH CLASSPATH # source /etc/profile/java.sh
2.创建weblogic用户
# groupadd weblogic # useradd weblogic -g weblogic # passwd weblogic 设置登录密码为:weblogic
3.下载weblogic安装包
# https://www.oracle.com/middleware/technologies/fusionmiddleware-downloads.html 选择"Generic Installer" # unzip fmw_12.2.1.4.0_wls_Disk1_1of1.zip -C /home/weblogic
二、安装weblogic(使用weblogic用户登录执行如下命令)
1.创建响应文件
$ vi /home/weblogic/wls.rsp [ENGINE] #DO NOT CHANGE THIS. Response File Version=1.0.0.0.0 [GENERIC] #Set this to true if you wish to skip software updates DECLINE_AUTO_UPDATES=true #My Oracle Support User Name MOS_USERNAME= #My Oracle Support Password MOS_PASSWORD=<SECURE VALUE> #If the Software updates are already downloaded and available on your local system, then specify the path to the directory where these patches are available and set SPECIFY_DOWNLOAD_LOCATION to true AUTO_UPDATES_LOCATION= #Proxy Server Name to connect to My Oracle Support SOFTWARE_UPDATES_PROXY_SERVER= #Proxy Server Port SOFTWARE_UPDATES_PROXY_PORT= #Proxy Server Username SOFTWARE_UPDATES_PROXY_USER= #Proxy Server Password SOFTWARE_UPDATES_PROXY_PASSWORD=<SECURE VALUE> #The oracle home location. This can be an existing Oracle Home or a new Oracle Home ORACLE_HOME=/home/weblogic/Oracle_Home #The federated oracle home locations. This should be an existing Oracle Home. Multiple values can be provided as comma seperated values FEDERATED_ORACLE_HOMES= #Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence, Complete with Examples. INSTALL_TYPE=WebLogic Server
2.创建初始化环境文件
$ vi /home/weblogic/oraInst.loc inst_group=weblogic inventory_loc=/home/weblogic/oraInventory $ mkdir /home/weblogic/{Oracle_Home,oraInventory}
3.开始安装
$ java -jar fmw_12.2.1.4.0_wls.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc Launcher log file is /tmp/OraInstall2019-10-01_03-44-56PM/launcher2019-10-01_03-44-56PM.log. Extracting the installer . . . . . . . . . . . . . . . Done Checking if CPU speed is above 300 MHz. Actual 2394.474 MHz Passed Checking swap space: must be greater than 512 MB. Actual 1023 MB Passed Checking if this platform requires a 64-bit JVM. Actual 64 Passed (64-bit not required) Checking temp space: must be greater than 300 MB. Actual 1169 MB Passed Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2019-11-04_03-44-56PM Log: /tmp/OraInstall2019-11-01_03-44-56PM/install2019-11-04_03-44-56PM.log Copyright (c) 1996, 2019, Oracle and/or its affiliates. All rights reserved. Reading response file.. Skipping Software Updates Starting check : CertifiedVersions Expected result: One of oracle-6, oracle-7, redhat-7, redhat-6, SuSE-11, SuSE-12, SuSE-15 Actual Result: redhat-null Check complete. The overall result of this check is: Passed CertifiedVersions Check: Success. Starting check : CheckJDKVersion Expected result: 1.8.0_191 Actual Result: 1.8.0_191 Check complete. The overall result of this check is: Passed CheckJDKVersion Check: Success. Validations are enabled for this session. Verifying data Copying Files Percent Complete : 10 Percent Complete : 20 Percent Complete : 30 Percent Complete : 40 Percent Complete : 50 Percent Complete : 60 Percent Complete : 70 Percent Complete : 80 Percent Complete : 90 Percent Complete : 100 The installation of Oracle Fusion Middleware 12c WebLogic Server and Coherence 12.2.1.4.0 completed successfully. Logs successfully copied to /home/weblogic/oraInventory/logs.
4.设置环境变量
$ sh /home/weblogic/Oracle_Home/wlserver/server/bin/setWLSEnv.sh CLASSPATH=/opt/jdk1.8.0_191/lib/tools.jar:/home/weblogic/Oracle_Home/wlserver/modules/features/wlst.wls.classpath.jar: PATH=/home/weblogic/Oracle_Home/wlserver/server/bin:/home/weblogic/Oracle_Home/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/opt/jdk1.8.0_191/jre/bin:/opt/jdk1.8.0_191/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/weblogic/Oracle_Home/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin Your environment has been set.
5.创建Domain域名
$ vi /home/weblogic/create_domains.py readTemplate('/home/weblogic/Oracle_Home/wlserver/common/templates/wls/wls.jar') cd('Servers/AdminServer') set('ListenAddress','0.0.0.0') //weblogic服务器IP set('ListenPort', 7001) cd('../..') cd('/Security/base_domain/User/weblogic') //weblogic登录用户名 cmo.setPassword('weblogic@123') //weblogic登录密码 setOption('OverwriteDomain', 'true') setOption('ServerStartMode', 'prod') writeDomain('/home/weblogic/Oracle_Home/user_projects/domains/base_domain') closeTemplate() exit() $ sh /home/weblogic/Oracle_Home/wlserver/common/bin/wlst.sh /home/weblogic/create_domains.py
三、启动weblogic(使用weblogic用户登录执行如下命令)
1.配置启动时免密
$ vi /home/weblogic/Oracle_Home/user_projects/domains/base_domain/bin/startWebLogic.sh 增加如下内容 # Weblogic Account number information WLS_USER="weblogic" export WLS_USER WLS_PW="weblogic@123" export WLS_PW $ mkdir /home/weblogic/Oracle_Home/user_projects/domains/base_domain/servers/AdminServer/security $ vi /home/weblogic/Oracle_Home/user_projects/domains/base_domain/servers/AdminServer/security/boot.properties username=weblogic password=weblogic@123
2.启动weblogic服务
$ nohup sh /home/weblogic/Oracle_Home/user_projects/domains/base_domain/bin/startWebLogic.sh &
访问http://服务器IP:7001/console,使用创建Domain域名时配置的账号登录
少壮不努力,老大干IT。
一入运维深似海,从此不见彼岸花。