WebLogic 把應用域加到Windows service中

來源:互聯網
上載者:User

標籤:weblogic   windows service   

在Windows作業系統中,WebLogic即可以通過命令列啟動,也可以通過Windows服務(Service)來啟動和停止。在某些情況下,如需要開機自啟動,或者在啟動後,命令列視窗可以關閉,這時使用Window service便有優勢。

一、如何將WebLogic Web應用部署成Windows服務呢?

1、在WebLogic安裝目錄下找到installSvc.cmd檔案

一般在位置:【WebLogic安裝目錄】/Oracle/Middleware//server 下


2、修改installSvc.com檔案

增加虛線間的配置,包含以下參數:

DOMAIN_NAME:網域名稱,WEB應用域的目錄名,即一般在user_projects/domains/下的目錄

SERVER_NAME:服務名,配置WEB應用的服務名字,一般預設為AdminServer

WLS_USER: 該應用域系統管理使用者名

WLS_PW:該應用域管理密碼

set WL_HOME=D:\oracle\Middleware\wlserver_10.3call "%WL_HOME%\common\bin\commEnv.cmd"REM ------------------------------------------------------------------------------<strong>REM domain的名稱set DOMAIN_NAME=app1_domainREM 一般為預設set SERVER_NAME=AdminServerREM domain的路徑set USERDOMAIN_HOME=D:\oracle\Middleware\user_projects\domains\app1_domaincall "%USERDOMAIN_HOME%\bin\setDomainEnv.cmd"set WLS_USER=weblogicset WLS_PW=weblogic1</strong>REM ------------------------------------------------------------------------------@rem Check that the WebLogic classes are where we expect them to be:checkWLSif exist "%WL_HOME%\server\lib\weblogic.jar" goto checkJavaecho The WebLogic Server wasn't found in directory %WL_HOME%\server.echo Please edit your script so that the WL_HOME variable points echo to the WebLogic installation directory.goto finish

除了上述環境變數參數配置要正確,這裡最關鍵的有兩點:

1、增加參數配置部分要放在commEnv.cmd之後,使該檔案中的參數配置得以執行;

2、調用WEB應用域下面的setDomainEnv.cmd,應用域的很多參數都在其中設定。

<span style="font-size:12px;">rem *** Install the service"%WL_HOME%\server\bin\beasvc" -install -svcname:"beasvc_%DOMAIN_NAME%_%SERVER_NAME%" -javahome:"%JAVA_HOME%" -execdir:"%USERDOMAIN_HOME%" -maxconnectretries:"%MAX_CONNECT_RETRIES%" -host:"%HOST%" -port:"%PORT%" -extrapath:"%EXTRAPATH%" -password:"%WLS_PW%" -cmdline:%CMDLINE%</span>

還有一個地方要修改的就是
-svcname
後,在beasvc後去掉空格,添加_,避免出現空格,在進行命令操作時有問題。


二、刪除Windows service

當服務不再需要想刪掉,這時,你就會用到它了。

1、首先在控制台或工作管理員中(WIN7)開啟Windows Service管理視窗,找到發布的Service,一般以beasvc開頭,雙擊該服務,在開啟視窗的上部分找到服務名。

2、在Windows命令列視窗中執行命令:

sc delete [Windows服務名]

如:sc delete beasvc_app1_domain_AdminServer

如果配置不成功,就只好刪除重來。

WebLogic 把應用域加到Windows service中

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.