Installing Oracle WebLogic Server 12c and Oracle HTTP Server Part II

In previous part we’ve covered installation of Oracle Weblogic Server 12c Installing Oracle WebLogic Server 12c and Oracle HTTP Server Part I. In this, second part we will continue with installation of an Oracle HTTP Server 12c.

Oracle HTTP Server is the web server component for Oracle Fusion Middleware. It provides a listener for Oracle WebLogic Server and the framework for hosting static pages, dynamic pages, and applications over the Web.

In this demo we will install an Oracle HTTP Server in a Standalone Domain.

WLS12c_OHS_infra_part2

Prerequisites for this tutorial:

  • a virtual Linux server has been started and configured
  • hostname, IP address and /etc/hosts entries example:
    • hostname: ohs12c-node1.zion.local
    • IP Address: 192.168.2.116
  • OHS installation package has been uploaded on OHS server in /tmp dir
    • ofm_ohs_linux_12.1.2.0.0_64_disk1_1of1.zip (Latest version here)

1. Installing OHS software and creating OHS domain

  • Connect to the OHS server (using putty), make sure Xming is running. 
[neo@ohs12c-node1 ~]$ xauth list
ohs12c-node1.zion.local/unix:10  MIT-MAGIC-COOKIE-1  f6f3213ef669742b98f794bb5d574af5

[neo@ohs12c-node1 ~]$ sudo su - oracle
[sudo] password for neo:
[oracle@ohs12c-node1 ~]$ xauth add ohs12c-node1.zion.local/unix:10  MIT-MAGIC-COOKIE-1  f6f3213ef669742b98f794bb5d574af5

[oracle@ohs12c-node1 ~]$ export DISPLAY=localhost:10.0
  • unzip OHS installation package and run the installer:
[oracle@ohs12c-node1 ~]$ cd /tmp/; unzip ofm_ohs_linux_12.1.2.0.0_64_disk1_1of1.zip
Archive:  ofm_ohs_linux_12.1.2.0.0_64_disk1_1of1.zip
  inflating: ohs_121200_linux64.bin

[oracle@ohs12c-node1 tmp]$ ./ohs_121200_linux64.bin
0%...........................................
  • install patches:

  • create new OHS domain
[oracle@ohs12c-node1 ~]$ cd /u01/app/oracle/product/12.1.2/ohs/ohs/common/bin
[oracle@ohs12c-node1 bin]$ ./config.sh

2. Starting OHS server instance ohs1

  • start node manager
[oracle@ohs12c-node1 ~]$ cd /u01/app/oracle/config/zion_t1_ohs_domain1/bin

[oracle@ohs12c-node1 bin]$ nohup ./startNodeManager.sh > /dev/null 2>&1 &
  • start Oracle HTTP Server Instance: ohs1
[oracle@ohs12c-node1 bin]$ ./startComponent.sh ohs1
Starting System Component ohs1 ...

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Reading domain from /u01/app/oracle/config/zion_t1_ohs_domain1

Please enter your password : ***** <nm_manager password>
Connecting to Node Manager ...
Successfully Connected to Node Manager.
Starting server ohs1 ...
Successfully started server ohs1 ...
Successfully disconnected from Node Manager.

Exiting WebLogic Scripting Tool.

Done
[oracle@ohs12c-node1 bin]$

Hint: You can avoid having to enter your Node Manager password every time you launch the server with startComponent.sh by starting it with the storeUserConfig option for the first time. Do the following: At the prompt, enter the following command:

$DOMAIN_HOME/bin/startComponent.sh componentName storeUserConfig

The system will prompt for your Node Manager password.

  • stop Oracle HTTP Server Instance: ohs1
[oracle@ohs12c-node1 bin]$ ./stopComponent.sh ohs1
Stopping System Component ohs1 ...
Successfully killed server ohs1
Successfully disconnected from Node Manager.
Exiting WebLogic Scripting Tool.
Done
  •  start Oracle HTTP Server Instance: ohs1 storeUserConfig
