How do you pass username/password to start Oracle WebLogic server in Unix

To start WebLogic just run start script as follows:

$ DOMAIN_HOME/startWebLogic.sh

But you need to enter username and password and if you close this terminal the service stops. Here I have discussed how to pass username and password to  startWebLogic.sh and how to run it at background process.

At first go to the directory “security” inside your <DOMAIN_ROOT>\servers\<SERVER_NAME>. If the directory security does not appear the create a directory named security under  <DOMAIN_ROOT>\servers\<SERVER_NAME>. For example

/u02/bip/user_projects/domains/bifoundation_domain/servers/AdminServer/security

then enter the directory

$ cd /u02/bip/user_projects/domains/bifoundation_domain/servers/AdminServer/security

create a file with exactly same name as “boot.properties”

$ vi  boot.properties

enter the following two lines inside the file

username=Administrator_username
password=Administrator_password

Assign this file executable permission

$ chmod 640 boot.properties

Now if you run startWebLogic.sh, you need not enter username and password.

Most of the time you login into remote server via ssh. If you start a shell script  and you exit (abort remote connection), the process  will get killed. It is better to leave job running in background. But, if you log out of the system, the job will be stopped and terminated by your shell. To solve this issue, use nohup command line-utility which allows to run  shell script that can continue running in the background after you log out from a shell as follows:

$ cd /u02/bip/user_projects/domains/bifoundation_domain

$ nohup ./startWebLogic.sh 1>logs/nohup.out 2>logs/error &

There is another way that you may add this script at crontab and it will start automatically at the server end as follows:

$ crontab -e

@reboot /bin/sleep 300 ; /u02/bip/user_projects/domains/bifoundation_domain/startWebLogic.sh

In this example web logic service starts just 5 minutes after reboot.

 

 

 

 

Posted in WebLogic Server

Leave a comment