1      weblogic 生产环境

开发环境可以使用Weblogic zip包安装,而且zip安装包不支持打补丁;

生产环境需要下载Generic通用包安装使用

1.1   下载安装包

http://download.oracle.com/otn/nt/middleware/12c/wls/1213/fmw_12.1.3.0.0_wls.jar

1.2   准备安装环境

需要注意的是,所有的安装目录(安装用户必须拥有所有权限)

1.3   配置安装环境

       /etc/profile,或者用户主目录vi ~/.bash_profile

       export JAVA_HOME=/usr/local/jdk1.7.0_80

export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib

export PATH=$JAVA_HOME/bin:$PATH

       source /etc/profile

1.4   配置主机名和IP的映射

              若不配置,会报UnknownHostException

       192.168.1.200  cyyun

创建oraInst.loc文件(在用户家目录创建就可以了)

The contents of the file consist of the following two lines

       inventory_loc=oui_inventory_directory

inst_group=oui_install_group

案例:

inventory_loc=/usr/local/products/oraInventory

inst_group=cyyun

1.5   创建响应文件(可在家目录)

vi 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=/usr/local/products/weblogic12c

#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=

 

1.6   执行安装

java -jar /home/cyyun/fmw_12.2.1.3.0_wls.jar -silent -responseFile /home/cyyun/wls.rsp -invPtrLoc /home/cyyun/oraInst.loc

不能使用root用户进行安装,会报错

 

1.7   配置环境变量

vi .bash_profile

export MW_HOME=/usr/local/products/weblogic12c

1.8   创建域,控制台启动慢问题

现象:

1. 创建域的时候writeDomain需要很长时间(20分钟左右)

2. 启动weblogic第一次进入控制台需要很长时间(10分钟左右)

3. 启动weblogic server需要很长时间(5-10分钟)

在修改域之前,先修改Linux下的Java生成随机数

# securerandom.source=file:/dev/urandom

# 修改为

# securerandom.source=file:/dev/./urandom

 

1.9   创建Domain/

mkdir /usr/local/products/domain    -- 创建域存放目录

cd $MW_HOME/wlserver/common/bin

./commEnv.sh

./wlst.sh

 

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>

 

 

wls:/offline> readTemplate('/usr/local/products/weblogic12c/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/Server/AdminServer>cd('/')

wls:/offline/base_domain>cd('Security/base_domain/User/weblogic')

wls:/offline/base_domain/Security/base_domain/User/weblogic>cmo.setPassword('weblogic12c')

wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption('OverwriteDomain', 'true')

wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/usr/local/products/domain')  

wls:/offline/domain/Security/domain/User/weblogic>closeTemplate()

wls:/offline>exit()

Exiting WebLogic Scripting Tool.

 

1.10       启动weblogic

cd /usr/local/products/domain/bin/    -- 进入创建的域目录bin

./startWebLogic.sh    -- 后台启动使用nohup ./startWebLogic.sh &

./stopWeblogic.sh    -- 关闭weblogic