1.创建用户
1)创建管理用户weblogic ,并添加密码 (root)
useradd weblogic
password weblogic
2)weblogic自定义配置 (weblogic)
~/.bash_profile,
umask 002
ulimit -c unlimited (不限制core文件的大小)
cd <domain路径 >(本人在根目录创建/app )
2.安装jdk
1) 安装jdk1.8.0_133 (root)
如果没有/usr/java/请创建(或者自定义安装目录)
tar -zxvf jdk-8u133-linux-x64.tar.gz -C /usr/java/
2)配置java环境变量 :(weblogic )
vi ~/.bash_profile
export PATH
export JAVA_HOME=/usr/java/jdk1.8.0_333
export JRE_HOME=/usr/java/jdk1.8.0_333/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export PATH=$JAVA_HOME/bin:$PATH
重新加载
source ~/.bash_profile
3.安装weblogic12c (weblogic)
1)创建初始化文件
mkdir /app/oraInventory
mkdir /app/install
cd /app/install
vi oraInst.loc
inventory_loc=/weblogic/oraInventory 产品清单目录;注意不能放在 weblogic安装目录下,要保证安装目录为空
#用户的组名称,根据实际的修改
inst_group=weblogic
2)创建响应文件(注意每行头部不能有空格)
vi wls.rsp
[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
[GENERIC]
#weblogic的安装路径
ORACLE_HOME=/app/weblogic
#Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence, Complete with Examples.
INSTALL_TYPE=WebLogic Server
DECLINE_SECURITY_UPDATES=true
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
3)安装
java -jar fmw_12.2.1.4.0.0_wls.jar -silent -responseFile /app/install/wls.rsp -invPtrLoc /app/install/oraInst.loc
注意:初始化文件和响应文件一定要是全路径,(自定义的)。
安装中耐心等待,出现Percent Complete : 100时安装完成安装信息如下
[weblogic@localhost app]$ java -jar fmw_12.2.1.4.0_wls.jar -silent -responseFile /weblogic/install/wls.rsp -invPtrLoc /weblogic/install/oraInst.loc
Launcher log file is /tmp/OraInstall2017-09-01_03-19-37PM/launcher2017-09-01_03-19-37PM.log.
Extracting the installer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Done
Checking if CPU speed is above 300 MHz. Actual 2711.997 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 11672 MB Passed
Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2017-09-01_03-19-37PM
Log: /tmp/OraInstall2017-09-01_03-19-37PM/install2017-09-01_03-19-37PM.log
Copyright (c) 1996, 2016, 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-6.4
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.
Starting check : CheckJDKVersion
Expected result: 1.8.0_101
Actual Result: 1.8.0_131
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
Visit http://www.oracle.com/support/policies.html for Oracle Technical Support policies.
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 /weblogic/oraInventory/logs.
4.创建domain
1)创建domain前,在/app/weblogic/oracle_common/common/bin/config.sh 中添加随机数,加快domain创建,不加也可以。
JVM_ARGS="-Djava.security.egd=file:///dev/urandom -Dpython.cachedir=/tmp/cachedir ${JVM_D64} ${UTILS_MEM_ARGS} ${SECURITY_JVM_ARGS} ${CONFIG_JVM_ARGS}"
2)采用wlst脚本来建立domain
注:过程可能较慢耐心等待。
vi create_domain.py
readTemplate('/weblogic/weblogic/wlserver/common/templates/wls/wls.jar')
cd('Servers/AdminServer')
set('ListenPort',7001)
cd('/')
cd('Security/base_domain/User/weblogic')
#如果需要修改管理员用户名为weblogic,则需要cmo.setName('weblogic')
cmo.setName('weblogic')
cmo.setPassword('weblogic123')
setOption('ServerStartMode','prod')
setOption('OverwriteDomain','true')
writeDomain('/weblogic/weblogic/user_projects/proddomain')
#自定义的domin路径
closeTemplate()
exit()
(以上脚本也可以执行wlst.sh后,一条条执行create_domain.py里的命令)
脚本生成domain
sh /weblogic/weblogic/oracle_common/common/bin/wlst.sh create_domain.py
3)安装信息
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Exiting WebLogic Scripting Tool.
如果你不装补丁的情况下,到这已经结束了!!!!!!!(weblogic的补丁需要自己去官方下载,如果没有的的话自己看看能不能下载到吧!这个涉及到权限问题所以不能给大家提供补丁包,请谅解!)
5.打补丁
1)查询当前补丁
sh /app/weblogic/OPatch/opatch lsinventory
PS:一般情况下weblogic12.2.1.4自带的OPatch版本比较低 所以要升级最新的OPatch(也需要自己下载的)
2)升级opatch
mkdir /app/weblogic/PATCH_TOP
unzip -d /app/weblogic/PATCH_TOP p28186730_139426_Generic.zip
cd /app/weblogic/PATCH_TOP/6880880
/usr/java/jdk1.8.0_333/bin/java -jar opatch_generic.jar -silent oracle_home=/app/weblogic
2)打补丁
unzip -d /weblogic/weblogic/PATCH_TOP p33416868_122140_Generic.zip
cd /app/weblogic/PATCH_TOP/33416868
sh /app/weblogic/OPatch/opatch apply
6.优化
1)修改句柄数
vim /etc/security/limits.conf (root即可)
wlsoper hard nofile 10240
wlsoper soft nofile 10240
2)domain相关配置
(1)添加domain随机数,指定编码方式
vi /app/weblogic/user_projects/domains/testdomain/bin/setDomainEnv.sh
export JAVA_OPTIONS="${JAVA_OPTIONS} -Dfile.encoding=utf-8 -Djava.security.egd=file:///dev/urandom"
(2)<domain>/bin/startWebLogic.sh
修改umask 037为umask 002