生产搭建环境:
操作系统:CentOS7.5
内存大小:16GB
硬盘:100G
注:正文中的参数与部署路径等,请根据实际需求修改
1、软件准备:


jdk-8u161-linux-x64.rpm
fmw_12.1.3.0.0_wls.jar


2、jdk的环境安装与配置
(1)创建路径,并上传jdk安装包,这里使用的是rpm包


#mkdir /opt/software/
#rpm -ivh /opt/software/jdk-8u161-linux-x64.rpm


(2)配置java环境


#vi /etc/profile
添加如下配置
export JAVA_HOME=/usr/java/jdk1.8.0_161
export CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin

#source /etc/profile
#java -version


#vi $JAVA_HOME/jre/lib/security/java.security
添加如下配置
securerandom.source=file:/dev/./urandom


3、创建weblogic的用户与组


#groupadd ginstall
#useradd -m -g ginstall weblogic
#passwd weblogic


4、配置系统内核参数


#vi /etc/sysctl.conf
添加优化参数
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.shmall = 15728640
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
fs.file-max = 6815744


#sysctl -p
5、修改系统资源限制


#vi /etc/security/limits.conf
添加如下配置
weblogic soft nproc 16384
weblogic hard nproc 16384
weblogic soft nofile 65536
weblogic hard nofile 65536
weblogic soft stack 10240


6、修改环境变量


#vi /etc/profile
添加如下配置
if [ $USER = "weblogic" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi


#source /etc/profile
7、安装weblogic
(1)、创建安装目录


#mkdir -p /weblogic/rsp/oraInventory1
#mkdir /weblogic/rsp/logs
#chown -R weblogic:ginstall /weblogic


(2)、weblogic安装配置


#su -l weblogic
$ vi /weblogic/rsp/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=/weblogic/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=
#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=
#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=


(3)、创建应答文件


$ vi /weblogic/rsp/oraInst.loc
inventory_loc=/weblogic/rsp/oraInventory
inst_group=ginstall


(4)、开始安装


$ cd /opt/software
$ java -jar fmw_12.1.3.0.0_wls.jar -silent -responseFile /weblogic/rsp/wls.rsp -invPtrLoc /weblogic/rsp/oraInst.loc


8、创建域,注意加粗部分,需要更改密码


$ vi /weblogic/rsp/domain.rsp
read template from "/weblogic/middleware/wlserver/common/templates/wls/wls.jar";
set JavaHome "/usr/java/jdk1.8.0_161";
set ServerStartMode "prod";
find Server "AdminServer" as AdminServer;
set AdminServer.ListenAddress "";
set AdminServer.ListenPort "7001";
set AdminServer.SSL.Enabled "true";
set AdminServer.SSL.ListenPort "7002";
//We can directly create a new managed server.
create Server "base" as BASE;
set BASE.ListenAddress "";
set BASE.ListenPort "8081";
//set BASE.SSL.Enabled "true";
//set BASE.SSL.ListenPort "8082″;
//Create Machine
create Machine "base" as Machinename;
//use templates default weblogic user
find User "weblogic" as u1;
set u1.password "password";
write domain to "/weblogic/middleware/user_projects/domains/base_domain/";
// The domain name will be "base-domain"
close template;


9、创建域操作


$ cd /weblogic/middleware/wlserver/common/bin
$ ./config.sh -mode=silent -silent_script=/weblogic/rsp/domain.rsp -logfile=/weblogic/rsp/logs/domain.log


10、配置免密登录(加粗的password需要替换为上述创建域时所更改的密码)


$ mkdir -p /weblogic/middleware/user_projects/domains/base_domain/servers/AdminServer/security/
$ vi /weblogic/middleware/user_projects/domains/base_domain/servers/AdminServer/security/boot.properties
username=weblogic
password=password


11、修改jvm参数

$ vi /weblogic/middleware/user_projects/domains/base_domain/bin/setDomainEnv.sh
#根据操作系统的内存对应修改参数值,支持使用m或g,如下为配置8G内存
WLS_MEM_ARGS_64BIT="-Xms8192m -Xmx8192m"
#或者使用如下配置
WLS_MEM_ARGS_64BIT="-Xms8g -Xmx8g"


12、启动weblogic


#su - weblogic
$nohup /weblogic/middleware/user_projects/domains/base_domain/bin/startWebLogic.sh >/dev/null 2>&1 &


13、停止weblogic


#su - weblogic
$nohup /weblogic/middleware/user_projects/domains/base_domain/bin/stopWebLogic.sh >/dev/null 2>&1 &


14、访问weblogic控制台
http://IP-ADDR:7001/console