liangsw  

 

一、环境

1、linux版本:CentOS7 64bit(自定义安装)

2、fmw_12.1.3.0.0_wls.jar

3、jdk-7u79-linux-x64.tar.gz (自定义安装)

二、安装步骤

1、安装JDK环境

cd /usr/local/src
tar zxvf jdk-7u79-linux-x64.tar.gz
mv jdk1.7.0_79 /home/weblogic/jdk1.7.0_79/

2、创建安装用户及授权

# Root用户执行
groupadd weblogic # 添加用户组
useradd -g weblogic weblogic  # 添加用户:useradd -g 用户组 用户名
passwd weblogic
# 授权
# chown -R 组:用户 目录
chown -R weblogic:weblogic /home/weblogic/
chmod 777 -R /home/weblogic  # 生产环境适量而设
su - weblogic

3、weblogic用户的.bash_profile文件中新增配置项

$vi .bash_profile

export JAVA_HOME=/home/weblogic/jdk1.7.0_79
export JRE_HOME=/home/weblogic/jdk1.7.0_79/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export ORACLE_HOME=/home/weblogic/bea

source .bash_profile

4、创建响应文件wls.rsp

cd /home/weblogic
touch 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=/home/weblogic/bea
#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=

5、在/home/weblogic目录下创建Loc文件:oraInst.loc

cd /home/weblogic
touch oraInst.loc
# 内容如下:
inventory_loc=/home/weblogic/oraInventory
inst_group=weblogic

6、执行安装

java -jar /home/weblogic/fmw_12.1.3.0.0_wls.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc
# 控制台输出内容:
启动程序日志文件为/tmp/OraInstall2016-05-13_01-02-56PM/launcher2016-05-13_01-02-56PM.log。
正在提取文件.........
启动 Oracle Universal Installer
检查 CPU 速度是否大于 300 MHz。   实际为 2400.217 MHz    通过
检查交换空间: 必须大于 512 MB。   实际为 18513912 MB    通过
检查此平台是否需要 64 位 JVM。   实际为64    通过 (不需要 64 位)
检查临时空间: 必须大于 300 MB。   实际为 36518 MB    通过
准备从/tmp/OraInstall2016-05-13_01-02-56PM启动 Oracle Universal Installer
日志:/tmp/OraInstall2016-05-13_01-02-56PM/install2016-05-13_01-02-56PM.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_80
检查完成。此次检查的总体结果为: 通过
CheckJDKVersion 检查: 成功。
已启用此会话的验证。
正在验证数据...
正在复制文件...
可以在以下位置找到本次安装会话的日志:
 /tmp/OraInstall2016-05-13_01-02-56PM/install2016-05-13_01-02-56PM.log
-----------20%----------40%----------60%----------80%--------100%
Oracle Fusion Middleware 12c WebLogic Server 和 Coherence 12.1.3.0.0 的 安装 已成功完成。
日志已成功复制到/home/weblogic/oraInventory/logs。

截图:

7.创建域domain

7.1、创建存放路径

$ mkdir -p /home/weblogic/bea/user_projects/domains/base_domain/

7.2、安装方式 

7.2.1、通过纯命令行安装 :

-bash-4.2$ export MW_HOME="/home/weblogic/bea";
-bash-4.2$ export WL_HOME="/home/weblogic/bea/oracle_common";
-bash-4.2$ cd /home/weblogic/bea/wlserver/common/bin/
-bash-4.2$ ls
clonedunpack.sh    config.sh                 qs_config.sh  wlscontrol.sh
commEnv.sh         pack.sh                   reconfig.sh   wlsifconfig.sh
config_builder.sh  prepareCustomProvider.sh  unpack.sh     wlst.sh
-bash-4.2$ ./commEnv.sh
-bash-4.2$ ./wlst.sh 

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> readTemplate('/home/weblogic/bea/wlserver/common/templates/wls/wls.jar')
wls:/offline/base_domain>cd('Servers/AdminServer')
wls:/offline/base_domain/Server/AdminServer>set('ListenPort',8001)
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')
wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain('/home/weblogic/bea/user_projects/domains/base_domain')
## 注:此步等待时间较长,需耐心等待……

wls:/offline/base_domain/Security/base_domain/User/weblogic>
wls:/offline/base_domain/Security/base_domain/User/weblogic>
wls:/offline/base_domain/Security/base_domain/User/weblogic>closeTemplate()
wls:/offline>exit()


Exiting WebLogic Scripting Tool.

-bash-4.2$ 

7.2.2、通过参数文件执行安装 —— 创建参数文件create_domain.rsp

cd /home/weblogic/
touch create_domain.rsp
vi create_domain.rsp
################################################################################
read template from "/home/weblogic/bea/wlserver/common/templates/wls/wls.jar";
 
set JavaHome "/usr/java/jdk1.7.0_79"; 
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 "/home/weblogic/bea/user_projects/domains/base_domain/"; 
 
# The domain name will be "demo-domain"
 
close template;
################################################################################

7.3、静默创建域 


cd /home/weblogic/bea/wlserver/common/bin

./config.sh -mode=silent -silent_script=/home/weblogic/create_domain.rsp -logfile=/home/weblogic/create_domain.log

8、WebLogic的后台启动、停止运行的方法

 cd /home/weblogic/bea/user_projects/domains/base_domain/bin/

./startWebLogic.sh

访问 http://192.168.xxx.xxx:8001/console进入控制台(到此结束);

9、项目部署修改的内容:

vi startWebLogic.sh

WLS_USER=weblogic
WLS_PW=weblogic123
	
vi setDomainEnv.sh

export SOFACONFIG_HOME="/opt/software/sofa_home"
		
WLS_MEM_ARGS_64BIT="-Xms2048m -Xms2048m"
WLS_MEM_ARGS_32BIT="-Xms2048m -Xms2048m"
		
MEM_PERM_SIZE_64BIT="-XX:PermSize=512m"
MEM_PERM_SIZE_32BIT="-XX:PermSize=512m"
		
MEM_MAX_PERM_SIZE_64BIT="-XX:MaxPermSize=1024m"
MEM_MAX_PERM_SIZE_32BIT="-XX:MaxPermSize=1024m"

 

posted on 2018-08-20 14:59  liangsw  阅读(196)  评论(0编辑  收藏  举报