Introduction
Hi there ! In today’s write up, we will get to know, how to reset the weblogic console/admin password in case you forgot that. This might be a shot article. If you want to learn more about weblogic, please refer to my previous tutorial about instllation & configuration weblogic 14c server on centos 8 from here https://unixcop.com/oracle-weblogic-14c-on-centos-8/
To reset the password, we first need to go the weblogic domain home.
In my case, the location is here /u01/app/oracle/product/14.1.1.0/user_projects/domains/base_domain
Go to that directory
cd /u01/app/oracle/product/14.1.1.0/user_projects/domains/base_domain
In the domain home, we will find a directory named “bin”, which stands for binary. We will find all the necessary scripts there to administrate the weblogic server, like start, stop restart & so on.
To reset the password, we first need to shutdown the weblogic server. Run the following script
stopWeblogic.sh
This will take a while to stop.
Finally, when you see like this “Derby server stopped”, Your weblogic server has stopped successfully.
Backup the directory
go to the servers under base domain of the weblogic server, you will find a data directory named data
We need to backup this directory as this directory contains all the necessary files & settings for our current server. If something goes wrong, we can revert our changes. It’s always a good idea to take backup.
Run the mv command to rename the directory as data-old
mv data/ data-old/
Then, we will go to the bin directory again of the weblogic domain or just hit the following command to go there
cd /u01/app/oracle/product/14.1.1.0/user_projects/domains/base_domain/bin
You will find a script named setDomainEnv.sh
This script will set the environment variables & will override if anythings changes.
Run ./setDomainEnv.sh
This will execute immediately.
Now we will go to the domain’s security directory. This is under the base domain directory.
Or, just head over to this directory
cd /u01/app/oracle/product/14.1.1.0/user_projects/domains/base_domain/security
Run the following command
java weblogic.security.utils.AdminAccount <username> <password>
Fill up the username & password section with your own one. Please note that the password here would be the new password of your choice. Hit enter.
We also need to update the domain’s boot.properties file with the new username and password. This file should be under the same security directory under the domain home of our configured weblogic server.
The file format is shown below.
username=<username>
password=<password>
Save & quit the file and again go to the binary directory of the weblogic server.
Go to the intermediate directory or just hit the following command
cd /u01/app/oracle/product/14.1.1.0/user_projects/domains/base_domain/bin
Now it’s time to turn on the weblogic server to test & verify. We have to run the start script which is situated the the binary directory.
Run the following
./startWeblogic.sh
This will take some times to start on. Have some patience please !
After a while seeing some output on the terminal, you will find something like this
<Server state changed to RUNNING>
Bingo ! You are done.
Now try to login to the weblogic server with your new password. If you are not sure how to, please go to this following tutorial https://unixcop.com/oracle-weblogic-14c-on-centos-8/
Hope you will find this write up helpful, if not so, state your problems in the comment section. If yes ! share with your friends
Done for today, will see you next tutorial.