Network Deployment (Distributed operating systems), v8.0 > Reference > Jython script library


Server configuration scripts

The scripting library provides multiple script procedures to automate the application server configurations. Use the application server scripts to create application servers, 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 the WAS_HOME/scriptLibraries/servers/V80 directory. If you 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 application server:



createApplicationServer

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

createApplicationServer argument descriptions. Run the script with the node, server, and template names.

Argument Description
nodeName Name of the node on which to create the application server.
serverName Name of the server to create.
templateName Optionally specifies the template to use to create the application server.

Syntax

AdminServerManagement.createApplicationServer(nodeName, serverName, templateName)

Example usage

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


createAppServerTemplate

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

createAppServerTemplate argument descriptions. Run the script with the node name, server name, and new template name arguments.

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

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

createGenericServer argument description. Run the script with the node name, new server name, template name, start command path and arguments, working directory, and stop command path and arguments.

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) (Solaris)
AdminServerManagement.createGenericServer("myNode", "myServer",
 "default", "", "", "/temp", "", "")


createWebServer

Configure a web server in the configuration. An application server works with a web server to handle requests for dynamic content, such as servlets, from web applications. A web server uses Web Server Plug-ins to establish and maintain persistent HTTP and HTTPS connections with an application server. If you do not want to set an argument, specify an empty string as the value for the argument, as the following syntax demonstrates: "".

createWebServer argument descriptions. Run the script with 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.

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 you are using IBM HTTP Server. For all other web servers, this field is not required. If you 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 your Web server. Specify the file and not just the directory of the file. The application server generates the plugin-cfg.xml file by default. The configuration file identifies applications, application servers, clusters, and HTTP ports for the web server. The web server uses the file to access deployed applications on various application servers.
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 application server configuration.

deleteServer argument descriptions. Run the script with the node and server names.

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.

deleteServerTemplate argument description. Run the script with the template name.

Argument Description
templateName Name of the template to delete.

Syntax

AdminServerManagement.deleteServerTemplate(templateName)

Example usage

AdminServerManagement.deleteServerTemplate("newServerTemplate")

Use the script library to automate the application serving environment using wsadmin.sh
Automate server administration using wsadmin.sh


Related


Server query scripts
Server settings configuration scripts

+

Search Tips   |   Advanced Search