WebLogic 12c CentOS7 静默安装

JDK版本:1.8.0_161

Weblogic版本:12.2.1.3

 

一、前期准备

1、创建用户和组

# groupadd web

# useradd -g web weblogic

# passwd weblogic

Changing password for user weblogic.

New UNIX password:

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

2、JDK安装

在oralce官网下载jdk

  

解压并创建jdk目录

  ~# tar jdk-89121-linux-x64.tar.gz

  ~# mkdir /usr/lib/jvm

  ~# cp -R jdk1.8.0_121 /usr/lib/jvm

添加环境变量

  在/etc/bash.bashrc末尾添加以下内容后重启系统

  export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_121  
  export JRE_HOME=${JAVA_HOME}/jre 
  export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib 
  export PATH=${JAVA_HOME}/bin:$PATH

验证JDK

  ~# java -version

  

 

二、开始安装

1、创建ORACLE_HOME

使用root账户创建目录,并将所有权赋予weblogic

# mkdir -p /weblogic/bea

# chown -R weblogic /weblogic

 

2、创建weblogic_install_dir目录,并将安装包复制到目录下

# su weblogic

# cd ~

# mkdir weblogic_install_dir

# cp /tmp/fmw_12.2.1.3.0_wls_quick.jar /home/weblogic/weblogic_install_dir/

 

3、创建wls.rsp和oraInst.loc文件

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=/weblogic/bea

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

INSTALL_TYPE=WebLogic Server

oraInst.loc文件内容:

inventory_loc=/home/weblogic/oraInventory

inst_group=weblogic

注意:确保 oraInst.loc  wls.rsp  fmw_12.2.1.3.0_wls_quick.jar 三个文件weblogic用户必须要有读写权限

 

4、开始安装

 # java -jar fmw_12.2.1.3.0_wls_quick.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc ORACLE_HOME="/weblogic/bea"

[weblogic@localhost weblogic_install_dir]$ java -jar fmw_12.2.1.3.0_wls_quick.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc 
Launcher log file is /tmp/OraInstall2018-04-08_02-08-58AM/launcher2018-04-08_02-08-58AM.log.
Extracting the installer . . . . Done
Checking if CPU speed is above 300 MHz.   Actual 2806.094 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 2047 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 34095 MB    Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2018-04-08_02-08-58AM
Log: /tmp/OraInstall2018-04-08_02-08-58AM/install2018-04-08_02-08-58AM.log

*****************************************************


Distribution Name : Oracle Fusion Middleware 12c WebLogic and Coherence Developer
Distribution Version : 12.2.1.3.0

Oracle Inventory : /home/weblogic/oraInventory

Oracle Home : /home/weblogic/weblogic_install_dir/wls12213
Java Home : /usr/lib/jvm/jdk1.8.0_161

Note: Oracle Home not supplied (defaulted to <present working dir>/wls12213)

*****************************************************

Copyright (c) 1996, 2017, 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
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_131
Actual Result: 1.8.0_161
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 and Coherence Developer 12.2.1.3.0 completed successfully.
Logs successfully copied to /home/weblogic/weblogic_install_dir/wls12213/cfgtoollogs/oui.
View Code

  

5、设置环境变量

方式1:

# export MW_HOME="/weblogic/bea"

# export WL_HOME="/weblogic/bea/oracle_common"

# cd /home/weblogic/weblogic_install_dir/wls12213/oracle_common/common/bin

# ./commEnv.sh

方式2(推荐):

# sh /weblogic/bea/wlserver/server/bin/setWLSEnv.sh

 

6、创建Domain域名

方式1:通过命令行交互创建

[weblogic@localhost bea]$ cd /home/weblogic/weblogic_install_dir/wls12213/wlserver/common/bin
[weblogic@localhost bin]$ ./wlst.sh 
WARNING: This is a deprecated script. Please invoke the wlst.sh script under oracle_common/common/bin.

Initializing WebLogic Scripting Tool (WLST) ...

Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> readTemplate('/weblogic/bea/wlserver/common/templates/wls/wls.jar')
WARNING: The readTemplate is deprecated. Use selectTemplate followed by loadTemplates in place of readTemplate.
wls:/offline/base_domain>cd('Servers/AdminServer')
wls:/offline/base_domain/Server/AdminServer>set('ListenAddress','')
wls:/offline/base_domain/Server/AdminServer>set('ListenPort',7001)
wls:/offline/base_domain/Server/AdminServer>cd('../..')
wls:/offline/base_domain>cd('Security/base_domain/User/weblogic')
wls:/offline/base_domain/Security/base_domain/User/weblogic>cmo.setPassword('weblogic123')
wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption('OverwriteDomain','true')
wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/weblogic/bea/user_projects/domains/base_domain')
wls:/offline/base_domain/Security/base_domain/User/weblogic>closeTemplate()
wls:/offline>exit()

Exiting WebLogic Scripting Tool.

方式2:通过py脚本来创建

创建create_domains.py,添加内容:

readTemplate('/weblogic/bea/wlserver/common/templates/wls/wls.jar')
cd('Servers/AdminServer')
set('ListenAddress','ip地址')
set('ListenPort', 7001)
cd('../..') cd(
'/Security/base_domain/User/weblogic') cmo.setPassword('weblogic123') setOption('OverwriteDomain', 'true') setOption('ServerStartMode', 'prod') writeDomain('/weblogic/bea/user_projects/domains/base_domain') closeTemplate() exit()
执行安装 ./wlst.sh  ./create_domains.py

 

7、启动weblogic

[weblogic@localhost bin]$ cd /weblogic/bea/user_projects/domains/base_domain/bin/
[weblogic@localhost bin]$ ./startWebLogic.sh
[weblogic@localhost bin]$ ./startWebLogic.sh 
.
.
JAVA Memory arguments: -Xms256m -Xmx512m -XX:CompileThreshold=8000
.
CLASSPATH=/usr/lib/jvm/jdk1.8.0_161/lib/tools.jar:/home/weblogic/weblogic_install_dir/wls12213/wlserver/server/lib/weblogic.jar:/home/weblogic/weblogic_install_dir/wls12213/wlserver/../oracle_common/modules/thirdparty/ant-contrib-1.0b3.jar:/home/weblogic/weblogic_install_dir/wls12213/wlserver/modules/features/oracle.wls.common.nodemanager.jar::/home/weblogic/weblogic_install_dir/wls12213/wlserver/common/derby/lib/derbynet.jar:/home/weblogic/weblogic_install_dir/wls12213/wlserver/common/derby/lib/derbyclient.jar:/home/weblogic/weblogic_install_dir/wls12213/wlserver/common/derby/lib/derby.jar:.:/usr/lib/jvm/jdk1.8.0_161/lib:/usr/lib/jvm/jdk1.8.0_161/jre/lib
.
PATH=/weblogic/bea/user_projects/domains/base_domain/bin:/home/weblogic/weblogic_install_dir/wls12213/wlserver/server/bin:/home/weblogic/weblogic_install_dir/wls12213/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.9.8.0.0/apache-ant-1.9.8/bin:/usr/lib/jvm/jdk1.8.0_161/jre/bin:/usr/lib/jvm/jdk1.8.0_161/bin:/usr/lib/jvm/jdk1.8.0_161/bin:/usr/lib/jvm/jdk1.8.0_161/bin:/usr/lib/jvm/jdk1.8.0_161/bin:/usr/lib/jvm/jdk1.8.0_161/bin:/usr/lib/jvm/jdk1.8.0_161/bin:/usr/lib/jvm/jdk1.8.0_161/bin:/usr/lib/jvm/jdk1.8.0_161/bin:/usr/lib/jvm/jdk1.8.0_161/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
.
***************************************************
*  To start WebLogic Server, use a username and   *
*  password assigned to an admin-level user.  For *
*  server administration, use the WebLogic Server *
*  console at http://hostname:port/console        *
***************************************************
Starting WLS with line:
/usr/lib/jvm/jdk1.8.0_161/bin/java -server   -Xms256m -Xmx512m -XX:CompileThreshold=8000 -cp /home/weblogic/weblogic_install_dir/wls12213/wlserver/server/lib/weblogic-launcher.jar -Dlaunch.use.env.classpath=true -Dweblogic.Name=AdminServer -Djava.security.policy=/home/weblogic/weblogic_install_dir/wls12213/wlserver/server/lib/weblogic.policy  -Djava.system.class.loader=com.oracle.classloader.weblogic.LaunchClassLoader  -javaagent:/home/weblogic/weblogic_install_dir/wls12213/wlserver/server/lib/debugpatch-agent.jar -da -Dwls.home=/home/weblogic/weblogic_install_dir/wls12213/wlserver/server -Dweblogic.home=/home/weblogic/weblogic_install_dir/wls12213/wlserver/server      weblogic.Server
<Apr 8, 2018 3:27:22 AM CST> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.> 
<Apr 8, 2018 3:27:22 AM CST> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.> 
<Apr 8, 2018 3:27:23 AM CST> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.161-b12 from Oracle Corporation.> 
<Apr 8, 2018 3:27:23 AM CST> <Info> <RCM> <BEA-2165021> <"ResourceManagement" is not enabled in this JVM. Enable "ResourceManagement" to use the WebLogic Server "Resource Consumption Management" feature. To enable "ResourceManagement", you must specify the following JVM options in the WebLogic Server instance in which the JVM runs: -XX:+UnlockCommercialFeatures -XX:+ResourceManagement.> 
<Apr 8, 2018 3:27:23 AM CST> <Info> <Management> <BEA-141107> <Version: WebLogic Server 12.2.1.3.0 Thu Aug 17 13:39:49 PDT 2017 1882952> 
<Apr 8, 2018 3:29:13 AM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
<Apr 8, 2018 3:29:13 AM CST> <Info> <WorkManager> <BEA-002900> <Initializing self-tuning thread pool.> 
<Apr 8, 2018 3:29:13 AM CST> <Info> <WorkManager> <BEA-002942> <CMM memory level becomes 0. Setting standby thread pool size to 256.> 
<Apr 8, 2018 3:29:14,260 AM CST> <Notice> <Log Management> <BEA-170019> <The server log file weblogic.logging.FileStreamHandler instance=1499635169
Current log file=/weblogic/bea/user_projects/domains/base_domain/servers/AdminServer/logs/AdminServer.log
Rotation dir=/weblogic/bea/user_projects/domains/base_domain/servers/AdminServer/logs
 is opened. All server side log events will be written to this file.> 
