Thursday, January 6, 2011

One Fine Day WebLogic Wanted to Talk Through Apache WebServer.. :)

Hi There,

Today I have something interesting which is been worked out from last few days, as nowadays pulling time for blogging is getting difficult and so posts from me are reduced in number.

However I tried to pull some nice moments out of busy schedule to give you a good Tutorial on how to configure the Apache Web Server with WebLogic Server, though it looks really simple in this post but Apache WebServer configuration at Ubuntu has eaten my ample time to notice.

Well Here we start :

Installing WebLogic Server is Easy and Fast though to help some newbies I am attaching screen shots to understand it in better way ;)

Steps to Install WebLogic Server :

=> Download the required software from http://www.oracle.com if you have valid support contract.

=> Be prepared with all the information where you want to install the WebLogic Server and other architecture plans as you need to specify some of the values while installing WebLogic Server

=>This Post will tell you the installation and configuration story on Linux Operating System (32bit), so I have decided to use Ubuntu Operating System which is free and beautiful

=> Download the WebLogic Server .bin file from Oracle E-Delivery Site or OTN Site from the Downloads Section

=> Open a terminal at your Linux Operating System, Enter as root and execute below command.

"root@shailesh-Inspiron-N4010:/home/shailesh/Oracle#./Oracle WebLogic Server 11g R1(10.3.3).bin"
Extracting 0%........................

Follow the below screens as per the steps execution
The Installer Starts : Click On Next
Select the Middleware Home : Edit Path and Click on Next
Selecting The Software Update Information Preferences : Click On Yes

Select the type of Installation - Select The Components: Click On Next
Choose Product Installation Directory for Various WebLogic Supported Products : Click On Next
Confirmation Screen For Space Usage after the Product Install : Click On Next
Installation Starts : NO INTERVENTION REQUIRED

Installation Done, Click on Done to Start The Quick Start Window for Domain Creation and Others.

Quick Start Window : Click On Getting Started With WebLogic Server 10.3.3
Configuration Wizard Starts
Select Create A WebLogic Domain Go for Second Option if you already have domain created
Select Domain Source : Template Selection


Name of the Domain here is PRDMasterDOmain
User Name/Password Change





Select Mode of Domain Creation : Production Mode
Select Components to Add to the WebLogic Server Before Creating Domain
Specify Admin Server Details : IP Address And Port : Click Next
Just for Information : Click Next
Domain Creation is In Progress
Your home is Created Now : You can Live in there : Click Next
Start The WebLogic Server Domain : As Below
=> Command Instructions : Open The Terminal

shailesh@shailesh-Inspiron-N4010:~/Oracle/WebLogic/Domains$ ls -lrt
total 4
drwxr-x--- 11 shailesh shailesh 4096 2011-01-04 17:55 PRDMasterDomain
shailesh@shailesh-Inspiron-N4010:~/Oracle/WebLogic/Domains$
shailesh@shailesh-Inspiron-N4010:~/Oracle/WebLogic/Domains/PRDMasterDomain/bin$ ./startWebLogic.sh 

..........
..........
..........
## Enter Username and Password You have given during the installation

<4 Jan, 2011 5:57:24 PM IST> <Info> <Security> <BEA-090065> <Getting boot identity from user.>
Enter username to boot WebLogic server:weblogic
Enter password to boot WebLogic server:


<4 Jan, 2011 5:58:18 PM IST> <Notice> <Server> <BEA-002613> <Channel "Default[1]" is now listening on 0:0:0:0:0:0:0:1:7001 for protocols iiop, t3, ldap, snmp, http.>
<4 Jan, 2011 5:58:18 PM IST> <Notice> <Server> <BEA-002613> <Channel "Default" is now listening on 127.0.0.1:7001 for protocols iiop, t3, ldap, snmp, http.>
<4 Jan, 2011 5:58:18 PM IST> <Notice> <WebLogicServer> <BEA-000329> <Started WebLogic Admin Server "AdminServer" for domain "PRDMasterDomain" running in Production Mode>
<4 Jan, 2011 5:58:19 PM IST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to RUNNING>
<4 Jan, 2011 5:58:19 PM IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>

Start The WebLogic Admin Server Console at any Browser
Login with the Username and Password and Here You Get the Consle
=> Here you have your WebLogic Server Installed... It was kind of easy, and here it comes the Apache Web Server Installation
=> Download the Software From http://httpd.apache.org/

And follow following steps to install the Apache Web Server in Your linux Environment.
+ Download the latest version of Apache Web Server : httpd-2.2.17.tar.gz
+ Gunzip and Untar it with commands gunzip and tar -xvf on the software.
+ Navigate to httpd-2.2.17 Directory and execute ./configure command with following arguments
./configure --prefix=/home/shailesh/WebServer/apache2 --enable-so --enable-rewrite --enable-auth-digest=shared

