Monday, October 3, 2011

Install and configrue Web Server 1.1 Plug-Ins with Oracle WebLogic Server 11g Release 1 (10.3.3)

1- Download Apache Software

http://httpd.apache.org

2-Install Apache op Linux

cd /usr/local/src

# gzip -d httpd-2.2.9.tar.gz

# tar xvf httpd-2.2.9.tar

cd httpd-2.2.9

# ./configure --help

3- In the following example, Apache will be compiled and installed to the default location

/usr/local/apache2 with the DSO capability. Using the –enable-so option, you can load modules

to Apache at runtime via the Dynamic Shared Object (DSO) mechanism, rather than requiring a recompilation.

4-# ./configure --enable-so

5- # make

6- # make install

Note: During the ./configure, you may get the following error message.


7- # ./configure --enable-so

configure: error: no acceptable C compiler found in $PATH

See `config.log' for more details.

configure failed for srclib/aprInstall the gcc and the dependent modules as shown below and try ./configure again to fix the above issue.


# rpm -ivh gcc-4.1.2-14.el5.i386.rpm glibc-devel-2.5-18.i386.rpm glibc-headers-2.5-18.i38

6.rpm kernel-headers-2.6.18-53.el5.i386.rpm

Preparing... ########################################### [100%]

1:kernel-headers ########################################### [ 25%]

2:glibc-headers ########################################### [ 50%]

3:glibc-devel ########################################### [ 75%]

4:gcc ########################################### [100%]



Start Apache and verify installation


8- # cd /usr/local/apache2/bin

9- # ./apachectl start

Go to http://local-host, which should display the default message “It Works!”

10- Dowload WLSPlugin from http://Metalink.oracle.com

11- unzip WLSPlugin1.1-64bitApache2.2-linux64-x86_64.zip

for example /BEA_HOME/WLSPlugin1 or anyother directory

12- make sure the mod_wl_220.so library in you Plg-in lib directory

13 - Verify that mod_so.c is enabled by executing the following command:

#APACHE_HOME\bin\apachectl -l . the result must be like that

/apachectl -l

Compiled in modules:

core.c

mod_authn_file.c

mod_authn_default.c

mod_authz_host.c

mod_authz_groupfile.c

mod_authz_user.c

mod_authz_default.c

mod_auth_basic.c

mod_include.c

mod_filter.c

mod_log_config.c

mod_env.c

mod_setenvif.c

mod_version.c

prefork.c

http_core.c

mod_mime.c

mod_status.c

mod_autoindex.c

mod_asis.c

mod_cgi.c

mod_negotiation.c

mod_dir.c

mod_actions.c

mod_userdir.c

mod_alias.c

mod_so.c

This command lists all enabled modules. If mod_so.c is not listed, you must rebuild your Apache HTTP Server,
making sure that the following options are configured:
..

--enable-module=so

--enable-rule=SHARED_CORE

Configuring the apache plug-in

14- Make copy of httpd.conf file

15- Add the http.conf file

# vi http.conf

- Add the following lines to the http.conf file

LoadModule weblogic_module /mnt/orc6/Oracle/Middleware/WLSPlugin1.1/lib/mod_wl.so




WebLogicHost (your weblogic host name)
WebLogicCluster  (your host name:port number, host name:port number)
Ex.
WebLogicCLuster myhost:7003,myhost:7004

Debug ALL

DebugConfigInfo ON

WLLogFile /mnt/orc6/Oracle/Middleware/WLSPlugin1.1/wl-proxy.log


   ex

SetHandler weblogic-handler

Using virtual host in place of Load Moduel

We can add the followin lines if we want to use virtual host in place of load moduel




SetHandler weblogic-handler

WebLogicCluster Hostname:7003,HostName:7004






SetHandler weblogic-handler

WebLogicHost  YOUR HOST NAME
WebLogicPort 7002



16- Ensure that the ${PLUGIN_HOME}/lib is included in the LD_LIBRARY_PATH

$ export LD_LIBRARY_PATH=/home/myhome/weblogic-plugin-1.1/lib

other options include copying the 'lib' contents to APACHE_HOME/lib or

editing the APACHE_HOME/bin/apachectl to update the LD_LIBRARY_PATH
18- Start the apache server

$ ${APACHE_HOME}/bin/apachectl start


19- Start Admin Server and Managed Servers

17- Check your Application URL
example: http://Myhost/mywebapp









Thursday, September 29, 2011

Weblogic Tools

D:\oracle\standalone-wl\wlserver_10.3\common\bin>config_builder.cmd
wls:/offline> createDomain ('D:/Middleware/wlserver_10.3/common/templates/domains/basic_Domain10.3.4.0.jar','D:/Middleware/user_project s/domains/hal','weblogic','PASSWORD')
wls:/offline>

Create Managed Servers

ls:/offline/hal>create ('ManagedServer Name "example la"', 'Server')
Proxy for la: Name=la, Type=Server
wls:/offline/hal>cd ('Server/la')
wls:/offline/hal/Server/la>set ('ListenPort', 8102)
wls:/offline/hal/Server/la>set ('ListenAddress', 'Host Name')

wls:/offline/hal/Server/la>cd ('/')

Create The second Managed Server
wls:/offline/hal>create ('usa', 'Server')
Proxy for usa: Name=usa, Type=Server
wls:/offline/hal>cd ('Server/usa')
wls:/offline/hal/Server/usa>set ('ListenPort', 8103)
wls:/offline/hal/Server/usa>set ('ListenAddress', 'Host Name')

Start Weblogic without providing password

In order to start Weblogic "AdminServe'r or ManagedServer" without password, you'll need to follow these steps;

Starting weblogic without password need a file call boot.properties. In this file you'll provide the weblogic user name & password.
- login as WLSowner
- cd /Weblogic_home/user_projects/domain/base_domains/server/"server_name" create a direcotry "security" # mkdir security
- cd security, vi boot.properties
- in the boot.properties file as the following lines
username= weblogic
password= XXXXXX
- save this file
- cd Weblogic_home/user_projects/domain/base_domains/bin
- on the prompt #nohup ./startWebLogic.sh &

Installation Configuration Oracle WebCenter 11g on Redhat 5.5

NodeManager unreachable

If you meet one of the following problems
- NodeManager unreachable or you are not able to start your managed Server
- The domain was not registered in the nodemanager.domains file and dynamic domain registration is not supported. Please register the domain in the nodemanager

You will need to follow these steps;

1- Start Admin Server with start script startweblogic.sh. you can find this script under /BEA_HOME/Domains/YOUR_DOMAIN NAME/bin
2- Start WLS (Wblogic Scripting Tools)under /BEA_HOME/wlserver_10.3/common/bin/(wlst.sh)
3- Start Node Manager (you can start NodeManager with or without connecting to Admin Server
wls:/offline> startNodeManager()
4- Connect to Admin Server
wls:/offline> connect ('weblogic','XXXXXX','t3://YOUR HOST_NAME:7002')

Connecting to t3://XXXXXXXXX:7002 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.
5- Enroll NodeManager
wls:/base_domain/serverConfig> nmEnroll('BEA_HOMEuser_projects/domains/base_domain',BEA_HOMEcommon/nodemanager')

Successfully enrolled this machine with the domain directory at /BEA_HOME/domains/base_domain.
wls:/base_domain/serverConfig>


Updated on 18-2-2012

After finishing with Enroll you'll need to  execute a couple of things.
See  http://docs.oracle.com/cd/E12839_01/web.1111/e13740/nodemgr_config.htm
You can start Managed server through the following ways;

- You can start a Managed Server using Node Manager through the Administration Console.

- Node Manager monitors the Managed Servers that it has started.
- Automatic restart of Managed Servers is enabled. Node Manager restarts server instances that it killed or were killed by another method.

To enable ManagedServer to be started through one of the above ways. You'll need to execute all of following steps

Now after starting AdminServer, you'll need to go to AdminServer Console (http://localhost:7001/console
1- Change this parameters to ture (default is false) StartScriptEnabled=true, StopScriptEnabled=true  in nodemanager.properties,

 for each server (incl. AdminServer) in the environment, go to the server start tab and put in the appropriate values.

- Java Home (D:\weblogic\Oracle\wls11g\jrockit_160_14_R27.6.5-32)
- Java Vendor Oracle
- BEA Home D:\weblogic\Oracle\wls11g
- Root Directory D:\weblogic\Oracle\wls11g\user_projects\domains\my_domain
- Classpath  is empty (reason this pramaeter is included in Startscriptenbaled
- Arguments -Xnohup ( Arguments If you’re using Sun JDK instead of JRockit, then use –Xrs instead of –Xnohup )
- Security Policy File D:\weblogic\Oracle\wls11g\wlserver_10.3\server\lib\weblogic.policy
-User Name ex. weblogic ( The user name to use when booting this server. The Administration Console inserts the user name that you supplied when you logged in to the console)
- Password  *************
- Confirm Password ***********


- Save
- Now do the same thing for each managed server.
- Activate the changes if required

Setting Node Manager Domain Username and Password


- Set the Node Manager username/password for the domain in the console
- Click in the console navigator
- Select Security tab
- Expand to the "Advanced" options about half-way down the page
- Choose a Node Manager username/password and put it in the username/password/confirm boxes your  credentials, these could be unique from your user used to start the AdminServer, but I chose to keep the same weblogic/*******. If you change this user name and password, then you’ll need to specify both when using the command nmConnect.
 The node manager  username & password are svaed under this direcotry
nm_password.properties: This file stores the Node Manager username and password.

This file is located in DOMAIN_HOME/config/nodemanager.

Test the NodeManager (Have NodeManager Start and Stop the Servers)

- Stop Admin Server or kill that process
- Now we will connect with Node Manager to start Admin Server and also Managerd Servers
wls:/base_domain/serverConfig> nmConnect('weblogic','XXXX password','You Host_ANME','5556','base_domain','/BEA_HOME/user_projects/domains/base_domain'
Connecting to Node Manager ...
Successfully Connected to Node Manager.

- Start Admin Server

wls:/nm/base_domain> nmStart ('AdminServer')

Note: during the start of AdminServer or even the ManagerServer, may be you'll need manually to create boot.properties file
You will need to create boot.properties file under /BEA_HOME/user_projects/domains/base_domain/servers/AdminServer/data/nodemanager. Just put the follwoing lines in this file. Just put these two lines
password= (password for adminserver)
username= weblogic
save file & start AdminServer again
- start Managed Server
wls:/nm/base_domain> start ('blog1')
Successfully started server blog1 ...
wls:/nm/base_domain> start ('blog2')
- Check the status of your servers
wls:/nm/base_domain> nmServerStatus ('AdminServer')
RUNNING
wls:/nm/base_domain> nmServerStatus ('blog1')
RUNNING
wls:/nm/base_domain> nmServerStatus ('blog2')
RUNNING

Another problem, Starting Managed Server without NodeManager

You can do that by adding boot.properites file to the security directory under your server_name\security
WL_\user_projects\domains\base_domain\servers\blog2\security.

Cheers,





 





Wednesday, June 29, 2011

Installation Oracle 11g Rel2 on Linux Redhat 5.5

Before you start,you'll need to do the following steps

1- on the linux system (root user)
In order to avoid pre-requisite check problem, you must install the following packages;
rpm -Uvh binutils-2.*
rpm -Uvh compat-libstdc++-33*
rpm -Uvh elfutils-libelf-0.*
rpm -Uvh elfutils-libelf-devel-*
rpm -Uvh gcc-4.*
rpm -Uvh gcc-c++-4.*
rpm -Uvh glibc-2.*
rpm -Uvh glibc-common-2.*
rpm -Uvh glibc-devel-2.*
rpm -Uvh glibc-headers-2.*
rpm -Uvh ksh-2*
rpm -Uvh libaio-0.*
rpm -Uvh libaio-devel-0.*
rpm -Uvh libgcc-4.*
rpm -Uvh libstdc++-4.*
rpm -Uvh libstdc++-devel-4.*
rpm -Uvh make-3.*
rpm -Uvh sysstat-7.*
rpm -Uvh unixODBC-2.*
rpm -Uvh unixODBC-devel-2.*

Most of these package will be on media 2,3 and 5

2- Add the following lines to the "/etc/sysctl.conf" file
a- vi /etc/sysctl.conf
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
fs.aio-max-nr = 1048576
fs.file-max = 6815744
#kernel.shmall = 2097152
kernel.shmmax = 1054504960
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
b- update your sysctl.conf
# /sbin/sysctl -p

3- Add the following lines to the "/etc/security/limits.conf" file
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

# End of file
4- Add the following lines to the "/etc/pam.d/login" file
session required pam_limits.so

5- Disable secure linux by editing the "/etc/selinux/config", normal this parameter is setting to Enable

SELINUX=disabled

6- Create groups and user
groupadd -g 502 oinstall
groupadd -g 503 dba
useradd -u 504 -g oinstall -G dba oracle
passwd oracle

7- Add the following lines to oracle user profile
# vi /home/oracle/.bash_profile
umask 022

# User specific environment and startup programs

export ORACLE_BASE=/mnt/orc5/app/oracle/product/db

export ORACLE_HOME=$ORACLE_BASE/11.2.0/dbhome

export PATH=/usr/sbin:$PATH

export PATH=$ORACLE_HOME/bin:$PATH

export ORACLE_TERM=xterm

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib

export CLASSPATH=$ORACLE_HOME/JRE

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib

export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib

export TEMP=/tmp

export TMPDIR=/tmp

8- check /etc/hosts
The hosts file must have the following lines
127.0.0.1 localhost.localdomain localhost
XXX.XXX.XXX.XXX full qualified domain name hostname
example
192.168.4.0 hamdy.blogspot.com hamdy

9- Start installation
In order to run teh GUI interface, you'll need an Xserver running on the Linux server ex. vncserver (I use vncserver)
a- on the linux server login as Oracle user
#/usr/bin/vncserever, vnc session will be started

b- on you local machine
You'll need vncviewer and Xserver

c- login as Oracle user on the vncviewer( hummingbird )
export DISPLAY to you local machine example
DISPLAY=:0.0; export Display
d- start the Xserver on you local-machine
f- check if you Display variable is okay,
# xclock, if everthing is okay, just go further to the following step

10- Move to the Oracle software location &unzip the files

11- runInstaller

12- #./runInstaller

Wednesday, June 15, 2011

Create and configure Cluster

wls:/offline/hal>create ('hamdy', 'Cluster')
Proxy for hamdy: Name=hamdy, Type=Cluster
wls:/offline/hal>assign ('Server', 'la,usa','Cluster', 'hamdy')
wls:/offline/hal>cd ('Cluster/hamdy')
wls:/offline/hal/Cluster/hamdy>set ('MulticastAddress', '239.2.0.3')
wls:/offline/hal/Cluster/hamdy>set ('MulticastPort',9200)
wls:/offline/hal/Cluster/hamdy>

Write your update to the domain & close the domain template

wls:/offline/hal/Cluster/hamdy>updateDomain()
wls:/offline/hal/Cluster/hamdy>closeDomain()
wls:/offline>exit()

Create and Configure Manged Servers

wls:/offline/hal>create ('ManagedServer Name "example la"', 'Server')
Proxy for la: Name=la, Type=Server
wls:/offline/hal>cd ('Server/la')
wls:/offline/hal/Server/la>set ('ListenPort', 8102)
wls:/offline/hal/Server/la>set ('ListenAddress', 'Host Name')

wls:/offline/hal/Server/la>cd ('/')

Create The second Managed Server
wls:/offline/hal>create ('usa', 'Server')
Proxy for usa: Name=usa, Type=Server
wls:/offline/hal>cd ('Server/usa')
wls:/offline/hal/Server/usa>set ('ListenPort', 8103)
wls:/offline/hal/Server/usa>set ('ListenAddress', 'Host Name')

Create Domain in Silent Mode

1- D:\oracle\standalone-wl\wlserver_10.3\common\bin>config_builder.cmd
create domain
wls:/offline> createDomain ('D:/Middleware/wlserver_10.3/common/templates/domains/basic_Domain10.3.4.0.jar','D:/Middleware/user_project s/domains/hal','weblogic','PASSWORD')
wls:/offline>


wls:/offline> createDomain ('D:/Middleware/wlserver_10.3/common/templates/domains/basic_Domain10.3.4.0.jar','D:/Middleware/user_project
s/domains/hal','weblogic','PASSWORD')


wls:/offline> readTemplate ('D:/Middleware/wlserver_10.3/common/templates/domains/basic_Domain10.3.4.0.jar')
wls:/offline/base_domain>cd ('Server/AdminServer')
wls:/offline/base_domain/Server/AdminServer>set ('ListenAddress','HOST Name for AdminServer')
wls:/offline/base_domain/Server/AdminServer>set ('Listenport', 7003)
wls:/offline/base_domain/Server/AdminServer>cd ('/')
wls:/offline/base_domain>cd ('Security/base_domain/User/weblogic')

wls:/offline/base_domain/Security/base_domain/User/weblogic>cmo.setPassword ('PASSWORD')
wls:/offline/base_domain/Security/base_domain/User/weblogic>setOption ('OverwriteDomain', 'true')
wls:/offline/base_domain/Security/base_domain/User/weblogic>writeDomain ('D:\Middleware\user_projects\domains\hal')
wls:/offline/hal/Security/hal/User/weblogic>closeTemplate ()
wls:/offline>readDomain ('D:\Middleware\user_projects\domains\hal')

Configure NodeManager

===========================
Configure NodeManager
========================
1- D:\oracle\Middleware\wlserver_10.3\server\bin>setWLSEnv.cmd

2- D:\oracle\Middleware\wlserver_10.3\server\bin>uninstallNodeMgrSvc.cmd

Stopping Oracle WebLogic NodeManager (D_oracle_Middleware_wlserver_10.3).
Oracle WebLogic NodeManager (D_oracle_Middleware_wlserver_10.3) stopped.
Oracle WebLogic NodeManager (D_oracle_Middleware_wlserver_10.3) removed.

3- Edit installNodeMgrSVC.cmd with the following parameter

set NODEMGR_HOST=(your host name)
4- Run installNodeMgrSVC.cmd

5- Crash recovery, we want to enbale nodemanager to restore server to their last known state after reboot

open nodemanager.properties & change CrashRecoveryEnabled=true
also for Smartupdate that manages weblogic patches it is adviceable to put

StartScriptEnabled=true
Also because the domain's script bin\startWeblogic has classpath configured which use smartupdate that manage Weblogic Patches
U will need to change StartScriptEnabled=true in nodemanager.properties file

6- stop/start node manager after update nodemanager.properties

Enroll the domain with nodemanager
----------------------------------
USE WLST Commond line

D:\oracle\Middleware\wlserver_10.3\common\bin>wlst.cmd

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> connect ('weblogic','XXXXXX','t3://Host Name of AdminServer:7001')

or
wls:/offline> connect('weblogic','XXXXXXX')

wls:/base_domain/serverConfig>

wls:/base_domain/serverConfig> nmEnroll('D://oracle//Middleware//user_projects//domains//base_domain','D://oracle//Middleware//wlserver_10.3//common//nodemanager')

nmEnroll('D://oracle//Standalone//user_projects//domains//base_domain','D://oracle//Standalone//wlserver_10.3//common//nodemanager')

nmEnroll('D://oracle//standalone-wl//user_projects//domains//base_domain','D://oracle//standalone-wl//wlserver_10.3//common//nodemanager')
Enrolling this machine with the domain directory at D://oracle//Middleware//user
_projects//domains//base_domain ...
Successfully enrolled this machine with the domain directory at D:\oracle\Middle
ware\user_projects\domains\base_domain.
wls:/base_domain/serverConfig>