在网上找了一些,都不完善,搞了几个小时才搞完,我写一个比较完完善的,方便大家。
第一步:添加boot.properties文件,实现启动时不用输入用户名密码
此文件放在domain/security和domain/servers/AdminServer/security里面,各放一份,以实现启动admin时也有效
内容为:
username=xxx
password=xxx
第二步:写shell启动脚本,放到/etc/init.d/里面,注意修改里面weblogic地址路径,取名为:weblogic
#!/bin/sh . /etc/init.d/functions case "$1" in start) cd /web/lydomain ./startWebLogic.sh >weblogic.log 2>&1 & echo $"usage: $0 start success" ;; stop) cd /web/lydomain/bin ./stopWebLogic.sh >weblogic.log 2>&1 & echo $"usage: $0 stop success" ;; restart) cd /web/lydomain ./startWebLogic.sh >weblogic.log 2>&1 & echo $"usage: $0 start success" cd /web/lydomain/bin ./stopWebLogic.sh >weblogic.log 2>&1 & echo $"usage: $0 stop success" ;; *) echo $"usage: $0 {start|stop|restart}" exit 0 esac exit 1
好了,现在可以输入命令启动weblogic了
启动命令:/etc/init.d/weblogic start