如何把weblogic加入到windows的系统服务项

1、编辑installSvc.cmd。

    wls9需要做如下修改:

    找到以下语句,

    set WL_HOME=D:/bea/weblogic92
    call "%WL_HOME%/common/bin/commEnv.cmd"

    在其后加上:

    @rem******************************************************************
    @rem******************************************************************
    set DOMAIN_NAME=base_domain
    set SERVER_NAME=AdminServer
    set USERDOMAIN_HOME=D:/bea/user_projects/domains/base_domain
    set WLS_USER=username

    set WLS_PW=password       

    @rem******************************************************************
    @rem******************************************************************

    wls10需要做如下修改:

    找到以下语句:

    set WL_HOME=D:/bea/wlserver_10.0
    call "%WL_HOME%/common/bin/commEnv.cmd"

    在其后加上:

    @rem *************************************************************************
    @rem *************************************************************************
    @rem *************************************************************************
    set DOMAIN_NAME=base_domain
    set SERVER_NAME=AdminServer
    set USERDOMAIN_HOME=d:/bea/user_projects/domains/base_domain
    set WLS_USER=username

    set WLS_PW=password
    @rem *************************************************************************
    @rem *************************************************************************

 

可以把用户名,密码自动加载进系统:

在如下位置/bea/user_projects/domains/base_domain/servers/AdminServer下面新建一个名为 security 的文件夹

在里面建一个名为 boot.properties 文件,加入以下2行:

username=username@登陆weblogic的用户名

password=password@登陆weblogic的密码

系统启动后会自动加载这个文件里面的内容。可以不需要输入用户名密码。

 

注意:/bea/user_projects/domains/base_domain/bin/setDomainEnv.cmd这个里面的配置对于系统启动项里面启动的无效,也就是说在setDomainEnv.cmd里面设置的参数,在把系统做成服务后,并不是按照setDomainEnv.cmd里面的参数进行配置的,需要把这些参数在commEnv.cmd里面重新设置一遍。

 

如果要去掉系统服务的话需要找到uninstallSvc.cmd(与installSvc.cmd在同一个目录中)

在 set WL_HOME=……  的下面添加以下两句:

set DOMAIN_NAME=base_domain
set SERVER_NAME=AdminServer

 

可以参考:http://download.oracle.com/docs/cd/E13222_01/wls/docs81/adminguide/winservice.html#1190977

Setting Up a WebLogic Server Instance as a Windows Service

If you want a WebLogic Server instance to start automatically when you boot a Windows host computer, you can set up the server as a Windows service.

For each server instance that you set up as a Windows service, WebLogic Server creates a key in the Windows Registry under HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services. The registry entry contains such information as the name of the server and other startup arguments.

When you start the Windows host, the Windows Service Control Manager (SCM), which is part of the Windows operating system, uses the information in the Windows Registry key to invoke the weblogic.Server main class. The Windows SCM cannot be configured to use a Node Manager to start Managed Servers, and therefore the Node Manager's monitoring and automatic restart features cannot be used for servers that run as a Windows service.

The following tasks set up and manage WebLogic Server instances that run as Windows services:

 


Setting Up a Windows Service: Main Steps

To set up a Windows service:

  1.  
    • If the Configuration Wizard prompts you to install a server as a Windows service, choose Yes.

      Some of the domain templates in the Configuration Wizard prompt you to set up a server as a Windows service. If you choose Yes, the wizard installs the server as a Windows service. If you are using the wizard to create an Administration Server and Managed Servers, the wizard creates a Windows service only for the Administration Server. The wizard also creates a server-specific script that you can modify and use to install other servers as Windows services. The script is named domain-name/installService.cmd, where domain-name is the name of the domain that you created.

    • Create a script that sets values for server-specific variables and then calls a WebLogic Server master script. For more information, refer to Creating a Server-Specific Script.
    • Do one of the following:
    • If you set up both an Administration Server and a Managed Server to run as Windows services on the same computer, modify the WebLogic Server master script so that the Managed Server starts only after the Administration Server finishes its startup cycle. For more information, refer to Requiring Managed Servers to Start After Administration Servers.
    • If you want a server instance to shut down gracefully when you use the Windows Control Panel to stop the Windows service, create a Java class and modify the master script so that the Windows SCM will invoke the class. For more information, refer to Enabling Graceful Shutdowns from the Windows Control Panel.
    • If you want to see the messages that a server instance prints to standard out and standard error (including stack traces and thread dumps), redirect standard out and standard error to a file. For more information, refer to Redirecting Standard Out and Standard Error to a File.
    • If you have created additional Java classes that you want the WebLogic Server instance to invoke, add them to the server's classpath. For more information, refer to Adding Classes to the Classpath.

Creating a Server-Specific Script

If the Configuration Wizard did not already create a server-specific script for your domain, you can create one. The script that you create must set values for variables that identify the name of the server instance and other server-specific information. Then it must call a master script, WL_HOME/server/bin/installSvc.cmd, where WL_HOME is the directory in which you installed WebLogic Server. The master scripts invokes the beasvc utility, which adds a key to the Windows Registry.

Note: For more information about beasvc, enter the following command at a command prompt: WL_HOME/server/bin/beasvc -help, where WL_HOME is the directory in which you installed WebLogic Server.

To see an example of a server-specific script, refer to Listing 6-1.

To create a server-specific script:

  1.  
    • SETLOCAL

      This is a batch command that begins the localization of environment variables in a batch file.

    • set DOMAIN_NAME=domain-name

      where domain-name is the name of your WebLogic Server domain.

    • set USERDOMAIN_HOME=absolute-pathname

      where absolute-pathname is the absolute pathname of the Administration Server's root directory (the directory that contains the domain's configuration file). For more information about the root directories for servers, refer to A Server's Root Directory.

    • set SERVER_NAME=server-name

      where server-name is the name of an existing server instance that you want set up as a Windows service.

    • set WLS_USER=username
      set WLS_PW=password

      where username is the name of an existing user with privileges to start a server instance and password is the user's password. The beasvc utility encrypts the login credentials and stores them in the Windows registry.

      This is one of two possible methods for avoiding the username/password prompt when a server instance starts. The disadvantage to this method is that changing the username or password for the server instance requires you to delete the Windows service and set up a new one with the new username and password. Instead of this method, you can use a boot identity file. With a boot identity file, you can change the login credentials without needing to modify the Windows service. For more information, refer to "Boot Identity Files" in the Administration Console Online Help.

    • set PRODUCTION_MODE=[true]

      When the PRODUCTION_MODE variable is set to true, the server instance starts in production mode. When not specified, or when set to false, the server starts in development mode. For more information about development mode and production mode, refer to Creating and Configuring Domains Using the Configuration Wizard.

    • set JAVA_OPTIONS=java-options

      where java-options is one or more Java arguments that you want to pass to the Java Virtual Machine (JVM). Separate multiple arguments with

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值