Resetting lost password of Admin server in Weblogic

Recently one of our client forgot weblogic username and password, and the weblogic is in production mode. He was not having boot.properties set to start weblogic automatically, so my task is
1. Reset the admin server password
2. Create boot.properties, so client not need to enter passoword every time they start weblogic.

About Setup
Client was having single domain, for our refrence purpose we will call it techienote.
Our ORACLE or MIDDLEWARE HOME is at /app/Oracle/Middleware
Weblogic version 10.3.5.0

PROCESS
NOTE : All the weblogic releated services should be shut.

1.Setting Enviournment

cd $ORACLE_HOME/user_projects/domains/techienote/bin
source setDomainEnv.sh

2.Change to security directory and rename DefaultAuthenticatorInit.ldift file.

cd $ORACLE_HOME/user_projects/domains/techienote/security
mv DefaultAuthenticatorInit.ldift DefaultAuthenticatorInit.ldift.bak

3.Create DefaultAuthenticatorInit.ldift file in security folder

cd $ORACLE_HOME/user_projects/domains/techienote/security
java weblogic.security.utils.AdminAccount weblogic admin .

Remember there is DOT at the end of command it indicated generate DefaultAuthenticatorInit.ldift in current directory,
syntax of the command is
java weblogic.security.utils.AdminAccount .
So our username is weblogic and password is admin

4.Rename ldap directory

cd $ORACLE_HOME/user_projects/domains/YourDomainName/servers/AdminServer/data/
mv ldap ldap.bak
mkdir ldap

5.If your are having boot.properties rename it first

cd $ORACLE_HOME/user_projects/domains/techienote/servers/AdminServer/security
mv boot.properties boot.properties.bak

6.Start the weblogic server

cd $ORACLE_HOME/user_projects/domains/techienote/bin
./startWebLogic.sh

7.Now our weblogic server should start, so now we need to create boot.properties to start Weblogic without entering user name and password.

cd $ORACLE_HOME/user_projects/domains/techienote/servers/AdminServer/
mkdir security
cd $ORACLE_HOME/user_projects/domains/techienote/servers/AdminServer/security/
echo "username=weblogic" >> boot.properties
echo "password=admin" >> boot.properties

Self Signed Certificate Weblogic

Recently I need to test SSL in weblogic. For the same I have to generate a self signed certificate for Weblogic. We can use keytool command to generate self signed certificate.

Generating Certificate
1. Create a directory to store certificate. Remember do not delete this directory, you may need to use generated files for future use also.

mkdir ~/csr
cd ~/csr

2. Create a key pair

keytool -genkey -alias techienote -keyalg RSA -keypass privatepassword -keystore identity.jks -storepass password -validity 365

The above command will ask following information. Feel it carefully.

What is your first and last name?
  [Unknown]:  ubuntu.home.network                                                                                              
What is the name of your organizational unit?
  [Unknown]:  IT
What is the name of your organization?
  [Unknown]:  TECHIENOTE
What is the name of your City or Locality?
  [Unknown]:  MUMBAI
What is the name of your State or Province?
  [Unknown]:  MAHARASHTRA
What is the two-letter country code for this unit?
  [Unknown]:  in
Is CN=ubuntu.home.network, OU=IT, O=TECHIENOTE, L=MUMBAI, ST=MAHARASHTRA, C=IN correct?
  [no]:  yes

3. Export the certificate from identity keystore into a file, say root.cer

keytool -export -alias techienote -file root.cer -keystore identity.jks

OUTPUT

Enter keystore password:  
Certificate stored in file <root.cer>

Enter keystore password specified in step 2

4. Import the certificate you exported into trust.jks

keytool -import -alias techienote -trustcacerts -file root.cer -keystore trust.jks

OUTPUT

Enter keystore password:  
Re-enter new password: 
Owner: CN=ubuntu.home.network, OU=IT, O=TECHIENOTE, L=MUMBAI, ST=MAHARASHTRA, C=IN
Issuer: CN=ubuntu.home.network, OU=IT, O=TECHIENOTE, L=MUMBAI, ST=MAHARASHTRA, C=IN
Serial number: 4e05c41e
Valid from: Sat Jun 25 16:48:54 IST 2011 until: Fri Jun 24 16:48:54 IST 2011
Certificate fingerprints:
	 MD5:  1D:BF:62:CA:A1:72:88:83:BE:CA:CB:D5:E2:60:22:43
	 SHA1: E7:7C:6B:01:63:33:CD:37:1E:2F:D8:3A:01:E2:15:C3:97:2A:4E:52
	 Signature algorithm name: SHA1withRSA
	 Version: 3
Trust this certificate? [no]:  yes
Certificate was added to keystore

Enter keystore password specified in step 2

Installing Certificate in Weblogic
Now we need to specify certificare in Weblogic server. We are going to set SSL for AdminServer as well as for Node Manager

