Server configuration scripts


The scripting library provides multiple script procedures to automate the appserver configurations. Use the appserver scripts to create appservers, Web servers, and generic servers. We can run each script individually, or combine procedures to create custom automation scripts for the environment.

All server management script procedures are located in...

WAS_HOME/scriptLibraries/servers/V70

If we do not want to set an argument, specify an empty string as the value for the argument, as the following syntax demonstrates: "". Use the following script procedures to administer the appserver:

 

createApplicationServer

This script creates a new appserver in the environment. During the installation process, WAS creates a default appserver, named server1. Most installations require several appservers to handle the application serving needs of their production environment.

To run the script, specify the node, server, and template names, as defined in the following table:
Argument Description
nodeName Name of the node on which to create the appserver.
serverName Name of the server to create.
templateName Optionally specifies the template to use to create the appserver.

Syntax

AdminServerManagement.createApplicationServer(nodeName, serverName, templateName)

Example usage

AdminServerManagement.createApplicationServer("myNode", "myServer", "default")

 

createAppServerTemplate

This script creates a new appserver template in the configuration. A server template is used to define the settings for a new application server. By creating a new appserver, you either select the default server template or a template you previously created, that is based on another, already existing appserver. The default template is used if we do not specify a different template when creating the server.

To run the script, specify the node name, server name, and new template name arguments, as defined in the following table:
Argument Description
nodeName Node that corresponds to the server from which to base the template.
serverName Name of the server from which to base the template.
newTemplateName Name of the new template to create.

Syntax

AdminServerManagement.createAppServerTemplate(nodeName, serverName, newTemplateName)

Example usage

AdminServerManagement.createAppServerTemplate("myNode", "myServer", "myNewTemplate")

 

createGenericServer

This script configures a new generic server in the configuration. A generic server is a server that the appserver manages, but does not supply. If we do not want to set an argument, specify an empty string as the value for the argument, as the following syntax demonstrates: "".

To run the script, specify the node name, new server name, template name, start command path and arguments, working directory, and stop command path and arguments, as defined in the following table:
Argument Description
nodeName Name of the node on which to create the server.
newServerName Name of the server to create.
templateName Optionally specifies the template to use to create the server.
startCmdPath Optionally specifies the path to the command that will run when this generic server is started.
startCmdArguments Optionally specifies the arguments to pass to the startCommand when the generic server is started.
workingDirectory Optionally specifies the working directory for the generic server.
stopCmdPath Optionally specifies the path to the command that will run when this generic server is stopped.
stopCmdArguments Optionally specifies the arguments to pass to the stopCommand parameter when the generic server is stopped.

Syntax

AdminServerManagement.createGenericServer(nodeName, newServerName, templateName,  startCmdPath, startCmdArguments, workingDirectory, stopCmdPath,  stopCmdArguments)

Example usage

(Windows)

AdminServerManagement.createGenericServer("myNode", "myServer", 
 "default", "", "", "c:\temp", "", "")

[AIX] [Linux] [HP-UX] [Solaris]

AdminServerManagement.createGenericServer("myNode", "myServer", 
 "default", "", "", "/temp", "", "")

 

createWebServer

This script configures a Web server in the configuration. An appserver works with a Web server to handle requests for dynamic content, such as servlets, from Web apps. A Web server uses Web server plug-ins to establish and maintain persistent HTTP and HTTPS connections with an appserver. If we do not want to set an argument, specify an empty string as the value for the argument, as the following syntax demonstrates: "".

To run the script, specify the node name, new server name, port number, server install root, plug-in installation root, configuration file path, Windows Operating System service name, error log path, access log path, and web protocol type, as defined in the following table:
Argument Description
nodeName Name of the node on which the Web server is defined.
newServerName Name of the Web server to create.
port Optionally specifies the port from which to ping the status of the Web server.
serverInstallRoot Optionally specifies the fully qualified path where the Web server is installed. This field is required if we are using IBM HTTP Server. For all other Web servers, this field is not required. If we enable any administrative function for non-IBM HTTP Server Web servers, the installation path is necessary.
pluginInstallPath Installation path for the Web server plug-in.
configFilePath Configuration file for the Web server.

Specify the file and not just the directory of the file. The appserver generates plugin-cfg.xml by default. The configuration file identifies applications, appservers, clusters, and HTTP ports for the Web server.

The Web server uses the file to access deployed applications on various appservers.

windowsServiceName

Specifies the Windows Operating System name for the Web server.

errorLogPath Location of the error log file.
accessLogPath Location of the access log file.
webProtocol Protocol to use for Web server communications. Use the HTTPS protocol to securely communicate with the Web server. The default is HTTP.

Syntax

AdminServerManagement.createWebServer(nodeName, newServerName, port, 
 serverInstallRoot, pluginInstallPath, configFilePath, 
 windowsServiceName, errorLogPath, 
  accessLogPath, webProtocol)

Example usage

AdminServerManagement.createWebServer("myNode", "myWebServer", "", "", "", "", "", "", "", "" )

 

deleteServer

This script removes a server from the appserver configuration.

To run the script, specify the node and server names, as defined in the following table:
Argument Description
nodeName Name of the node of interest.
serverName Name of the server to delete.

Syntax

AdminServerManagement.deleteServer(nodeName, serverName)

Example usage

AdminServerManagement.deleteServer("myNode", "myServer")

 

deleteServerTemplate

This script deletes a server template from the configuration.

To run the script, specify the template name, as defined in the following table:
Argument Description
templateName Name of the template to delete.

Syntax

AdminServerManagement.deleteServerTemplate(templateName)

Example usage

AdminServerManagement.deleteServerTemplate("newServerTemplate")




 

Related tasks


Use the script library to automate the application serving environment
Automating server administration using the scripting library

 

Related


Server query scripts
Server settings configuration scripts