Configuring Oracle HTTP Server 12c for WebLogic Server Domain

Oracle HTTP Server (OHS) 12c 12.1.2 which was released in July 2013 as a part of Oracle Web Tier 12c is the web server component of Oracle Fusion Middleware. In essence this is Apache HTTP Server 2.2.22 (with critical bug fixes from higher versions) which includes modules developed specifically by Oracle. It provides a listener functionality for Oracle WebLogic Server and the framework for hosting static pages, dynamic pages, and applications over the Web.

OHS can be easily managed by Weblogic Management Framework, a set of tools which provides administrative capabilities (start, stop, lifecycle operations, etc.) for Oracle Fusion Middleware products. In other words all tools which are familiar to us (Node Manager, WLST, Administration Console, Fusion Middleware Control etc.) presented as a part of Weblogic Management Framework and using for managing Java and System Components both for Weblogic Server and Standalone Domain types.

You can familiarize yourself with these terms using related documentation:

1. Introduction to Oracle HTTP Server: http://docs.oracle.com/middleware/1212/webtier/index.html

2. Weblogic Management Framework: http://docs.oracle.com/middleware/1212/core/ASCON/terminology.htm#ASCON11260

In the given post I would like to cover rather simple use case how to configure OHS as web proxy in Weblogic Cluster environment. For example, we have existing Weblogic Domain where some managed servers have been joined to cluster and host business applications. We need to configure web proxy component which will act as entry point, load balancer for our cluster for user requests. Of course, we could install old good Apache HTTP Server and configure mod_wl plugin. However this solution not optimal from manageability perspective: we need to install Apache, install additional plugin then configure it by editing configuration file which is not really convenient for FMW Administrators and often increase time of performing of simple administrative task. Alternatively, we could use OHS as System Component within Weblogic Domain and use full power of Weblogic Management Framework in order to configure, manage and monitor it! I like this idea! What about you? I hope after reading this post you will agree with me.

First of all it is necessary to download OHS binaries. You can use this link for downloading: http://www.oracle.com/technetwork/java/webtier/downloads/index2-303202.html

As we will use Fusion Middleware Control for managing OHS instances it is necessary to extend your domain with Enterprise Manager and Oracle ADF and JRF templates. This is not topic for focusing in this post, but you could get more information from documentation or one of my previous posts:

Note: you should have properly configured Node Manager utility for managing OHS instances

Let’s consider configuration process step by step:

1. Shut down all Weblogic instances of existing domain including Admin Server;

2. Install Oracle HTTP Server. You should use your Fusion Middleware Home Path (e.g. /u01/Oracle/FMW12) for Installation Location and select Colocated HTTP Server option as Installation Type. I will not focus on this topic in this post. All information related to OHS installation you could find here: http://docs.oracle.com/middleware/1212/webtier/WTINS/install_gui.htm#i1082009

3. Next we need to extend our existing domain with OHS component. In order to do this you should do the following:

a. Run Fusion Middleware Configuration Wizard (ORACLE_HOME/oracle_common/common/bin/config.sh);

b. On the step 1 select Update an existing domain option and point your Fusion Middleware Home Path;

c. On the step 2 check Oracle HTTP Server, Oracle Enterprise Manager Plugin for WEBTIER templates;

d. Go through other steps without any changes and finish configuration process.

4. Start Admin Server and all managed servers related to your cluster

5. Log in to Enterprise Manager FMW Control using http://<hostname>:<port>/em URL

6. Now we will create OHS instance within our Weblogic Domain Infrastructure. Navigate to Weblogic Domain -> Administration -> Create/Delete OHS menu item;

7. Enter to edit mode, clicking Changes -> Lock&Edit menu item;

8. Create new OHS instance clicking Create button;

9. Define Instance Name (e.g. DevOSH) and Machine parameters;

10. Now we need to define listen port. By default OHS will use 7777 port number for income HTTP requests. We could change it to any free port number we would like to use. In order to do it, right click on our created OHS instance (left hand panel) and navigate to Administration -> Port Configuration;

11. Click on record with port number 7777 and then click Edit button;

12. Change port number value (in our case this will be 8080) and then click OK button;

13. Now we need to edit mod_wl_ohs configuration in order to enable OHS to act as proxy for WebLogic Server Instances/Cluster;

14. In order to do it right click on our created OHS instance (left panel) and navigate to Administration -> mod_wl_ohs Configuration;

a. In Weblogic Cluster you should enter cluster address (define <host:port> for all managed servers which participated in cluster), e.g: 192.168.56.2:7004,192.168.56.2:7005

b. Define Weblogic Port parameter at which the Oracle WebLogic Server host is listening for connection requests from the module (or from other servers);

c. Check Dynamic Server List option. This will dynamically update cluster list for every request;

d. In the Location table define list of endpoint locations which you would like to process. In order to do this click Add Row button and define Location, Weblogic Cluster, Path Trim and Path Prefix parameters (if required);

e. Click Apply button in order to save changes.


15. Activate changes clicking Changes → Activate Changes menu item;

16. Finally we will start configured OHS instance. Right click on OHS instance tree item under Web Tier folder, select Control -> Start Up menu item;

17. Ensure that OHS instance up and running and then test your environment. Run deployed application to your Weblogic Cluster accessing via OHS web proxy;

Contact us at partner.imc-AT-beehiveonline.oracle-DOT-com  for further clarificiations.

Bookmark and Share
Comments:

