添加用户
# useradd weblogic
安装jdk
从oracle官网下载jdk 安装包 , jdk-8u381-linux-x64.tar.gz:
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
已经下载好,详见 软件安装包.zip 中, 然后上传到服务器即可
将下载成功的文件拷贝到指定的安装目录下,比如 /opt
解压 :tar -zxvf jdk-8u381-linux-x64.tar
开始安装
创建ORACLE_HOME
使用root账户创建目录,并将所有权赋予weblogic
# mkdir -p /opt/weblogic/
# chown -R weblogic:weblogic /opt/weblogic
创建wls.rsp和oraInst.loc文件
# su - weblogic
# cd /home/weblogic/
# vi wls.rsp
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
#
MOS_USERNAME=
#
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=
#
SOFTWARE_UPDATES_PROXY_SERVER=
#
SOFTWARE_UPDATES_PROXY_PORT=
#
SOFTWARE_UPDATES_PROXY_USER=
#
SOFTWARE_UPDATES_PROXY_PASSWORD=<SECURE_VALUE>
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/pp/weblogic/wl_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=<SECURE VALUE>
#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=<SECURE VALUE>
#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=
oraInst.loc文件内容:
inventory_loc=/opt/weblogic/oraInventory
inst_group=weblogic
注意:确保 oraInst.loc wls.rsp fmw_12.2.1.4.0_wls_quick.jar 三个文件weblogic用户必须要有读写权限,ORACLE_HOME目录必须为空。
执行安装
# /opt/jdk1.8.0_381/bin/java -jar fmw_12.2.1.4.0_wls_quick.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc
ORACLE_HOME="/opt/weblogic/wl_home"
Launcher log file is /tmp/OraInstall2018-10-25_04-52-09PM/launcher2018-10-25_04-52-09PM.log.
Extracting the installer . . . . Done
Checking if CPU speed is above 300 MHz. Actual 1799.997 MHz Passed
Checking swap space: must be greater than 512 MB. Actual 4095 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 7378 MB Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2018-10-25_04-52-09PM
Log: /tmp/OraInstall2018-10-25_04-52-09PM/install2018-10-25_04-52-09PM.log
Setting ORACLE_HOME to /opt/weblogic/wl_home
*****************************************************
Distribution Name : Oracle Fusion Middleware 12c WebLogic and Coherence Developer
Distribution Version : 12.2.1.4.0
Oracle Inventory : /opt/weblogic/oraInventory
Oracle Home : /opt/weblogic/wl_home
Java Home : /opt/jdk/jdk1.8.0_381
*****************************************************
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_181
Actual Result: 1.8.0_381
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.4.0 completed successfully.
Logs successfully copied to /opt/weblogic/wl_home/cfgtoollogs/oui.
通过py脚本来创建Domain域名
cd /home/weblogic/
vi create_domains.py
创建create_domains.py,添加内容:
#setOption('AutoDeploy','false')
# read simple weblogic server template
readTemplate('/pp/weblogic/wl_home/wlserver/common/templates/wls/wls.jar')
# configure base_domain
cd('/')
set('Name','user_domain')
setOption('DomainName','user_domain')
setOption('JavaHome','/opt/jdk1.8.0_381')
setOption('ServerStartMode','prod')
# configure administration server
cd('Servers/AdminServer')
set('Name','admin_controller')
set('ListenAddress','127.0.0.1')
set('ListenPort',8002)
# create managed server 1
cd('/')
create('username','Server')
cd('/Servers/username')
set('ListenAddress','127.0.0.1')
set('ListenPort',9002)
# create user
cd('/Security/user_domain/User/weblogic')
set('Description','Administrator')
set('Name','wlsadmin')
set('UserPassword','Abc,123.')
# create files & directories
writeDomain('/opt/weblogic/user_domain')
# finish
closeTemplate()
exit()
执行并创建域
# cd /opt/weblogic/wl_home/wlserver/common/bin
# ./wlst.sh /home/weblogic/create_domains.py
启动weblogic
# cd /opt/weblogic/user_domain/bin
前台启动:./startWebLogic.sh
后台启动:nohup ./startWebLogic.sh &