Showing posts with label Middleware. Show all posts
Showing posts with label Middleware. Show all posts

Sunday, April 1, 2012

reset weblogic password

Steps to create another superuser in weblogic (when password of existing user is lost)

1. Shutdown WebLogic Server (If Running) – Optional Step

2. Login to WebLogic Server and set environment variable

cd $DOMAIN_HOME/bin   (where DOMAIN_HOME is directory in which your domain exists, default value is $MW_HOME/user_projects/domain/base_domain)

. ./setDomainEnv.sh

3. Create a initialization file using command

java weblogic.security.utils.AdminAccount   .  (Note the DOT at end of this command)

For Example

java weblogic.security.utils.AdminAccount weblogic welcome1 . (Note the DOT at end of this command)

This will create file  DefaultAuthenticatorInit.ldift in directory from which you executed this command .

4. Move file DefaultAuthenticatormyrealmInit.ldift  from $DOMAIN_HOME/security/ and replace it by  DefaultAuthenticatorInit.ldift generated in step 3

5. Move data directory under $DOMAIN_HOME/servers//datato another directory like data.bak (data directory contains files related to embedded LDAP and role mapping file). Replace with WebLogic Server like AdminServer and managed server. Repeat this step for all managed servers which are part of this domain.

This step will remove all existing users/groups from WebLogic’s embedded LDAP server (recreate these users/groups in setp8)

6.Recreate boot.properites (if any) under $DOMAIN_HOME/servers//security with username and password created in step 3 above like
USERNAME=weblogic
PASSWORD=welcome1

7.Start (or restart) Admin Server and test if you can login to weblogic console using new username and password. 

8. Recreate any users/groups(which were part of default authenticator prior to new super user creation) or import existing users (from weblogic’s servers embedded LDAP server backup)

Tuesday, December 27, 2011

Install Apache mod_proxy_balancer

Install Apache mod_proxy_balancer

#cd /u01/source
#tar xvzf httpd-2.2.21.tar.gz
#cd httpd-2.2.21
#./configure --prefix=/u01/apache --enable-so

#make
#make install

cd httpd-2.2.21/modules/metadata
#/u01/apache/bin/apxs -a -i -c mod_headers.c

cd httpd-2.2.21/modules/proxy
#/u01/apache/bin/apxs -a -i -c mod_proxy.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_ajp.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_balancer.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_connect.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_http.c

if error when start apache, solve with running below
#/u01/apache/bin/apxs -a -i -c mod_proxy.c proxy_util.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_ajp.c proxy_util.c ajp_utils.c ajp_header.c ajp_msg.c ajp_link.c
#/u01/apache/bin/apxs -a -i -c mod_proxy_balancer.c proxy_util.c


#cd /u01/apache/conf
#echo "Include conf/proxy-pass.conf" >> httpd.conf

#vi proxy-pass.conf

Header add Set-Cookie "ROUTEID=%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED

BalancerMember http://localhost:6001 route=node1
BalancerMember http://localhost:6002 route=node2
ProxySet stickysession=ROUTEID


ProxyPass /context balancer://cluster/context
ProxyPassReverse /context balancer://cluster2/context

--start apache
#/u01/apache/bin/apachectl start

--stop apache
#/u01/apache/bin/apachectl stop

Wednesday, October 19, 2011

Apache as Load Balancer for Weblogic Server

1. gzip -d httpd*.tar.gz
2. tar -xvf httpd*.tar
3. ./configure --prefix=/u01/apache --enable-module=so --enable-rule=SHARED_CORE
4. make
5. make install
6. copy mod_wl.so to $apache_home/modules
7. vi $apache_home/conf/httpd.conf

8. add line to httpd.conf
-------
LoadModule weblogic_module modules/mod_wl.so
-------
Include conf/weblogic.conf
9. create file weblogic.conf


SetHandler weblogic-handler
weblogicCluster 192.168.10.1:7002,192.168.10.2:7002


10. start httpd
$apache_home/bin/apachectl start
11. check apache running
ps -ef | grep httpd