Docker – Apache and Oracle mod_wl (Apache HTTP Server Plug-In)

Maybe a lot of you have already heard and maybe even mastered Docker. This is my first docker image and I’ll like to share some basic concepts I have learned from it.

I will also appreciate any comment to improve this image.

So, what is Docker?

Wikipedia: “Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux”

I see it like a nice way to automate tasks (avoid repeating the same task over and over) and making a container of it, allowing me to use it “where ever” I want.

Basic Docker Operations:


docker build -t [username]/[imagename] [Dockerfile path]

docker build  -t   mfh/webtier  /home/docker/webtier/.

This will use a Dockerfile stored in “/home/docker/webtier/” to create an image called “mfh/WebTier”.


docker run [arguments] [image]

docker run -p 80:80 mfh/webtier

docker run -it mfh/webtier /bin/bash

docker run -d -p 80:80 mfh/webtier


docker ps

This will display the docker containers currently running and its name and id.


docker exec [running container id]

docker exec -it c357930de48c /bin/bash

This will allow you to look into a running container.

My Scenario:

We constantly have clients using a front end server to receive all the incoming requests and then send it to the final destination. In terms of Oracle this will mean, Apache Web Server with redirecting to WebLogic ( More than half of the clients use OHS).

Hands On!

  1. Create a Dockerfile
  2. Download and / or create external files.
  3. Build Dockerfile
  4. Run the Docker container


This file was based on appcontainers/apache.

FROM centos:centos7


ENV APP_NAME apache.local
ENV APACHE_LOG_DIR /var/log/httpd

# Clean, Update, and Install... then clear non English local data.
RUN yum clean all && \
yum -y update && \

# Install required packages
yum -y install httpd24.x86_64 mod_rewrite mod_ssl mod_env && \

