Linux端將weblogic做成服務

2021-09-20 04:50:05 字數 1766 閱讀 8375

weblogic在linux端安裝完畢後,啟動,關閉weblogic比較麻煩,可以通過配置,將weblogic註冊成服務,只要簡單的服務start,stop即可開關服務,十分方便。

# cd /opt

# vim weblogic #將下列內容拷貝到檔案中

#!/bin/bash

## chkconfig: 345 81 05

# description: weblogic server

# /etc/init.d/weblogic

## run-level startup script for the weblogic server

# please edit the variable

export bea_base= /bea

export bea_home=$bea_base/user_projects/domains/aaaaa

export bea_log=$bea_base/weblogic.log

export path=$path:$bea_home/bin

bea_ownr="root"

# if the executables do not exist -- display error

if [ ! -f

$bea_home/bin/startweblogic.sh -o ! -d

$bea_home ]

then

echo

"weblogic startup: cannot start"

exit

fi# depending on parameter -- startup, shutdown, restart

case

"$1"

in start)

echo -n "starting weblogic: log file $bea_log"

touch /var/lock/weblogic

su $bea_ownr -c "nohup $bea_home/bin/startweblogic.sh > $bea_log 2>&1 &"

echo

" ok"

;;stop)

echo -n "shutdown weblogic: "

rm -f /var/lock/weblogic

su $bea_ownr -c "$bea_home/bin/stopweblogic.sh >> $bea_log"

echo

"ok"

;;reload|restart)

$0 stop

$0 start

;;*) echo

"usage: `basename $0` start|stop|restart|reload"

exit

1esac

exit

0

# chmod 700  weblogic

# cp weblogic /etc/rc.d/init.d

# chkconfig --add weblogic

# chkconfig --list | grep weblogic

1

:service weblogic start|stop|restart|reload

2:/etc/init.d/weblogic start|stop|restart|reload

Linux下將Weblogic設定為開機啟動

cd etc rc.d init.d vi weblogic bin bash chkconfig 34520 80 description weblogic server auto start stop script etc rc.d init.d weblogic please edit the...

weblogic建立域(Linux系統)

weblogic建立新域 1 進入wlserver 10.3 common bin路徑下 例 cd oracle middleware wlserver 10.3 common bin 2 執行.config.sh mode console命令建立新域 config.sh mode console ...

Linux下檢視weblogic日誌

使用tail f catalina.out命令檢視後台日誌 tail f nohup.out 想看歷史的n行log資訊 1000行 tail 1000 nohup.out server.log server.log 日誌的路徑一般在 domainname servers servername log...