Friday, October 6, 2017

Install WebLogic 12.2.1.3 on CentOS 7 without GUI

1. You need have a CentOS 7 mini machine / virtual machine

I'm using virtual box and installed CentOS 7 Mini.

2. Install JDK1.8 and add in $PATH

WebLogic 12.2.1.3 need JDK 1.8 and above.
Edit ~/.bash_profile after unzip jdk-8u144-linux-x64.tar.gz into /opt.
JAVA_HOME=/opt/jdk1.8.0_144
export JAVA_HOME


PATH=$PATH:$HOME/.local/bin:$HOME/bin:$JAVA_HOME/bin

export PATH

3. Install WebLogic 12.2.1.3 in silent mode

a. Create directory /opt/Oracle for weblogic, change the own to installation account.

My installation account names developer, and it's in developer group.

b. Create response file, /opt/Oracle/wls12213.rsp



[ENGINE]

#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0

[GENERIC]

#Set this to true if you wish to skip software updates
DECLINE_AUTO_UPDATES=true

#My Oracle Support User Name
MOS_USERNAME=

#My Oracle Support Password
MOS_PASSWORD=

#If the Software updates are already downloaded and available on your local system, then specify the path to the directory where these patches are available and set SPECIFY_DOWNLOAD_LOCATION to true
AUTO_UPDATES_LOCATION=

#Proxy Server Name to connect to My Oracle Support
SOFTWARE_UPDATES_PROXY_SERVER=

#Proxy Server Port
SOFTWARE_UPDATES_PROXY_PORT=

#Proxy Server Username
SOFTWARE_UPDATES_PROXY_USER=

#Proxy Server Password
SOFTWARE_UPDATES_PROXY_PASSWORD=

#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/opt/Oracle/wls12213

#The federated oracle home locations. This should be an existing Oracle Home. Multiple values can be provided as comma seperated values
FEDERATED_ORACLE_HOMES=

#Set this variable value to the Installation Type selected. e.g. WebLogic Server, Coherence, Complete with Examples.

INSTALL_TYPE=Complete with Examples
ORACLE_HOME and INSTALL_TYPE are critical items. Their descriptions are above them respectively.

b. Create oracle inventory file /opt/Oracle/oraInst.loc


inventory_loc=/opt/Oracle/oraInventory

inst_group=developer
The installation account must have write privilege on directory /opt/Oracle/oraInventory.
developer is the group name of your installation account.

c. Run installer in silent mode

Copy fmw_12.2.1.3.0_wls.jar into /opt/Oracle.
Run installer,
[developer@CentOS7Mini Oracle]$ cd /opt/Oracle/

[developer@CentOS7Mini Oracle]$ java -jar fmw_12.2.1.3.0_wls.jar -silent -responseFile /opt/Oracle/wls12213.rsp -invPtrLoc /opt/Oracle/oraInst.loc

4. Create domain with WLST

WLST - WebLogic Scripting Tool, which is installed with weblogic.

a. Start wlst

[developer@CentOS7Mini Oracle]$ cd /opt/Oracle/wls12213/oracle_common/common/bin/

[developer@CentOS7Mini bin]$ ./wlst.sh 

b. Domain creation commands

I created a "Base WebLogic Server Domain" with template, wls.jar. All templates are in  /opt/Oracle/wls12213/wlserver/common/templates/wls. You can unzip them to see some detailed descriptions.

readTemplate('/opt/Oracle/wls12213/wlserver/common/templates/wls/wls.jar')
WARNING: The readTemplate is deprecated. Use selectTemplate followed by loadTemplates in place of readTemplate.


# Set the listen address and listen port for the Administration Server
cd("Servers/AdminServer")
set("ListenAddress","")
set("ListenPort",7001)

# Enable SSL on the Administration Server and set the SSL listen address and
# port
create("AdminServer","SSL")
cd("SSL/AdminServer")
set("Enabled","True")
set("ListenPort",7002)

# Set the domain password for the WebLogic Server administration user
cd("/")
cd("Security/base_domain/User/weblogic")
cmo.setPassword("dev123")

# If the domain already exists, overwrite the domain
setOption("OverwriteDomain","true")

# write the domain and close the template
writeDomain("/opt/Oracle/wls12213/user_projects/domains/base_domain")
closeTemplate()

exit()

5. Start WebLogic

a. Start nodemanager

If you just want to use the nodemanager to manage the domain which you just created you don't need to do any additional configurations, and just use the script startNodemanager.sh

under /opt/Oracle/wls12213/user_projects/domains/base_domain/bin.

cd /opt/Oracle/wls12213/user_projects/domains/base_domain/bin

nohup ./startNodeManager.sh &



b. Start Administration Server


cd /opt/Oracle/wls12213/user_projects/domains/base_domain/bin

nohup ./starWebLogic.sh &

c. Login WebLogic Administration Console

  • Create machine  
  • Create cluster 
  • Create manager servers

Reference:

Using the Oracle Universal Installer in Silent Mode

Creating WebLogic Domains Using WLST Offline