【AWS】RHEL6.4にWLS12.1.2をインストールしてみた


ちょいと検証環境を構築する必要があっていろいろ試した。

---
# 1. RHEL6.4環境を構築する

今回は、AWS EC2で検証環境を構築した。
基本的にデフォルト設定で環境を構築したため、エビデンスは省略。

````
[root@ip-172-31-16-220 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.4 (Santiago)
[root@ip-172-31-16-220 ~]# 
````

---
# 2. インストール用ユーザを作成する

今回は、インストール用に *weblogicユーザ* を作成する。

````
[root@ip-172-31-16-220 ~]# id weblogic
uid=501(weblogic) gid=501(weblogic) groups=501(weblogic)
[root@ip-172-31-16-220 ~]# 
````
---
# 3.事前条件の確認
## 3.1 パッケージ

WLS12.1.2インストールに必要となるパッケージの導入確認をする。
必要なパッケージは下記（OTN参照）。

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/8494b168-50fa-3f22-bea9-0a8159e27b37.png "1111.png")

## 3.2 SWAP領域の確認

````
[root@ip-172-31-16-220 ~]# df -Ph
Filesystem            Size  Used Avail Use% Mounted on
/dev/xvda1            5.7G  2.6G  3.1G  46% /
none                  498M     0  498M   0% /dev/shm
[root@ip-172-31-16-220 ~]# 
````

SWAP領域ないので突貫工事しました。
http://qiita.com/na0AaooQ/items/278a11ed905995bd16af

````
[root@ip-172-31-16-220 ~]# grep Swap /proc/meminfo
SwapCached:            0 kB
SwapTotal:        524280 kB
SwapFree:         524280 kB
[root@ip-172-31-16-220 ~]# 
````
---
# 4. JDKのインストール

````
[root@ip-172-31-16-220 tmp]# rpm -qa | grep jdk
java-1.6.0-openjdk-1.6.0.0-1.62.1.11.11.90.el6_4.x86_64
java-1.7.0-openjdk-1.7.0.25-2.3.10.4.el6_4.x86_64
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# rpm -ivh jdk-7u40-linux-x64.rpm
Preparing...                ########################################### [100%]
   1:jdk                    ########################################### [100%]
Unpacking JAR files...
	rt.jar...
	jsse.jar...
	charsets.jar...
	tools.jar...
	localedata.jar...
	jfxrt.jar...
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# rpm -qa | grep jdk
java-1.6.0-openjdk-1.6.0.0-1.62.1.11.11.90.el6_4.x86_64
java-1.7.0-openjdk-1.7.0.25-2.3.10.4.el6_4.x86_64
jdk-1.7.0_40-fcs.x86_64
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# /usr/java/jdk1.7.0_40/bin/java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# 
````

````
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java

Enter to keep the current selection[+], or type selection number: 
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_40/bin/java 3
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
   3           /usr/java/jdk1.7.0_40/bin/java

Enter to keep the current selection[+], or type selection number: 3
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*  1           /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
   2           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
 + 3           /usr/java/jdk1.7.0_40/bin/java

Enter to keep the current selection[+], or type selection number: 
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# java -version
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)
[root@ip-172-31-16-220 tmp]# 
````
---
# 5. インストールディレクトリの作成

````
[root@ip-172-31-16-220 tmp]# ll /opt/oracle/
ls: cannot access /opt/oracle/: No such file or directory
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# mkdir -p /opt/oracle/weblogic/
[root@ip-172-31-16-220 tmp]# mkdir -p /opt/oracle/oraInventory/
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# ll /opt/oracle/
total 8
drwxr-xr-x. 2 root root 4096 Feb 11 05:00 oraInventory
drwxr-xr-x. 2 root root 4096 Feb 11 05:00 weblogic
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# chown weblogic:weblogic /opt/oracle/weblogic/
[root@ip-172-31-16-220 tmp]# chown weblogic:weblogic /opt/oracle/oraInventory/
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# ll /opt/oracle/
total 8
drwxr-xr-x. 2 weblogic weblogic 4096 Feb 11 05:00 oraInventory
drwxr-xr-x. 2 weblogic weblogic 4096 Feb 11 05:00 weblogic
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# 
````
---
# 6. インベントリファイルの作成

````
[root@ip-172-31-16-220 tmp]# cd /opt/oracle/oraInventory
[root@ip-172-31-16-220 oraInventory]# 
[root@ip-172-31-16-220 oraInventory]# ll
total 0
[root@ip-172-31-16-220 oraInventory]# pwd
/opt/oracle/oraInventory
[root@ip-172-31-16-220 oraInventory]# 
[root@ip-172-31-16-220 oraInventory]# vi oraInst.loc
[root@ip-172-31-16-220 oraInventory]# cat oraInst.loc
inventory_loc=/opt/oracle/oraInventory/
inst_group=weblogic
[root@ip-172-31-16-220 oraInventory]# 
````
---
# 7. レスポンスファイルの作成

````
[root@ip-172-31-16-220 oraInventory]# cd /tmp/
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# vi sinstall.txt 
[root@ip-172-31-16-220 tmp]# cat sinstall.txt 
[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=/opt/oracle/weblogic/

 #Set this variable value to the Installation Type selected. e.g. Fusion Middleware Infrastructure, Fusion Middleware Infrastructure 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=<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=
[root@ip-172-31-16-220 tmp]# 
[root@ip-172-31-16-220 tmp]# 
````
---
# 8. インストール（サイレント）

````
[weblogic@ip-172-31-16-220 ~]$ java -jar /tmp/wls_121200.jar -silent -responseFile /tmp/sinstall.txt -invPtrLoc /opt/oracle/oraInventory/oraInst.loc
Extracting files.................
You do not have permission to access /opt/oracle/oraInventory/oraInst.loc in the inventory /opt/oracle/oraInventory.
Starting Oracle Universal Installer

Checking if CPU speed is above 300 MHz.   Actual 2400.171 MHz    Passed
Checking swap space: must be greater than 512 MB.   Actual 524280 MB    Passed
Checking if this platform requires a 64-bit JVM.   Actual 64    Passed (64-bit not required)
Checking temp space: must be greater than 300 MB.   Actual 679 MB    Passed


Preparing to launch the Oracle Universal Installer from /tmp/OraInstall2017-02-11_06-17-38AM
Log: /opt/oracle/oraInventory//logs/install2017-02-11_06-17-38AM.log
Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
Reading response file..
Expected result: One of enterprise-4,enterprise-5,enterprise-6,redhat-6,redhat-4,redhat-5,SuSE-10,SuSE-11
Actual Result: enterprise-6
Check complete. The overall result of this check is: Passed
CertifiedVersions Check: Success.
Expected result: 1.7
Actual Result: 1.7.0_40
Check complete. The overall result of this check is: Passed
CheckJDKVersion Check: Success.
Verifying data......
Copying Files...
-----------20%----------40%----------60%----------80%--------100%

The installation of WebLogic Server 12.1.2.0.0 completed successfully.
[weblogic@ip-172-31-16-220 ~]$ 
````
---
# 9. インストール確認

※簡単にopatchコマンドでも叩いてみる

````
[weblogic@ip-172-31-16-220 OPatch]$ ./opatch lsinventory
Oracle Interim Patch Installer version 13.1.0.0.0
Copyright (c) 2013, Oracle Corporation.  All rights reserved.


Oracle Home       : /opt/oracle/weblogic
Central Inventory : /opt/oracle/oraInventory/
   from           : /opt/oracle/weblogic/oraInst.loc
OPatch version    : 13.1.0.0.0
OUI version       : 13.1.0.0.0
Log file location : /opt/oracle/weblogic/cfgtoollogs/opatch/opatch2017-02-11_06-22-31AM_1.log


OPatch detects the Middleware Home as "/opt/oracle/weblogic"

Lsinventory Output file location : /opt/oracle/weblogic/cfgtoollogs/opatch/lsinv/lsinventory2017-02-11_06-22-31AM.txt

--------------------------------------------------------------------------------

There are no Interim patches installed in this Oracle Home.


--------------------------------------------------------------------------------

OPatch succeeded.
[weblogic@ip-172-31-16-220 OPatch]$ 
````

★インストールは問題なく出来た模様
---
# 10.ドメイン作成

GUIでドメインを作成してみる。

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/72401955-f566-29e5-89c2-428e1f592bce.png "1111.png")


![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/988f8188-a160-40b5-596c-3d687a9aa811.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/fc5c79a4-1d5b-1c68-2cd4-6d03e1d97d4f.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/2b6af9ca-9cf6-ecf8-5024-219a5b9050d2.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/0eb14c1b-4f89-60f0-c567-3baf92a1ce2c.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/cbc1fd33-ef63-7b7b-e101-97e608d95675.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/ef91d7a3-eca8-bd87-d72f-bd5a69d69c4e.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/fe83a6fb-32f5-3b83-8095-30bf349b003c.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/8e72b9fe-8fbb-2c6b-7910-4366fe4213fe.png "1111.png")

````
[root@ip-172-31-16-220 test]# pwd
/opt/oracle/weblogic/user_projects/domains/test
[root@ip-172-31-16-220 test]# 
[root@ip-172-31-16-220 test]# ll
合計 44
drwxr-x---. 2 root root 4096  2月 11 15:27 2017 autodeploy
drwxr-x---. 5 root root 4096  2月 11 15:27 2017 bin
drwxr-x---. 8 root root 4096  2月 11 15:27 2017 config
drwxr-x---. 2 root root 4096  2月 11 15:27 2017 console-ext
-rw-r-----. 1 root root  328  2月 11 15:27 2017 fileRealm.properties
drwxr-x---. 2 root root 4096  2月 11 15:27 2017 init-info
drwxr-x---. 2 root root 4096  2月 11 15:27 2017 lib
drwxr-x---. 2 root root 4096  2月 11 15:27 2017 nodemanager
drwxr-x---. 2 root root 4096  2月 11 15:27 2017 security
drwxr-x---. 3 root root 4096  2月 11 15:27 2017 servers
-rwxr-x---. 1 root root  263  2月 11 15:27 2017 startWebLogic.sh
[root@ip-172-31-16-220 test]# 
[root@ip-172-31-16-220 test]# ./startWebLogic.sh &
[1] 2651
[root@ip-172-31-16-220 test]# .
````

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/e940f0c0-b040-50ca-4f16-253590874698.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/91fe6a5f-a6b9-a5d4-7576-362080572581.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/43a414fc-fb2a-0bb7-db33-b7583142b2e8.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/b728d767-e518-1763-d5d0-fd5b6e7a3178.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/95245671-9fb6-db7c-779d-3dde3ba066e9.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/f7d49eda-5cab-2140-e6a4-692e7b5d51f3.png "1111.png")

![1111.png](https://qiita-image-store.s3.amazonaws.com/0/33479/d689dae8-2a44-8dd7-6093-37186f0ecfb4.png "1111.png")