If Using Open SSL in the software use below command.
./configure --prefix=/home/shailesh/WebServer/apache2 --enable-so --enable-rewrite --enable-auth-digest=shared --enable-ssl

+ This command checks for the existing libraries and creates necessary directories for Apache Web Server Installation

+ After the execution stops, execute

./make = It compiles necessary libraries and source files of the Apache Web Server to prepare for installation on the prefix directory

+ Next Comes is
./make install = installs apache Web Server on prefix directory
root@shailesh-Inspiron-N4010:/home/shailesh/WebServer/apache2# ls -rlt
total 60
drwxr-xr-x  2 root root  4096 2010-10-15 00:13 htdocs
drwxr-xr-x 14 root root 12288 2010-10-15 00:15 manual
drwxr-xr-x  3 root root  4096 2011-01-06 21:42 lib
drwxr-xr-x  2 root root  4096 2011-01-06 21:42 modules
drwxr-xr-x  2 root root  4096 2011-01-06 21:42 bin
drwxr-xr-x  4 root root  4096 2011-01-06 21:42 conf
drwxr-xr-x  3 root root  4096 2011-01-06 21:42 error
drwxr-xr-x  3 root root  4096 2011-01-06 21:42 icons
drwxr-xr-x  2 root root  4096 2011-01-06 21:42 logs
drwxr-xr-x  2 root root  4096 2011-01-06 21:42 cgi-bin
drwxr-xr-x  2 root root  4096 2011-01-06 21:42 include
drwxr-xr-x  2 root root  4096 2011-01-06 21:42 build
drwxr-xr-x  4 root root  4096 2011-01-06 21:42 man
root@shailesh-Inspiron-N4010:/home/shailesh/WebServer/apache2#
+ To Start Apache Server, Navigate to bin directory and Execute
./apachectl start (You can provide start/restart/stop commands)


+ Try to access the http://<youripaddress>/  - If we get page saying It works !, then we are done with Apache Installation
Apache Test Page




+ Now to configure the WebLogic Server We have some pre-requisites as below.
-- We need a suitable plugin for the communication protocol to establish
-- We Need the server information from the WebLogic Server to configure at the   Web Server End.
-- We Need Specification like, How to Access the application and Performance tuning configuration which can be set at Web Server Side.

+ Download the WebLogic Server Plug-in from OTN Download site or you may get it in <WL_HOME>\server\plugin directory for appropriate Platform as it is platform dependent code.

+ For Apache Web Server Version 2.2 Download Plugin mod_wl_22.so file for Linux Opertating System and copy it in Apache Software Installation directory under modules (not necessary). (/home/shailesh/WebServer/apache2/modules.)

+ Now the Major Configuration Part :
+ Edit httpd.conf file from /home/shailesh/WebServer/apache2/conf/httpd.conf
+ Add a line to invoke the WebLogic Server Plug-in as below
LoadModule weblogic_module /usr/lib/apache2/modules/mod_wl_22.so

+ And Add below modules for WebLogic Server Configuration


<IfModule mod_weblogic.c>
WebLogicHost 127.0.0.1
WebLogicPort 7001
</IfModule>

+ If I want to access the console application from the Web Server Side, I would put one more module as below.
<Location /console>
SetHandler weblogic-handler
WebLogicHost 127.0.0.1
WebLogicPort 7001
DebugConfigInfo ON
Pathtrim /weblogic
</Location>

Note : For Any Changes You Do At httpd.conf file you have to restart the Apache Web Server.
Note : These Modules you can add anywhere in the file after invoking the Plug-in Module

+ Here we get to see the console accessed over the Web Server Configured for console App.
WebLogic Console Accessed Through Apache WebServer
+ In Similar way try deploying an application at WebLogic Server Side - Sample here is shown for Hello World Application and Add a module as below in httpd.conf file, then restart
<Location /helloworld/*>
SetHandler weblogic-handler
WebLogicHost 127.0.0.1
WebLogicPort 7001
DebugConfigInfo ON
Pathtrim /weblogic
</Location>


+ Try to access it over the Web Server you will see the page as below.


Well, Here I am ending this Tutorial, And I confirm that if you have performed all the steps in this tutorial then you are set up the communication between WebLogic and Web Server..!!

Any Questions / Feedback
mail me @ shailesh.dyade@gmail.com

Thanks to All..

1 comment:

rohit said...

Just found your post by searching on the Google, I am Impressed and Learned Lot of new thing from your post.
appvn