{"id":1874,"date":"2019-07-05T14:19:24","date_gmt":"2019-07-05T12:19:24","guid":{"rendered":"http:\/\/www.ludovicocaldara.net\/dba\/?p=1874"},"modified":"2020-08-18T16:01:29","modified_gmt":"2020-08-18T14:01:29","slug":"weblogic-in-oci","status":"publish","type":"post","link":"https:\/\/www.ludovicocaldara.net\/dba\/weblogic-in-oci\/","title":{"rendered":"How to install and access Oracle Weblogic 12.2 in the Oracle Cloud Infrastructure"},"content":{"rendered":"<p>I put here the steps required to install and access Weblogic in the OCI (mostly for me in case I need to do it again \ud83d\ude09 ). The assumptions are:<\/p>\n<ul>\n<li>you already have an account for the Oracle Cloud Infrastructure and you can access the OCI console<\/li>\n<li>you already have a Compartment with a VCN and a subnet configured (for test purposes, a VCN created with the default values will be just fine)<\/li>\n<li>you already have a keypair for your SSH client (id_rsa, id_rsa.pub)<\/li>\n<li>you have an X server on your laptop (if you have Windows, I recommend MobaXTerm, but Xming or other servers are just fine)<\/li>\n<\/ul>\n<p><strong>Create the compute instance<\/strong><\/p>\n<ul>\n<li>Menu -&gt; Core Infrastructure -&gt; Compute -&gt; Instances -&gt; Create Instance<\/li>\n<li>Choose a name for the Instance, all the other fields defaults are fine for test (Oracle Linux 7.6, VM.Standard2.1, etc.)<\/li>\n<li>Paste your SSH public key<\/li>\n<li>Optionally, under advanced\/network, specify a different name for the VM<\/li>\n<li>Click on Create to complete the creation<\/li>\n<\/ul>\n<p>At some point you will have an instance &#8220;Green&#8221; ready to access:<\/p>\n<p><a href=\"https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instances.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1875\" src=\"https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instances-1024x318.png\" alt=\"\" width=\"584\" height=\"181\" srcset=\"https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instances-1024x318.png 1024w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instances-300x93.png 300w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instances-768x239.png 768w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instances-500x155.png 500w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instances.png 1143w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>Click on it and get the public address:<\/p>\n<p><a href=\"https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instance.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1876\" src=\"https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instance-1024x482.png\" alt=\"\" width=\"584\" height=\"275\" srcset=\"https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instance-1024x482.png 1024w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instance-300x141.png 300w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instance-768x362.png 768w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instance-500x235.png 500w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/instance.png 1419w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>Using your SSH keypair, you can now access the instance with:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">$ ssh opc@{public_ip}<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Setup sshd for SSH tunneling and X11 forwarding<\/strong><\/p>\n<p>Edit as root the sshd_config:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">$ sudo vi \/etc\/ssh\/sshd_config<\/pre>\n<p>Modify it so that the following lines are present with these values:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">AllowTcpForwarding yes\r\nPermitOpen any\r\nX11Forwarding yes\r\nX11DisplayOffset 10\r\nX11UseLocalhost no<\/pre>\n<p>Those values are required for X11 forwarding (required for the graphical installation) and for SSH tunneling (required to access\u00a0 the Weblogic ports without exposing them over internet).<\/p>\n<p>Then restart sshd:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">$ sudo systemctl restart sshd\r\n<\/pre>\n<p><strong>Install the packages for X11\u00a0<\/strong><\/p>\n<pre class=\"lang:sh decode:true \"># sudo yum install xorg-x11-xauth.x86_64\r\n# sudo yum install libXtst\r\n# # optional, to test if X11 forwarding works\r\n# sudo yum install xterm<\/pre>\n<p>At this point, it should be possible to forward X11. You can test by reconnecting with:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">$ ssh -XC opc@{public_ip}<\/pre>\n<p>and then:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">$ xterm<\/pre>\n<p><strong>Create the oracle user<\/strong><\/p>\n<pre class=\"lang:plsql highlight:0 decode:true \">$ sudo su - root\r\n# groupadd -g 54321 oinstall\r\n# useradd -u 54321 -g oinstall oracle\r\n# passwd oracle<\/pre>\n<p>At this point, you can reconnect using oracle directly, so X11 forward will work for the oracle user without any additional setup:<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true\">$ ssh -XC oracle@{public_ip}<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Follow the canonical steps to install weblogic<\/strong><\/p>\n<p>If you do not know how to do that, follow this good tutorial by Tim Hall (oracle-base):<\/p>\n<p><a href=\"https:\/\/oracle-base.com\/articles\/12c\/weblogic-installation-on-oracle-linux-6-and-7-1221\">Oracle WebLogic Server (WLS) 12cR2 (12.2.1) Installation on Oracle Linux 6 and 7<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Access the Weblogic console from outside Oracle Cloud<\/strong><\/p>\n<p>If you configured correctly sshd, once the Oracle Weblogic instance is configured and started, you can tunnel to the port (it should be 7001):<\/p>\n<pre class=\"lang:plsql highlight:0 decode:true\">$ ssh -L 7001:{vm_name}:7001 oracle@{public_ip}<\/pre>\n<p>And be able to browse from your laptop using localhost:7001:<\/p>\n<p><a href=\"https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/wls_console.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-1877\" src=\"https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/wls_console-1024x475.png\" alt=\"\" width=\"584\" height=\"271\" srcset=\"https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/wls_console-1024x475.png 1024w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/wls_console-300x139.png 300w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/wls_console-768x356.png 768w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/wls_console-500x232.png 500w, https:\/\/www.ludovicocaldara.net\/dba\/wp-content\/uploads\/2019\/07\/wls_console.png 1084w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/><\/a><\/p>\n<p>HTH<\/p>\n<p>&#8212;<\/p>\n<p>Ludovico<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I put here the steps required to install and access Weblogic in the OCI (mostly for me in case I need to do it again \ud83d\ude09 ). The assumptions are: you already have an account for the Oracle Cloud Infrastructure &hellip; <a href=\"https:\/\/www.ludovicocaldara.net\/dba\/weblogic-in-oci\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[321,326,309,332],"tags":[],"class_list":["post-1874","post","type-post","status-publish","format-standard","hentry","category-aced","category-oracle","category-oracle-cloud","category-weblogic"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1874","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/comments?post=1874"}],"version-history":[{"count":2,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1874\/revisions"}],"predecessor-version":[{"id":1879,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/posts\/1874\/revisions\/1879"}],"wp:attachment":[{"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/media?parent=1874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/categories?post=1874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ludovicocaldara.net\/dba\/wp-json\/wp\/v2\/tags?post=1874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}