[oracle@ohs12c-node1 bin]$ ./startComponent.sh ohs1 storeUserConfig
Starting System Component ohs1 ...

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

Reading domain from /u01/app/oracle/config/zion_t1_ohs_domain1

Please enter your password : *********
Creating the key file can reduce the security of your system if it is not kept in a secured location after it is created. 
Do you want to create the key file? y or n [type: y]

The username and password that were used for this WebLogic NodeManager connection are stored in 
/home/oracle/.wlst/nm-cfg-zion_t1_ohs_domain1.props and 
/home/oracle/.wlst/nm-key-zion_t1_ohs_domain1.props.

Connecting to Node Manager ...
Successfully Connected to Node Manager.
Starting server ohs1 ...
Successfully started server ohs1 ...
Successfully disconnected from Node Manager.

Exiting WebLogic Scripting Tool.

Done
[oracle@ohs12c-node1 bin]$
  •  Open Oracle HTTP Server 12c welcome page: http://<server_IP>:7777

2014-03-22_000090

At this moment we have OHS server up and running. Now we will configure it to redirect our requests to a WebLogic Server 12c domain which is running on wls12-node1 host.

 2. Routing requests to managed servers in a WebLogic Server domain

  •  Configuring the WebLogic Proxy Plug-In Manually

We configure the WebLogic Proxy Plug-In manually by specifying directives in the mod_wl_ohs.conf file. Edit mod_wl_ohs.conf

[oracle@ohs12c-node1 bin]$ cd /u01/app/oracle/config/zion_t1_ohs_domain1/config/fmwconfig/components/OHS/ohs1/
[oracle@ohs12c-node1 ohs1]$ vi mod_wl_ohs.conf
  •  add the following lines to the file. Save changes and restart ohs1 instance
# Admin Console of a WebLogic domain on wls12c-node1
# With the following configuration, requests for the /console URI received at the Oracle HTTP Server 
# listen port (7777) will be forwarded to /console on the Oracle WebLogic Server port 7001

<IfModule weblogic_module>
	<Location /console>
	WLSRequest On
	WebLogicHost wls12c-node1.zion.local
	WeblogicPort 7001
	</Location>
</IfModule>

# Hello Word Application
# With the following configuration, requests for the /Hello URI 
# received at the Oracle HTTP Server listen port (7777) will be forwarded to /Hello 
# the Oracle WebLogic Server cluster containing the managed servers with the listen ports wls12c-node1:7003
# and in case of the cluster: wls12c-node2:7003 (node2 is not part of this tutorial).

<IfModule weblogic_module>
	<Location /Hello>
	WLSRequest On
	WebLogicCluster wls12c-node1.zion.local:7003,wls12c-node2.zion.local:7003
	</Location>
</IfModule>
 More configuration examples could be found here: Configuring the WebLogic Proxy Plug-In Manually
 
  •  Restart ohs1 instance and test routing requests
[oracle@ohs12c-node1 ~]$ cd /u01/app/oracle/config/zion_t1_ohs_domain1/bin
[oracle@ohs12c-node1 bin]$ ./stopComponent.sh ohs1
...
...

[oracle@ohs12c-node1 bin]$ ./startComponent.sh ohs1
  •  In our example we would test the following URLs:
    • http://192.168.2.116:7777/console (Admin Console on wsl12c-node1)
    • http://192.168.2.116:7777/Hello (sample appl. on wls12c-node1)
    • https://192.168.2.116:4443/Hello (over SSL)
  • Next to that we have the following URLs available (over SSL demo certificates):
    • https://192.168.2.116:4443
    • https://192.168.2.115:7004/Hello
    • https://192.168.2.115:7002/console

We have just completed basic installation of Oracle WebLogic Server in configuration with Oracle HTTP Server 12c.

References:

That’s all folks!