linux端weblogic的搭建

使用静默安装的方式在linux上安装weblogic

1、在linux上创建用户组和用户

groupadd weblogic——>创建用户组weblogic

useradd -g weblogic weblogic——>创建用户weblogic,指定为weblogic用户组

passwd weblogic——>修改用户密码

创建安装路径,例如设置weblogic的安装路径为:/home/weblogic/weblogic_path

2、安装java环境

3、静默安装

创建响应文件和初始化环境文件:

vim /home/weblogic/weblogic_path/response/wls.rsp——>响应文件

vim /home/weblogic/weblogic_path/initalize/oraInst.loc——>初始化文件

文件内容分别为

wls.rsp:

[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
[GENERIC]
#weblogic的安装路径,根据自己的需要修改
ORACLE_HOME=/home/weblogic/weblogic_path
#Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence, Complete with Examples.
INSTALL_TYPE=WebLogic Server

MYORACLESUPPORT_USERNAME= 

MYORACLESUPPORT_PASSWORD=<SECURE VALUE>

DECLINE_SECURITY_UPDATES=true

SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

PROXY_HOST=

PROXY_PORT=

PROXY_USER=

PROXY_PWD=<SECURE VALUE>

COLLECTOR_SUPPORTHUB_URL=

在这里我只修改了weblogic的安装地址,其他使用默认即可

oraInst.loc:

inventory_loc=/home/weblogic/weblogic_path/initalize——>产品清单目录

inst_group=weblogic——>用户组名称

执行安装命令:

java -jar fmw_12.2.1.0.0_wls.jar -silent -responseFile /home/weblogic/weblogic_path/response/wls.rsp  -invPtrLoc /home/weblogic/weblogic_path/initalize/oraInst.loc

Java HotSpot(TM) Server VM warning: You have loaded library /tmp/orcl305077197089615615.tmp/Disk1/install/linux/libjni.so which might have disabled stack guard. The VM will try to fix the stack guard now.
It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
启动 Oracle Universal Installer

等一会,出现

预期的结果: 1.7
实际结果: 1.7.0_40
检查完成。此次检查的总体结果为: 通过
CheckJDKVersion 检查: 成功。
正在验证数据...
正在复制文件...
-----------20%----------40%----------60%----------80%--------100%
WebLogic Server 12.1.2.0.0 的 installation 已成功完成。

至此,weblogic安装完成

4、接下来在weblogic下创建Domain

创建域有三种方式:

第一种方式,通过命令行创建(未使用,相当于第二种方式)

[root@WAAA-NM1 bin]# pwd

/home/weblogic/weblogic/oracle_common/common/bin

[root@WAAA-NM1 bin]# ./commEnv.sh--------------------------------------设置weblogic的公用环境

[root@WAAA-NM1 bin]# ./wlst.sh-----------------------------------WebLogic Scripting Tool ,即 Weblogic 脚本工具,可进入脚本编辑空间编辑域创建脚本

Java HotSpot(TM) Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0

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(’/home/weblogic/weblogic_path/wlserver/common/templates/wls/wls.jar’)-----------------------------------readTemplate 函数读取建域模版脚本

wls:/offline/base_domain>cd('Servers/AdminServer')

wls:/offline/base_domain/Server/AdminServer>set('ListenAddress','') -------------------------------- 配置 ListenAddress 监听地址,默认为 '' 表示监听所有本机地址 。

wls:/offline/base_domain/Server/AdminServer>set('ListenPort', 7030) ------------------------------- 配置ListenPort 监听端口号,此处可使用lsof -i:port号来检测当前使用的端口是否有冲突

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') ----------------------设置域路径并写入,使用 writeDomain 函数设置待写入的域路径,并执行写入过程

wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/home/weblogic/Oracle/Middleware/user_projects/domains/cvdeinterface')--------配置域名

closeTemplate()

exit()

第二种方式,通过.py文件执行使用参数创建(已使用)

创建create_domains.py文件,文件内容如下:

readTemplate("/home/weblogic/weblogic_path/wlserver/common/templates/wls/wls.jar")------------------readTemplate 函数读取建域模版脚本

cd("Servers/AdminServer")

set("ListenAddress","")-----------------------------配置 ListenAddress 监听地址,默认为 '' 表示监听所有本机地址

set("ListenPort",5001)----------------------- 配置ListenPort 监听端口号,此处可使用lsof -i:port号来检测当前使用的端口是否有冲突

#=======================================================================================

# Define the user password for weblogic.

#=======================================================================================

cd("/Security/base_domain/User/weblogic")--------------------设置用户名

# Please set password here before using this script, e.g. cmo.setPassword('value')

cmo.setPassword("weblogic131")-------------------设置密码

setOption('OverwriteDomain', 'true')-------------------设置域路径并写入,使用 writeDomain 函数设置待写入的域路径,并执行写入过程

writeDomain("/home/weblogic/weblogic_path/user_projects/domains/RtsDomain5001")-------------------创建域,其中RtsDomain5001是域名

closeTemplate()

exit()

执行建域脚本

进入wlst.sh所在路径  cd /home/weblogic/weblogic/wlserver/common/bin

将create_domains.py文件放到wlst.sh同级目录下,执行./wlst.sh create_domains.py

若不在同一目录下,.py文件之前要拼接文件存放目录

第三种方式,通过.resp文件执行参数创建域(未使用)

创建create_domain.resp文件,内容如下:

read template from "/home/weblogic/weblogic_path/wlserver/common/templates/wls/wls.jar";

set JavaHome "/usr/local/jdk1.8";

set ServerStartMode "dev";

find Server "AdminServer" as AdminServer;

set AdminServer.ListenAddress "";

set AdminServer.ListenPort "7001";

set AdminServer.SSL.Enabled "true";----------------------设置是否ssl链接

set AdminServer.SSL.ListenPort "7002";-------------------ssl链接端口

//create a new user

create User "weblogic2" as u2;

set u2.password "weblogic123";

write domain to "/u02/bea/user_projects/domains/base_domain/";(执行时一直文件写入失败)

// The domain name will be "demo-domain"

close template;

到/home/weblogic/Oracle/Middleware/wlserver/common/bin下执行脚本./config.sh /home/weblogic/create_domain.resp

至此,weblogic和域创建成功,创建成功之后的后续操作将在下一篇中介绍

原文地址:https://www.cnblogs.com/jeff-z-blog/p/9532020.html