1、環境探查與准備
安裝jdk和weblogic前需要對進行安裝的linux系統硬件和軟件環境進行探查確認,以確保支持對jdk1.8和weblogic12.2.1.4的安裝。weblogic12.2.1.4對於jdk及linux操作系統版本的要求在oracle官網上面有詳細的詳細全面介紹,可自己進行下載xls查閱。
安裝weblogic前需要安裝好jdk1.8,這里就不詳細敘述了。
2、安裝weblogic
在官網下載linux版本壓縮包fmw_12.2.1.4.0_wls_lite_generic.zip,解壓通過Xftp上傳jar包到/usr/local/weblogic12文件夾下

2.1 創建weblogic用戶和組web
[root@lin-16core1 ~]# groupadd web [root@lin-16core1 ~]# useradd -g web weblogic [root@lin-16core1 ~]# passwd weblogic
2.2 切換用戶進行安裝
su weblogic
2.3 創建響應文件 wls.rsp
最好放在/home/weblogic的目錄下面而不是usr目錄下面,否則會導致創建域的權限問題在/home/weblogic目錄下確保有如下兩個文件並做相應的配置,否則安裝時候回報各種難以預知的錯誤。
[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文件中需要修改的信息如下:ORACLE_HOME=/usr/local/weblogic12/wlsInstall (表示weblogic的安裝目錄) 響應文件中信息的編寫,否則會報奇怪的錯誤
2.4 創建Loc文件 oraInst.loc
inventory_loc=/home/weblogic/oraInventory
inst_group=web
備注:oraInts.loc文件中修改如下信息:
inventory_loc=/home/weblogic/oraInventory (表示產品清單目錄)
inst_group=web (web表示weblogic用戶所在的組名,查看用戶所屬組的命令: groups)
2.5 保證所需要的目錄weblogic用戶要用讀寫權限
oraInst.loc,wls.rsp,fmw_12.2.1.4.0_wls_lite_generic.jar文件用戶weblogic必須要有讀寫權限
2.6 安裝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.1 配置環境變量
先創建文件夾目錄

執行setWLSEnv.sh 來配置環境變量
[weblogic@lin-16core1 root]$ /usr/local/weblogic12/wlsInstall/wlserver/server/bin/setWLSEnv.sh
3.2 將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文件中的如下信息:
1)確定該服務的監聽端口7001
cd('Servers/AdminServer')
set('ListenAddress','')
set('ListenPort', 7001)
2)確定weblogic控制台的登錄密碼
cd('/')
cd('Security/base_domain/User/weblogic')
cmo.setPassword('weblogic123')
3)確定域名basicWLSDomain域名
setOption('OverwriteDomain', 'true')
writeDomain('/usr/local/weblogic12/wlsInstall/wlserver/../user_projects/domains/basicWLSDomain')
closeTemplate()
3.3 執行basicWLSDomain.py進行域的創建
[weblogic@lin-16core1 pyfile]$ /usr/local/weblogic12/wlsInstall/oracle_common/common/bin/wlst.sh 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.
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
總結:實踐是檢驗真理的唯一標准,親測可用。

