|
Problem(Abstract) |
How to list all the virtual host information for a
WebSphere® Application Server V5.0 cell using the wsadmin tool. |
|
|
|
Resolving the
problem |
The following sample script lists all the virtual hosts
that are configured in the cell, or on the node along with the host
aliases for the virtual host. A host alias consists of the host and port
combination.
To run this script:
1) Copy all the information between the asterisks to the virtualhost.jacl
file.
2) Go to the WebSphere bin directory, where you run the wsadmin tool.
3) Use the following command to start the wsadmin tool so that this .jacl
file is run. If the virtualhost.jacl file is not in the same directory as
the wsadmin tool, then place the path to the file in the command.
UNIX systems:
./wsadmin.sh -f virtualhost.jacl
Windows systems:
wsadmin -f virtualhost.jacl
*******************************
#This code lists all the Virtual hosts.
puts "\n----------"
set allVirtualHosts [$AdminConfig list VirtualHost]
puts "All Virtual Hosts:\n$allVirtualHosts"
foreach vHost $allVirtualHosts {
set hostAlias [lindex [$AdminConfig show $vHost { aliases }] 0 ]
set vname [lindex [$AdminConfig show $vHost {name}] 0 ]
puts "VHostName --> Aliases: $vname --> $hostAlias"
}
puts "----------\n"
#This code lists all the HostAliases.
puts "\n----------"
set hostAliases [$AdminConfig list HostAlias]
foreach host $hostAliases {
set hostName [lindex [$AdminConfig show $host {hostname}] 0]
set port [lindex [$AdminConfig show $host {port}] 0]
set hostName [$AdminConfig showAttribute $host {hostname}]
set port [$AdminConfig showAttribute $host {port}]
puts "hostAlias: $host"
puts "hostName:port = $hostName:$port"
}
puts "----------\n"
******************************* |
|
|
|
|
Cross Reference information |
Segment |
Product |
Component |
Platform |
Version |
Edition |
Application Servers |
Runtimes for Java Technology |
Java SDK |
|
|
|
|
|
|