Hi, can we use mod_plsql without install weblogic server for oracle 12c?

Posted by guest on December 09, 2014 at 08:38 AM CET #

Yes, in case when you would like to use OHS without FMW Infrastructure you can do it installing OHS in standalone domain configuration.

For more information please check the documentation below:

https://docs.oracle.com/middleware/1212/core/ASCON/terminology.htm#ASCON11253

https://docs.oracle.com/middleware/1212/webtier/WTINS/planning.htm#WTINS1000

Posted by Emin Askerov on December 09, 2014 at 09:06 AM CET #

Hello,

I doing it via script and I can't do it correctly. I've created a basic domain and adding the OHS template via addTemplate command:

addTemplate(ohsTemplate);

But during the updateDomain, it fails with the following error:

Error: updateDomain() failed. Do dumpStack() to see details.
Problem invoking WLST - Traceback (innermost last):
File "/home/ii00wl/scripts/create_domain_12c.py", line 183, in ?
File "/tmp/WLSTOfflineIni8699229177831404474.py", line 103, in updateDomain

Domain Location: /appl/ohs/Oracle/Middleware/Oracle_Home/user_projects/domains/wltest_sb

Reason: oracle.security.opss.tools.lifecycle.LifecycleException: JDBC password for opss-data-source is missing for configuring security store to database.

Exception:

oracle.security.opss.tools.lifecycle.LifecycleException: JDBC password for opss-data-source is missing for configuring security store to database.

at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:55)
at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:1967)
at com.oracle.cie.domain.script.jython.WLScriptContext.updateDomain(WLScriptContext.java:604)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)

com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.ScriptException: Domain Extension Application Failed!

Posted by guest on December 15, 2014 at 10:12 AM CET #

Hello,

Can you please clarify which exact template file you are using for extending domain and WLST script?

Posted by Emin Askerov on December 15, 2014 at 02:55 PM CET #

Hello,
I figured that I need to modify the setting of the jdbc system resources to prevent the above error before updating the domain.

I'm extending my newly created domain with OHS colocated template:
MW_HOME/ohs/common/templates/wls/ohs_managed_template_12.1.2.jar

Basically, I now have a fully functional WLS domain but I still cannot use the createOHSInstance because the function doesn't exist.

Here is my code for adding the OHStemplate (assuming all the necessary variable were declared):

print('')
print 'Adding OHS Template'
addTemplate(ohsTemplate);

print 'ADJUST DATA SOURCE SETTINGS';
cd('/')
jdbcsystemresources = cmo.getJDBCSystemResources();
for jdbcsystemresource in jdbcsystemresources:
print('')
print jdbcsystemresource.getName() + '...'
cd ('/JDBCSystemResource/' + jdbcsystemresource.getName() + '/JdbcResource/' + jdbcsystemresource.getName() + '/JDBCConnectionPoolParams/NO_NAME_0');
cmo.setInitialCapacity(1);
cmo.setMaxCapacity(15);
cmo.setMinCapacity(1);
cmo.setStatementCacheSize(0);
cmo.setTestConnectionsOnReserve(java.lang.Boolean('false'));
cmo.setTestTableName('SQL SELECT 1 FROM DUAL');
cmo.setConnectionCreationRetryFrequencySeconds(30);
cd ('/JDBCSystemResource/' + jdbcsystemresource.getName() + '/JdbcResource/' + jdbcsystemresource.getName() + '/JDBCDriverParams/NO_NAME_0');
cmo.setUrl('jdbc:oracle:thin:@//' + fqdn + ':20001/xe');
cmo.setPasswordEncrypted('weblogic');
cd('/');

updateDomain();
closeDomain();

Now, it just throws error after long pause in the updateDomain() command:

Error: updateDomain() failed. Do dumpStack() to see details.
Problem invoking WLST - Traceback (innermost last):
File "/home/ii00wl/scripts/addOHSTemplate.py", line 71, in ?
File "/tmp/WLSTOfflineIni3966059497250833944.py", line 103, in updateDomain

Reason: oracle.security.opss.tools.lifecycle.LifecycleException

Exception:

oracle.security.opss.tools.lifecycle.LifecycleException

at com.oracle.cie.domain.script.jython.CommandExceptionHandler.handleException(CommandExceptionHandler.java:55)
at com.oracle.cie.domain.script.jython.WLScriptContext.handleException(WLScriptContext.java:1967)
at com.oracle.cie.domain.script.jython.WLScriptContext.updateDomain(WLScriptContext.java:604)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)

com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.jython.WLSTException: com.oracle.cie.domain.script.ScriptException: Domain Extension Application Failed!

Posted by guest on December 17, 2014 at 09:43 AM CET #

Hello,

Actually, how are you invoking WLST? Using this: $MW_HOME/oracle_common/common/bin/wlst.sh or this path: $MW_HOME/wlserver/common/bin

Have you tried first case?

Posted by Emin Askerov on December 17, 2014 at 10:10 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Oracle ECEMEA Partner Hubs Migration Center Team

We share our skills to maximize your revenue!
Rapidly and successfully assist you to adopt and implement the latest of Oracle Technology in your solutions.

Stay Connected
partner.imc
@
beehiveonline.oracle-DOT-com
Google+ Subscribe by Email

Search

Archives
« May 2015
SunMonTueWedThuFriSat
     
2
3
5
6
9
12
13
15
16
17
18
20
24
25
28
29
30
31
      
Today