5. Login to weblogic administration Console

http://admin_server_ip:admin_server_port/console

6. Go to Domain Structure > techienote > Environment > Servers And click on AdminServer

7. In AdminServer click on keystores > Change

8. Choose Custom Identity and Custom Trust in Keystores and click on save.

9. Now we need to specify certificate details.
We copy our generated certificate to weblogic directory

mkdir /MIDDILEWARE_HOME/user_projects/domains/techinote/csr
cp ~/csr/* /MIDDILEWARE_HOME/user_projects/domains/techinote/csr

In weblogic, enter following details

Custom Identity Keystore: /app/Oracle/Middleware/user_projects/domains/techienote/csr/identity.jks
Custom Identity keystore Type: jks
Custom Identity keystore Passphrase: password
Confirm Custom Identity Keystore Passphrase: password
Custom Trust Keystore: /app/Oracle/Middleware/user_projects/domains/techienote/csr/trust.jks
Custom Trust Keystore Type: jks
Custom Trust Keystore Passphrase: password
Confirm Custom Trust Keystore Passphrase: password

PN Enter keystore password specified in step 2

Save the configuration and click on Activate Changes

10. We also need to specify ssl details in SSL tab, so click on SSL tab

Private Key Alias: techienote
Private Key Passphrase: privatepassword
Confirm Private Key Passphrase: privatepassword

PN Enter Private keystore password specified in step 2

Save the configuration and click on Activate Changes

11. Now here is one tip I don’t want ssl hostname verification. For that I need to edit weblogic startup script and nodemanager startup script
Weblogic startup script

cd /MIDDILEWARE_HOME/user_projects/domains/techinote/bin
vi startWebLogic.sh

In JAVA_OPTIONS insert -Dweblogic.security.SSL.ignoreHostnameVerification=true
Here is the sample file

JAVA_OPTIONS="${SAVE_JAVA_OPTIONS} -Dweblogic.security.SSL.ignoreHostnameVerification=true"

nodemanager startup script

cd /MIDDILEWARE_HOME/wlserver_10.3/server/bin
vi startNodeManager.sh

In JAVA_OPTIONS insert -Dweblogic.nodemanager.sslHostNameVerificationEnabled=false
Here is the sample file

cd "${NODEMGR_HOME}"
set -x
if [ "$LISTEN_PORT" != "" ]
 then
   if [ "$LISTEN_ADDRESS" != "" ]
    then
     "${JAVA_HOME}/bin/java" ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.nodemanager.sslHostNameVerificationEnabled=false -Djava.security.policy="${WL_HOME}/server/lib/weblogic.policy" -Dweblogic.nodemanager.javaHome="${JAVA_HOME}" -DListenAddress="${LISTEN_ADDRESS}" -DListenPort="${LISTEN_PORT}" weblogic.NodeManager -v
    else
     "${JAVA_HOME}/bin/java" ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.nodemanager.sslHostNameVerificationEnabled=false -Djava.security.policy="${WL_HOME}/server/lib/weblogic.policy" -Dweblogic.nodemanager.javaHome="${JAVA_HOME}" -DListenPort="${LISTEN_PORT}" weblogic.NodeManager -v
   fi
 else
   if [ "$LISTEN_ADDRESS" != "" ]
    then
     "${JAVA_HOME}/bin/java" ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.nodemanager.sslHostNameVerificationEnabled=false -Djava.security.policy="${WL_HOME}/server/lib/weblogic.policy" -Dweblogic.nodemanager.javaHome="${JAVA_HOME}" -DListenAddress="${LISTEN_ADDRESS}" weblogic.NodeManager -v
    else
     "${JAVA_HOME}/bin/java" ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.nodemanager.sslHostNameVerificationEnabled=false -Djava.security.policy="${WL_HOME}/server/lib/weblogic.policy" -Dweblogic.nodemanager.javaHome="${JAVA_HOME}" weblogic.NodeManager -v

12. Now we need to modify nodemanager.properties

vi /MIDDILEWARE_HOME/wlserver_10.3/common/nodemanager/nodemanager.properties

Insert following line at end

KeyStores=CustomIdentityAndCustomTrust
CustomIdentityKeyStoreFileName=/app/Oracle/Middleware/user_projects/domains/techienote/csr/identity.jks
CustomIdentityAlias=techienote
CustomTrustKeyStoreFileName=/app/Oracle/Middleware/user_projects/domains/techienote/csr/trust.jks
CustomIdentityPrivateKeyPassPhrase=privatepassword

13. Now you need to refresh Admin server and Node Manager by taking restart of NodeManager and AdminServer

Start Weblogic in Production mode without user name & password

Earlier we have seen how to install weblogic on Ubuntu. After installation is done you need to start weblogic AdminServer.
To start AdminServer, i run

MIDDLEWARE_DIR/user_projects/domains/techienote/bin/startWebLogic.sh

Above command will ask weblogic username and password. To avoid this we can create boot.properties.
1. Go to AdminServer directory

cd /MIDDLEWARE_DIR/user_projects/domains/techienote/servers/AdminServer

2. Create security folder

mkdir security

3. In that folder you need to create boot.properties.

cd /MIDDLEWARE_DIR/user_projects/domains/techienote/servers/AdminServer/security
vi boot.properties

Content of boot.properties will be username & password to start weblogic

cat /MIDDLEWARE_DIR/user_projects/domains/techienote/servers/AdminServer/security/boot.properties
username=weblogic
password=weblogic

That’s it. Next time while starting weblogic it will not ask you username and password. You can also start weblogic vi nohup command.

nohup /MIDDLEWARE_DIR/user_projects/domains/techienote/bin/startWebLogic.sh &

Don’t worry about the clear text password it will get encrypted as soon as you start weblogic server.

How to Install Weblogic on Ubuntu

Weblogic is an application server from Oracle which resides in Oracle Fussion Middlware. This howto will simply show how to install Weblogic on Ubuntu.

Note : Screen shot are in small resolution. Please click on the individual screens for better visibility.

Pre-Requirement
1. You must installed JAVA on Ubuntu before starting Weblogic installation
To install JAVA on Ubuntu click here
2. Download installer from here

In this how-to we are installing Weblogic in GUI(Graphical) mode.

Run java -version to check JAVA installation. In case java command not found you need to install JAVA. Please click here to install JAVA on Ubuntu.

Now install weblogic using java command. I have downloaded platform independent file of weblogic installer. So to execute the same run,

cd ~/Download
java -jar wls1035_generic.jar

Installer will get extracted in /tmp location, so ensure that you have more than 2GB space in /tmp location.

On the welcome screen, click NEXT

On Choose Middleware Directory, choose Create a new Middleware directory.
We have choose /app/Oracle/Middleware. From here onwards I will use MIDDLEWARE_DIR instead of full path i.e /app/Oracle/Middleware

On Register for security Updates, we disable the same as it is not needed in this setup.


On Choose Install Type, we are going to choose Typical

On JDK Selection, installer will detect java version automatically. If you want to select different java then click on Browse

On Choose Product Installation Directories, It should be like this
Product Installation Directories
Weblogic Server
MIDDLEWARE_DIR/wlserver_10.3
Oracle Coherence
MIDDLEWARE_DIR/coherence_3.6

On Installation Summary, verify everything and click NEXT.

Progress screen

That’s it Basic Weblogic has been completed.

Now we need to create a domain and Administrator server for the domain

To do so, run,

MIDDLEWARE_DIR/wlserver_10.3/common/quickstart/quickstart.sh

You will get Quick Start welcome screen. To create domain click on Getting Started with Weblogic Server.

Now select Create a New weblogic domain to create new domain

On Select Domain Source, by default Basic weblogic server domain get selected. Click NEXT to go ahead

On Specify Domain Name and Location, specify domain name. We are creating techienote as our domain. Click NEXT

On Configure Administrator User Name and Password, specify username and password for Administrator server and click NEXT. You are going to need this username and password while starting Weblogic and accessing admin console.

Our environment is Production, so in Configure Server Start Mode and JDK, choose Production Mode and click NEXT

On Select Optional Configuration Choose Administrator Server.

On Configure Choose Administrator Server, enter Server Name, Listen Address, Listen Port. By default weblogic will listen on 7001 TCP port.

On Configuration Summary verify details and click on NEXT


At the end setup will show you admin server URL. In my case it is http://ubuntu.home.network:7001

No we need to start Weblogic server to access Admin console.
To start admin console, run
MIDDLEWARE_DIR/user_projects/domains/techienote/bin/startWebLogic.sh

Now it will ask you username and password. Enter username and password which you have selected earlier.

At the successful startup, you will get server started in running mode text in command prompt.

Now to access Admin Console, open Browser and enter admin server url i.e. http://hostname:port/console
Enter username and password to access admin console.

Voila this is it. We have successfully installed Weblogic server on Ubuntu.

How to install Sun Java in Ubuntu

Today I need to install Sun Java for application testing. I tried the multiverse repo but it did not work. So here is the simple howto for those who want to install Sun Java (JDK) on Ubuntu.

Adding repository

sudo add-apt-repository ppa:ferramroberto/java

Installing JDK

sudo apt-get update
sudo apt-get install sun-java6-jdk sun-java6-plugin

Thats it.
You need to accept Agreement while installing JDK

Updating PATH

update-java-alternatives -s java-6-sun

Checking JAVA version

java -version
java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Client VM (build 20.0-b11, mixed mode, sharing)
Page 10 of 27« First...«8910111213»20...Last »
rss twitter facbook

Categories

Archives