最近负责在linux上安装weblogic,客户说要安装最新的版本,版本号为 12.2.X(12.2.1.3.0)。开始以为和旧版安装一样,使用控制台的方式,下载bin文件,然后一步步在console执行下来就行了。万万没想到,从12C版本后,
bin文件不提供了,改成全系统通用的jar文件 (generic.jar)。试了半天原来那种安装方式不能用了,非得用图形界面安装。由于服务器是在其他地方,肯定不能跑到主机的地址那边。于是各种google、各种找材料,
最后终于找到一种静默方式的安装。大家看下文。
一 前期准备
1.新建用户组 web
[root@edwcube3 ~]# groupadd web
2.新建用户weblogic 并修改用户密码
[root@edwcube3 ~]# useradd -g web weblogic
[root@edwcube3 ~]# passwd weblogic
二 安装java环境
安装jdk:rpm -ivh jdk-7u55-linux-x64.rpm
在/etc/profile最后加入以下内容:
export JAVA_HOME=/usr/java/jdk1.7.0_55
export JRE_HOME=/usr/java/jdk1.7.0_55/jre
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
使之生效
source /etc/profile
验证JDK安装成功与否:
javac
三 安装weblogic
Slient Mode静默方式
首先看命令的格式:
java -jar wls_121200.jar -silent -responseFile file -invPtrLoc file
-response file:响应文件
-invPtrLoc file:初始化环境文件
文件详解:
1.创建 oraInst.loc 文件,内容如下
#Oracle Installer Location File Location
inst_group=web 组名称
inventory_loc=/opt/weblogic/oraInventory 产品清单目录
2.创建 wls.rsp 响应文件
su - weblogic
chmod 777 /opt/weblogic/fmw_12.2.1.3.0_wls.jar
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=/opt/weblogic/Oracle/Middleware
#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=
chmod 664 wls.rsp
3.配置文件创建后,就可以进行安装了:(注:一定要切换为weblogic用户!!!!!!)
响应文件必须写绝对路径
[weblogic@test ~]$ java -jar fmw_12.2.1.3.0_wls.jar -silent -responseFile /opt/weblogic/wls.rsp -invPtrLoc /etc/oraInst.loc
启动程序日志文件为/tmp/OraInstall2016-08-10_10-59-01AM/launcher2016-08-10_10-59-01AM.log。
正在提取文件.........................................
启动 Oracle Universal Installer
检查 CPU 速度是否大于 300 MHz。 实际为 1496.639 MHz 通过
检查交换空间: 必须大于 512 MB。 实际为 2093048 MB 通过
检查此平台是否需要 64 位 JVM。 实际为64 通过 (不需要 64 位)
检查临时空间: 必须大于 300 MB。 实际为 69017 MB 通过
准备从/tmp/OraInstall2016-08-10_10-59-01AM启动 Oracle Universal Installer日志:/tmp/OraInstall2016-08-10_10-59-01AM/install2016-08-10_10-59-01AM.log
版权所有 (c) 1996, 2014, Oracle 和/或其附属公司。保留所有权利。
正在读取响应文件...
开始检查: CertifiedVersions
预期的结果: enterprise-4,enterprise-5,enterprise-6,redhat-6,redhat-4,redhat-5,SuSE-11之一
实际结果: enterprise-6
检查完成。此次检查的总体结果为: 通过
CertifiedVersions 检查: 成功。
开始检查: CheckJDKVersion
预期的结果: 1.7.0_15
实际结果: 1.7.0_55
检查完成。此次检查的总体结果为: 通过
CheckJDKVersion 检查: 成功。
已启用此会话的验证。
正在验证数据...
正在复制文件...
可以在以下位置找到本次安装会话的日志:
/tmp/OraInstall2016-08-10_10-59-01AM/install2016-08-10_10-59-01AM.log
-----------20%----------40%----------60%----------80%--------100%
Oracle Fusion Middleware 12c WebLogic Server 和 Coherence 12.1.3.0.0 的 安装 已成功完成。
日志已成功复制到/opt/weblogic/oraInventory/logs。
4.接下来要创建域domain
[weblogic@test ~]$ mkdir -p
/opt/weblogic/Oracle/Middleware/user_projects/domains/base_domain/
创建参数文件
创建文件: create_domain.rsp
read template from "/opt/weblogic/Oracle/Middleware/wlserver/common/templates/wls/wls.jar";
set JavaHome "/usr/java/jdk1.7.0_55";
set ServerStartMode "dev";
find Server "AdminServer" as AdminServer;
set AdminServer.ListenAddress "";
set AdminServer.ListenPort "8001";
set AdminServer.SSL.Enabled "true";
set AdminServer.SSL.ListenPort "8002";
//We can directly create a new managed server.
create Server "base" as BASE;
set BASE.ListenAddress "";
set BASE.ListenPort "8003";
//set BASE.SSL.Enabled "true";
//set BASE.SSL.ListenPort "8004″;
//Create Machine
create Machine "base" as Machinename;
//use templates default weblogic user
find User "weblogic" as u1;
set u1.password "weblogic123";
//create a new user
create User "weblogic2" as u2;
set u2.password "weblogic123";
write domain to "/opt/weblogic/Oracle/Middleware/user_projects/domains/base_domain/";
// The domain name will be "demo-domain"
close template;
静默创建域(注:一定要切换为weblogic用户!!!!!!)
cd /opt/weblogic/Oracle/Middleware/wlserver/common/bin
[weblogic@test ~]$ cd Oracle/Middleware/wlserver/common/bin
[weblogic@test bin]$ ./config.sh -mode=silent -silent_script=/opt/weblogic/create_domain.rsp -logfile=/opt/weblogic/create_domain.log
出现如下输出:
<< read template from "/opt/weblogic/Oracle/Middleware/wlserver/common/templates/wls/wls.jar"
>> succeed: read template from "/opt/weblogic/Oracle/Middleware/wlserver/common/templates/wls/wls.jar"
<< set config option JavaHome to "/usr/java/jdk1.7.0_55"
>> succeed: set config option JavaHome to "/usr/java/jdk1.7.0_55"
<< set config option ServerStartMode to "dev"
>> succeed: set config option ServerStartMode to "dev"
<< find Server "AdminServer" as AdminServer
>> succeed: find Server "AdminServer" as AdminServer
<< set AdminServer attribute ListenAddress to ""
>> succeed: set AdminServer attribute ListenAddress to ""
<< set AdminServer attribute ListenPort to "8001"
>> succeed: set AdminServer attribute ListenPort to "8001"
<< set AdminServer attribute SSL!Enabled to "true"
>> succeed: set AdminServer attribute SSL!Enabled to "true"
<< set AdminServer attribute SSL!ListenPort to "8002"
>> succeed: set AdminServer attribute SSL!ListenPort to "8002"
<< create Server "base" as BASE
>> succeed: create Server "base" as BASE
<< set BASE attribute ListenAddress to ""
>> succeed: set BASE attribute ListenAddress to ""
<< set BASE attribute ListenPort to "8003"
>> succeed: set BASE attribute ListenPort to "8003"
<< create Machine "base" as Machinename
>> succeed: create Machine "base" as Machinename
<< find User "weblogic" as u1
>> succeed: find User "weblogic" as u1
<< set u1 attribute Password to "********"
>> succeed: set u1 attribute Password to "********"
<< create User "weblogic2" as u2
>> succeed: create User "weblogic2" as u2
<< set u2 attribute Password to "********"
>> succeed: set u2 attribute Password to "********"
<< write Domain to "/opt/weblogic/Oracle/Middleware/user_projects/domains/base_domain/"
..........................................................................................
>> succeed: write Domain to "/opt/weblogic/Oracle/Middleware/user_projects/domains/base_domain/"
<< close template
>> succeed: close template
WebLogic的后台启动、停止运行的方法
[weblogic@test ~]# cd /user_projects/domains/base_domain/bin/
[weblogic@test bin]# nohup ./startWebLogic.sh &
最后就可以访问 http://ip:8001/console 进入控制台了
停止运行:
[weblogic@test bin]# ./stopWebLogic.sh