Before you begin
Before starting this task, the wsadmin tool must be running. See the Starting the wsadmin scripting client article for more information.Why and when to perform this task
Some configuration object types have templates that you can use when you create a virtual host. You can create a new virtual host using a preexisting template or by creating a new custom template. Perform the following steps to create a new virtual host using a template:
Steps for this task
<WAS-ROOT>\config\templates\default\virtualhosts.xml
<WAS-ROOT>\config\templates\custom\
Using Jacl:
$AdminConfig reset
AdminConfig.reset()
The administrative console does not support the use of custom templates. The new template that you create will not be visible in the administrative console panels.
Using Jacl:
$AdminConfig listTemplates VirtualHost
print AdminConfig.listTemplates('VirtualHost')
default_host(templates/default:virtualhosts.xml#VirtualHost_1) my_host(templates/custom:virtualhostname.xml#VirtualHost_1)
Using Jacl:
set cell [$AdminConfig getid /Cell:NetworkDeploymentCell/] set vtempl [$AdminConfig listTemplates VirtualHost my_host] $AdminConfig createUsingTemplate VirtualHost $cell {{name newVirHost}} $vtempl
cell = AdminConfig.getid('/Cell:NetworkDeploymentCell/') vtempl = AdminConfig.listTemplates('VirtualHost', 'my_host') AdminConfig.createUsingTemplate('VirtualHost', cell, [['name', 'newVirHost']], vtempl)
Related concepts
AdminConfig object for scripted administration
Related reference
Commands for the AdminConfig object