# Remove yum cache this bad boy can be 150MBish
yum clean all && \
rm -fr /var/cache/*

# Remove locales other than english
RUN for x in `ls /usr/share/locale | grep -v -i en | grep -v -i local`;do rm -fr /usr/share/locale/$x; done && \
for x in `ls /usr/share/i18n/locales/ | grep -v en_`; do rm -fr /usr/share/i18n/locales/$x; done && \
rm -fr ca* den men wen zen && \
cd /usr/lib/locale && \
localedef --list-archive | grep -v -i ^en | xargs localedef --delete-from-archive && \
mv -f locale-archive locale-archive.tmpl && \

ADD apache-config.conf /etc/httpd/conf.d/

# Copy site
CMD ["mkdir", "/var/www/html"]
ADD site /var/www/html/

# Expose ports

#Copy Apache HTTP Server Plug-In
COPY ./mod_wl/lib/*.so /usr/lib64/httpd/modules/
COPY mod_wl.conf /etc/httpd/conf.d/
COPY mod_wl.load.conf /etc/httpd/conf.modules.d/

#Create Volume
VOLUME ["/var/www/html", "/var/log/httpd"]

# Start apache.
CMD /usr/sbin/httpd -D FOREGROUND

To run the container:

docker run -d -p 80:80 -v ~/docker/webtier/html:/var/ww/html webtier

More information regarding Docker:

Jenkins User Conference London – World Tour 2015

I had the opportunity to attend to this conference and I want to share some quick notes about my experience, also to give you some information of what’s coming and share some resources.

2015-06-23 10.26.16

Based on the amount of people/companies attending, you can tell how the enterprise is paying more attention to Continuous Integration (CI) and Continuous Delivery (CD). This has as a consequence that Jenkins needs to start putting some order into what happens in the community and start driving Best Practices to it’s Best.

Now to the information:

Keynote by the Jenkins Master:

  • History of Jenkins
  • Docker integration with Jenkins
  • WorkFlow Plugin
  • Jenkins in Hardware
  • Jenkins and DevOps
  • Community Growth

I won’t go through all the sessions and I will just give a simplified version of what I think is worth mentioning in this post:

“Seven Habits of Highly Effective Jenkins Users”

Great session by Andrew Bayer, the community and some private companies have developed more than 1000 plugins already and is hard to know what to use, also the lack of initial documentation made people use Jenkins the best they could, this is what I take from his session:

  • Have a Production Environment and DON’T break it.
    • Upgrade only if you need to and if you plan to do so, don’t do it directly in Production.
    • Same applies for plugins already in use.
    • Backup your configuration files
  • Have multiple Masters and Slaves!!!
    • You can break this per teams or projects or how ever fits best in your organization.
  • Make sure you only install plugins you need.
    • In all environments, is great if you want to play with some, but do so in a development environment and erase it if it wasn’t useful.
  • Integrate with Other tools
    • Jira, Git, etc.

“How to optimize Automated Testing with Everyone’s Favorite Butler”
by Viktor Clerc

This was another good session, mainly about testing, for some it might seem repetitive as at this stage we all should be aware of best practices around testing, but there are a couple of things that are worth mentioning from this session:

  • “Developers are becoming Testers” / “Testers are Developers”
  • Continuous Delivery = Execution + Analysis = Speed + Quality
  • Cohn’s Pyramid
    • UI, Service, Unit.
    • Test Use Cases
      • Functional Coverage not Technical Coverage.
    • Involve users in every stage of the delivery process.

“Evolving the Jenkins UI”
by Tom Fennelly and Gus Reiber

Is there anything else to say? I think is great they are doing this, I’m pretty sure that this will make UX much better and it should improve productivity:

  • CSS Modularization
    • Using Less
  • JavaScript Modularization
  • Change of some components

You can get involved in here:

“Orchestrating Your Pipelines with Jenkins, Python and the Jenkins API”
by Pradeepto K. Bhattacharya

This session was related to a real life experience using Jenkin’s APIs with Python Wrappers. You can tell the APIs are quite limited but useful enough to start using them actively. This is what you can do with Python:

  • Create new jobs
  • Copy existing jobs
  • Delete jobs
  • Update jobs
  • Get a job’s build information
  • Get Jenkins master version information
  • Get Jenkins plugin information
  • Start a build on a job
  • Create nodes
  • Enable/Disable nodes
  • Get information on nodes

There are no official “Java Wrappers” for this API, but you can consume it as:

  1. XML
  2. JSON
  3. Python

You can get more information here: Jenkins

“Scaling Your Jenkins Master with Docker”
by Christophe Muller

I’m not an expert in Docker, well at least not yet, so my opinion might be irrelevant, never the less, I think this was a really good presentation in order to understand the level of integration between Jenkins and Docker.

“Scaling of Jenkins Pipeline Creation and Maintenance”
by Damien Coraboeuf

Another interesting session, where an extension of the Job DSL Plugin was presented which helps to simplify life when you have a “jungle” of jobs: Seed Plugin that it should help to automate the generation and maintenance of pipelines.

Implementation overview

“Jenkins Made Easy”
by Nobuaki Ogawa

I was tempted not to include this one in my post, but there is 1 diagram that is worth mentioning in here and is self explanatory regarding the confusion between Continuous Integration, Continuous Build, Continuous Testing, Continuous Delivery,Continuous Deployment and Continuous Feedback:


If you wan’t more information please click the links provided in the post. I’m pretty sure there was much more than this in other sessions, if you have the slides please share them in the comments otherwise, thanks for reading.

P.S. If you tought I’ll leave Oracle out of this post think twice: Open Source Tools for Java Development

WebCenter Patch

I have been out for some time, but wanted to share the new WebCenter Release, I’ll create another post to provide a personal feedback.
WebCenter Portal
What’s New:
WebCenter Content

What’s New:

Oracle Mobile Application Framework

After a long wait the evolution of Oracle ADF Mobile has been released, the name: Oracle Mobile Application Framework or MAF.



To use it, you just need to download JDeveloper 12c ( and go to updates to download the extension.

JDeveloper 12c

One of the most important improvements is the Security, and I’m not talking only about the Oracle Mobile Security Suite:

From the start of the application you start to notice important difference between the applications:

Oracle MAF


Oracle MAF



Oracle ADF Mobile



Oracle MAF


Oracle ADF Mobile



Oracle MAF


Oracle ADF Mobile



Oracle MAF

2014-07-03_0206I’ll go into details in future posts.

Customize Profile for users in WebCenter Portal (Spaces/Builder)

Have you notice that when using WebCenter Portal (Spaces/Builder) you can only modify specific things from your profile? Or how about preventing the user from changing his password?


Well this can be customized really easily for all your users, just login as an Admin user:

2014-05-29_04532014-05-29_0454You can also tune your application changing the cache settings for profile sync between Portal and your LDAP:



Oracle Access Manager – Custom Pages

I have been recently working on a project to customize OAM, sounds easy right? it is if you have the correct information, you have to pay attention to the details so you know what to look for and where you to find it:


  1. Custom pages does not mean Login page only
  2. Change password and dependants are also included
  3. Version of OAM
  4. Custom Pages technology JSP
  5. Cluster environment.

OAM Setup:

  1. Configure WebGate (Not part of this post)
  2. Create a New Authentication Scheme
  3. Update Password Service URL

New Authentication Scheme

  • Login to  oamconsole http:server:port/oamconsole
  • Create a New Authentication Scheme


The important bit:

  • Challenge Method: Form
  • Challenge URL:  Your login page
  • Context Type: external


Custom Pages

OAM provides a base project so you don’t have to start everything from scratch or at least it will give you an idea of the proper structure your project should have. You can use any web echnology you prefer, I’ll show the solution with JSP.

Login Page

 Get values from Header and from URL:

 //Request OAM_REQ parameter from Header OAM Version 11.1.2
 String oamReq = request.getHeader("OAM_REQ");
 //Error code sent by OAM in case of failure
 String errCode = request.getHeader("p_error_code"); 

 String requestId = request.getParameter("request_id");
 String resourceUrl = request.getParameter("resource_url");

The Form:

 <form name="ssoFrm" id="login" autocomplete="off"

 <label for="username">Username</label>
 <input name="userid" type="text" id="username"

 <label for="password">Password</label>
 <input name="password" type="password" id="password"
 class="required" size="36"></input>

 <input name="request_id" value="<%=requestId%>"

 <% if(oamReq != null && !"".equals(oamReq) ) { %>

 <input id="serverctx" name="OAM_REQ" type="hidden"
 <% }%>

//You can map this value in a Resource Bundle

 <button id="sSubmit" name="sSubmit" type="submit">

Change Password

Make sure you change the Password Service URL to point to your custom page: 2014-05-21_0331   Change Password  Page must contain:

 //Set the Expires and Cache Control Headers
 response.setHeader("Cache-Control", "no-cache, no-store");
 response.setHeader("Pragma", "no-cache");
 response.setHeader("Expires", "0");
 response.setContentType("text/html; charset=UTF-8");

There are 2 considerations we need to take into account for this page:

  1. Get policy rules from OAM
  2. In case of errors being present get password error messages
String reqId = request.getParameter(GenericConstants.REQUEST_ID);
//Password Policies
String rules=request.getParameter("ruleDesc");
//In case of error, gets the error messages
String errorCode=request.getHeader("p_error_code");
String errorMsg=request.getParameter("p_sec_error_msg");
//Type of the request.
String type= request.getParameter("type");
//In case of not following Password Policies, errors thrown back.
String rejectedRules=request.getParameter("rejectedRuleDesc");
 String redirectURL = "LandingPage.jsp";
 String rejectedMsg = "";
 if(rejectedRules != ""){
 if(rejectedRules.indexOf('~') != -1) {
 String[] rejected = rejectedRules.split("~");
 for(String eachResult : rejected) {
 if(eachResult.indexOf(":") != -1) {
 String messageKey = eachResult.substring(0, eachResult.indexOf(":"));
 String placeHolderValue = eachResult.substring(eachResult.indexOf("::") + 2, eachResult.length());
 String msgString = props.getProperties().getProperty(messageKey);
 String message = MessageFormat.format(msgString, placeHolderValue);
 String displayValue = placeHolderValue;
 rejectedMsg +=message + "";
 else {
 String resourceBundleKey = eachResult;
 String msgString = props.getProperties().getProperty(resourceBundleKey);
 if(null != msgString){
 rejectedMsg += msgString +"";

Log the user in when the change is accepted:

<script type="text/javascript">

WebCenter Pagelet Producer – Part 1

In one of my previous posts I wrote about Web Clipping, this time I’ll like to write something about WebCenter Pagelet Producer :

  1. How to create a Resource
  2. How to extract Content
  3. How to Inject Content (In the extracted content)
  4. How to consume a Pagelet

WebCenter Pagelet Producer

Allows you to publish content from back-end applications via pagelets. A pagelet is a reusable UI component that can run on any web page or web application. 

In other words is a Mashup Enabler.

Example: You have a requirement where you need to integrate different pieces of content from an external page/system into your Web Application/ Portal ( HR Intranet wants to display content from Finance Intranet)

Hands On


  1. Oracle WebCenter Server
  2. Have WC_Portlet Managed Server Running
  3. Admin user (ex. weblogic)
  4. The URL of the Application where you want to extract information
    I’ll use infoMENTUM’s.

Login to WebCenter Pagelet Producer Admin:

To create a resource (Pagelet and its resources):

For the Source URL make sure to keep it generic so in the future you can access all the levels of the Application (ex. It’s recommended to always select DHTML Rewriting.
Now the important part, the Pagelet.
Insert the General information for your Pagelet.

In the URL Suffix include the rest of the URL to access the resource you want to access (ex. about-us/media-centre/videos-and-webcasts/generationc).

The final URL will look like this when browsed for Content:

To extract the content you’re looking for, go to the Clipper section and create a new one:
To extract content you have two different ways of doing it:
Graphical Clipper: It will open a window with the content URL so you select the piece of content you want to clip to your Pagelet.
Advanced Clipper: You need to add the tag and an attribute of that tag so it gets recognized by the Clipper.






Now let’s use a bit of Injection:
Select where do you want to inject your content, this can be as simple as a string.

Write the content you want to inject:


Final Result:2014-04-06_1402

If you want to know how to access your Pagelet go to the Documentation section:
You can select your preferred method for integration, REST or Javascript.

That’s it for a basic Pagelet I’ll talk about Advance Features in a following post.


Oracle ADF Faces Cookbook as a Technical Reviewer

Oracle ADF

Author: Amr Gawish
Technical Reviewers: Mauro Flores, Matteo Formica, Bejoy thomas, Victor Jabur, Daniel Ribeiro

I recently had the opportunity to review this cookbook. As you might or might not know, cookbooks are meant for people to learn/know about a specific topic following recipes, this makes life easier for the reader but it makes it complex for the author to keep it simple but at the same time useful.

Amr Gawish did a great job with this book, he really tried to kept it focus to what it really matter, that in this case was ADF Faces.

We need to remember that ADF follows an MVC Architecture, for this reason it’s important to distinguish the difference between every layer, so it’s not the same to say ADF than ADF FACES. The latter is the front end or view layer of the ADF Framework.

From my personal point of view I like this book because it covers the most important topics of ADF FACES, it has interesting recipes about complex and basic topics and part of my recommendations was to always follow best practices, which he tries to encourage.

As mentioned before this will only cover one layer of the ADF Framework but it does a good job with it, I’ll recommend you to have a complimentary book to understand or have your recipes to hand regarding the other two layers.

It doesn’t matter if you’re a beginner or an expert in ADF, this book needs to be part of your library.

Hands On Time! – WebCenter Portal Tools part 1

When it comes to Portal I’m not a big fan of using Portlets, don’t get me wrong they are great but they can get messy if you’re not careful enough, whenever I can I prefer to use ADF TaskFlows….. yes yes I know they are made for different things and Yannick Ongena has a good article about it.  But the portlets that WebCenter bundles are really useful if you know how to use them. Let’s start with “Portal Tools”:

Web Clipping Producer

Is a publishing portlet that enables you to integrate any web application with applications built using Oracle WebCenter.


  1. JDeveloper with WebCenter Extension. I’m using (
  2. Demo WebCenter Portal Framework Application

You don’t have to install a full WebCenter environment to work with this, we’ll make use of the one integrated in JDeveloper: 1. Start your integrated WebLogic Server 2014-03-02_2356 2. Deploy PortalTools Portlet Producer 2014-03-02_2153 2014-03-03_0228

3. Create a new Oracle PDK-Java Producer connection:


2014-03-03_0238 2014-03-03_0241 2014-03-03_0242


4. Drag and Drop the portlet to your page. In my case I’m using home.jspx.
NOTE: You can use the portlet as many times as you want inside the page.


5. Run your Portal,  Login and go to your page:


6. Edit the Portlet:


7. Now the interesting part, select the site where you would like to take your “Mash-ups” from, in this example I’m using Oracle – WebCenter :



8. Repeat this procedure for all the portlets:


NOTE: You can add more WebClipping Portlets in run time with Composer.

Blog at

Up ↑

%d bloggers like this: