CentOS 上部署 Oracle WebLogic Server 指南
一 环境准备与版本选择
二 安装 JDK 与创建用户目录
# tar xvf jdk-8u451-linux-x64.tar.gz -C /apps
# ln -sv /apps/jdk1.8.0_451 /apps/jdk
# echo 'export JAVA_HOME=/apps/jdk' >> /etc/profile
# echo 'export PATH=$JAVA_HOME/bin:$PATH' >> /etc/profile
# source /etc/profile
# java -version
# groupadd weblogic
# useradd -g weblogic weblogic
# mkdir -p /opt/weblogic/Oracle/Middleware
# chown -R weblogic:weblogic /opt/weblogic
三 静默安装 WebLogic
# su - weblogic
$ mkdir -p /opt/weblogic
$ cd /opt/weblogic
/opt/weblogic/wls.rsp[ENGINE]
Response File Version=1.0.0.0.0
[GENERIC]
ORACLE_HOME=/opt/weblogic/Oracle/Middleware
INSTALL_TYPE=WebLogic Server
DECLINE_SECURITY_UPDATES=true
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
/opt/weblogic/oraInst.locinventory_loc=/opt/weblogic/oraInventory
inst_group=weblogic
# fmw_12.2.1.4.0_wls_lite_generic.jar 或 fmw_14.1.1.0.0_wls_lite_generic.jar
$ java -jar fmw_*.jar -silent -responseFile /opt/weblogic/wls.rsp -invPtrLoc /opt/weblogic/oraInst.loc
$ ls $ORACLE_HOME/wlserver/common/bin
# 应能看到 config.sh、wlst.sh 等脚本
四 创建域与启动服务
$ cd $ORACLE_HOME/wlserver/common/bin
$ ./wlst.sh
wls:/offline> readTemplateForUpdate('$ORACLE_HOME/wlserver/common/templates/wls/wls.jar')
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> cd('/Security/base_domain/User/weblogic')
wls:/offline/base_domain/Security/base_domain/User/weblogic> cmo.setPassword('YourStrongP@ssw0rd')
wls:/offline/base_domain/Security/base_domain/User/weblogic> setOption('OverwriteDomain','true')
wls:/offline/base_domain/Security/base_domain/User/weblogic> writeDomain('/opt/weblogic/Oracle/Middleware/user_projects/domains/base_domain')
wls:/offline/base_domain/Security/base_domain/User/weblogic> closeTemplate()
wls:/offline> exit()
$ cd $ORACLE_HOME/wlserver/common/bin
$ ./config.sh
# 按向导依次完成域、管理服务器、受管服务器(如需)等配置
$ cd /opt/weblogic/Oracle/Middleware/user_projects/domains/base_domain/bin
$ nohup ./startWebLogic.sh &
$ tail -f nohup.out
# 浏览器访问:http://<服务器IP>:7001/console
五 防火墙放行与常见问题
# firewall-cmd --zone=public --add-port=7001/tcp --permanent
# firewall-cmd --reload