启动weblogic域不需要输入密码设置方法
今天安装了weblogic服务器,在启动服务是一直要输入用户名和密码,很是不方便。
要做启动过程不输入密码有两种做法,见下面实例。
方法一:
A. 修改WebLogic的启动脚本,即修改startWebLogic.sh,增加用户名(weblogic)与密码(password),步骤如下:
1. 进入WLS_HOME/bin目录
[[email protected] bin]$ pwd
/home/wls06/base_domain/bin
2. 在startWebLogic.sh执行脚本中加入用户名与密码,并保存退出
[[email protected] bin]$ vi startWebLogic.sh
WLS_USER="weblogic"
export WLS_USER
WLS_PW="password"
export WLS_PW
3. 重新启动WebLogic服务
[[email protected] bin]$ ./startWebLogic.sh &
方法二
B. 将用户名和密码保存到/home/wls06/base_domain/servers/AdminServer/security/boot.properties文件中,security文件夹需要新建,步骤如下:
1. 进入WLS_HOME/base_domain/servers/AdminServer目录
[[email protected] security]$ cd /home/wls06/base_domain/servers/AdminServer
[[email protected] security]$ pwd
/home/wls06/base_domain/servers/AdminServer
2. 创建security目录,并进入
[[email protected] security]$ mkdir security
[[email protected] security]$ cd security
3. 创建boot.properties文件编辑后保存退出
[[email protected] security]$ vi boot.properties
username=weblogic
password=password
4. 重新启动WebLogic服务(此处忽略停WebLogic服务)
[[email protected] bin]$ ./startWebLogic.sh &
启动过程中日志:
<Sep 23, 2015 4:10:58 PM CST> <Notice> <Security> <BEA-090083> <Storing boot identity in the file: /home/wls02/base_domain/base_domain/servers/AdminServer/security/boot.properties>
<Sep 23, 2015 4:11:43 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STANDBY>
<Sep 23, 2015 4:11:43 PM CST> <Notice> <WebLogicServer> <BEA-000365> <Server state changed to STARTING>
5. 再次检查boot.properties文件,发现用户名与密码已经做过加密处理
[[email protected] security]$ cat boot.properties
#Wed Sep 23 16:10:59 CST 2015
password={AES}Fl/BKG+a166kZkR/m7gOL+hMhPF9JACWZLvxo5fFC4c\=
username={AES}e/zSyaDEsl6eBx0tVIBj7ISnhcN1wu3nw1dLPLBC2qA\=
三、总结
Weblogic在安装部署后,每次启动输入密码的做法很少见,使用上述两种方法可以解决,通常会选用第二种做法boot.properties文件 ,并且重启动一次后,密码变为密文,这样更加安全可靠。
文章转载:https://www.cnblogs.com/lcword/p/7833139.html