<Apr 8, 2018 3:29:14,305 AM CST> <Notice> <Security> <BEA-090946> <Security pre-initializing using security realm: myrealm> 
<Apr 8, 2018 3:33:05,270 AM CST> <Notice> <Security> <BEA-090947> <Security post-initializing using security realm: myrealm> 
<Apr 8, 2018 3:33:06,111 AM CST> <Notice> <Security> <BEA-090082> <Security initialized using administrative security realm: myrealm> 
<Apr 8, 2018 3:33:06,631 AM CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://127.0.0.1:7001/jndi/weblogic.management.mbeanservers.runtime.> 
<Apr 8, 2018 3:39:23,107 AM CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://127.0.0.1:7001/jndi/weblogic.management.mbeanservers.domainruntime.> 
<Apr 8, 2018 3:39:23,116 AM CST> <Notice> <JMX> <BEA-149512> <JMX Connector Server started at service:jmx:iiop://127.0.0.1:7001/jndi/weblogic.management.mbeanservers.edit.> 
<Apr 8, 2018 3:40:58,482 AM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY.> 
<Apr 8, 2018 3:40:58,482 AM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING.> 
<Apr 8, 2018 3:40:58,530 AM CST> <Notice> <Log Management> <BEA-170036> <The Logging monitoring service timer has started to check for logged message counts every 30 seconds.> 
<Apr 8, 2018 3:40:58,827 AM CST> <Notice> <Log Management> <BEA-170027> <The server has successfully established a connection with the Domain level Diagnostic Service.> 
<Apr 8, 2018 3:40:59,094 AM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to ADMIN.> 
<Apr 8, 2018 3:40:59,171 AM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RESUMING.> 
<Apr 8, 2018 3:40:59,255 AM CST> <Warning> <Server> <BEA-002611> <The hostname "localhost", maps to multiple IP addresses: 127.0.0.1, 0:0:0:0:0:0:0:1.> 
<Apr 8, 2018 3:40:59,268 AM CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Apr 8, 2018 3:40:59,269 AM CST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 0:0:0:0:0:0:0:1%lo:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Apr 8, 2018 3:41:00,909 AM CST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 172.16.65.130:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Apr 8, 2018 3:41:00,909 AM CST> <Notice> <WebLogicServer> <BEA-000331> <Started the WebLogic Server Administration Server "AdminServer" for domain "base_domain" running in development mode.> 
<Apr 8, 2018 3:41:00,909 AM CST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Apr 8, 2018 3:41:00,909 AM CST> <Notice> <Server> <BEA-002613> <Channel "Default[2]" is now listening on 0:0:0:0:0:0:0:1%lo:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Apr 8, 2018 3:41:00,910 AM CST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 172.16.65.130:7001 for protocols iiop, t3, ldap, snmp, http.> 
<Apr 8, 2018 3:41:00,912 AM CST> <Notice> <WebLogicServer> <BEA-000360> <The server started in RUNNING mode.> 
<Apr 8, 2018 3:41:00,921 AM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING.> 

 

8、验证

http://weblogic-ip:7001/console

 

Weblogic启用时需要输入用户密码

启动WebLogic时需要输入该Domain的用户名和密码,而在生产环境中,一般会要求不要在每次启动时都输入用户名密码,简化操作的复杂度,而通过一些简单的配置就可以达到这样的效果,通常的做法有两种:
 
1、修改WebLogic的启动脚本,在里面填入用户名和密码
2、增加boot.properties文件,保存用户名和密码(推荐方式)
 
在此将详细介绍两种方法的操作步骤。
 
1、修改WebLogic的启动脚本,即修改startWebLogic.sh,增加如下内容:
WLS_USER="weblogic"
export WLS_USER
WLS_PW="password"
export WLS_PW
 
2、保存用户名和密码信息到boot.properties文件中,在AdminServer和ManagedServer的目录下(例如:/home/oracle/u01/Middleware/user_projects/domains/portal_domain/servers/AdminServer/),新建security文件夹,并在其中创建boot.properties文件,填入如下内容:
username=weblogic
password=password
(待服务器启动一次之后会自动进行加密)
 
重新启动AdminServer,服务器正常启动,且发现boot.properties文件中的信息已经被加密。

 

 

posted @ 2018-04-07 20:37  Vincen_shen  阅读(7315)  评论(0编辑  收藏  举报