Example: Creating new virtual hosts using a template
Some configuration object types have templates that you can use when you create a virtual host.
- Create a new virtual host template virtualhostname.xml in the following directory:
<WAS-ROOT>\config\templetes\custom\
- Copy and paste the following file into the new virtual host template:
<WAS-ROOT>\config\templetes\default\virtualhosts.xml- Edit and customize the new virtualhostname.xml file.
- Use the reset command to recognize new templates, for example:
$AdminConfig reset- Use the AdminConfig object listTemplates command to list available templates, for example:
$AdminConfig listTemplates VirtualHostExample output:default_host(templates/default:virtualhosts.xml#VirtualHost_1) my_host(templates/default:virtualhosts.xml#VirtualHost_1)Note: To list the new templates, restart DeploymentManager or use the AdminConfig object reset command.
- Create a new virtual host using the custom template, for example:
set cell [$AdminConfig getid /Cell:NetworkDeploymentCell/] set vtempl [$AdminConfig listTemplates VirtualHost my_host] $AdminConfig createUsingTemplate VirtualHost $cell {{name newVirHost}} $vtempl- Save the changes with the following command:
$AdminConfig saveNote: 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.