1、 首先,安装weblogic需要有jdk1.8以上,如果没有则需要先下载jdk
```shell
# jkd的下载方法如下
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz
# 随后将下载下来的JDK包解压,并将其放在/usr/local/目录下
#啰嗦的步骤
tar -zxvf jdk-8u131-linux-x64.tar.gz
mv jdk1.8.0_131 /usr/local
#随后配置环境变量
vim /etc/profile
JAVA_HOME=/usr/local/jdk1.8.0_131
PATH=${JAVA_HOME}/bin:$PATH
source /etc/profile
#查看以下是否成功
java -version
```
至此,jdk的安装就完毕了
2、weblogic的安装
```shell
#首先下载一个weblogic的压缩包,名字一般都是fmw_-------_wls_lite_generic
#随后创建weblogic用户和weblogic组
[root@lin-16core1 ~]# groupadd web
[root@lin-16core1 ~]# useradd -g web weblogic
[root@lin-16core1 ~]# passwd weblogic
#创建响应文件 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 insure having all dir read and write authority
ORACLE_HOME=/usr/local/weblogic12/wlsInstall
#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=
#这个wls.rsp文件最好放在/home/weblogic/目录下,并且这个文件中需要修改 ORACLE_HOME=/usr/local/weblogic12/wlsInstall (这个目录要存在才可以)
#创建oralnst.loc
inventory_loc=/home/weblogic/oraInventory
inst_group=web (这个web是weblogic用户所在的组名,按需要改)
这几个文件要确保weblogic用户有权限
#安装weblogic
[weblogic@lin-16core1 root]$ cd /usr/local/weblogic12/
[weblogic@lin-16core1 root]$ java -jar fmw_12.2.1.4.0_wls_lite_generic.jar -silent -responseFile /home/weblogic/wls.rsp -invPtrLoc /home/weblogic/oraInst.loc
#那个weblogic的安装包要根据需要更改
```
3、创建weblogic域
```shell
#首先创建文件夹
mkdir /usr/local/weblogic/wlsInstall/user_projects/domains/pyfile
#运行 位于/usr/local/weblogic/wlInstall/wlserver/server/bin/setWLSEnv.sh 这个文件
运行语句为 sh setWLSEnv.sh
#将basicWLSDomain.py复制到 /usr/local/weblogic12/wlsInstall/user_projects/domains/pyfile 目录下
[weblogic@lin-16core1 root]$ cd /usr/local/weblogic12/wlsInstall/user_projects/domains/pyfile
[weblogic@lin-16core1 root]$ cp /usr/local/weblogic12/wlsInstall/wlserver/common/templates/scripts/wlst/basicWLSDomain.py .
```
修改basicWLSDomain.py文件中的如下信息:




出现如下信息表示安装成功:
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Exiting WebLogic Scripting Tool.
```shell
3.4 启动服务
进入 /usr/local/weblogic12/wlsInstall/user_projects/domains/basicWLSDomain/bin 目录下
启动(前台启动),命令:
./startWebLogic.sh
启动(后台运行),命令:
./startWebLogic.sh &
关闭,命令:
./stopWebLogic.sh
3.5 静默卸载weblogic
进入 /usr/local/weblogic12/wlsInstall/oui/bin 目录下
执行命令:
./deinstall.sh -silent
```