Start of Content Area

Background documentation Creating Virtual Hosts  Locate the document in its SAP Library structure

Use

In the ABAP Application Server, you have the option of working with virtual hosts. Each virtual host has a tree of ICF services. This allows you to use the URL to search for a service in a given service structure (with a virtual host as the root node).

ExampleExample

An ABAP Application Server is running on the computer with the host name saphost and the IP address 1.2.3.4. The Internet Communication Manager (ICM) is configured so that ports 1080 and 8080 can receive HTTP requests (parameter icm/server_port_<xx>). The computer also responds to the alias myhost. Therefore, both saphost and myhost are mapped to the IP address 1.2.3.4.

Prerequisites

You define whether you want there to be different virtual hosts using the profile parameter

is/HTTP/virt_host_<n> = <host1>:port1;<host2>:<port2>;...;

(<n> stands for numbers 0,1,...9). This parameter can be changed statically in the instance profile or dynamically in transaction RZ11. Transaction RZ11 also contains parameter documentation. Note that parameter

is/HTTP/virt_host_0 = *:*;

is set and cannot be changed. Therefore, if no other virtual host is found, the default host number 0 is used. The default host shows up in the HTTP service tree for transaction SICF as default_host. Initially, this is the only virtual server.

To avoid namespace conflicts, all other hosts provided by SAP begin with “SAP”.

Other Functions

You can also specify a default service for a virtual host.

As with internal alias, select a target element from the HTTP service tree.If the URL then specifies the virtual host without any additional path information, the target service that is defined will be called.

Activities

To create a new virtual host, proceed as follows:

...

       1.      Call transaction RZ11 and set the parameter is/HTTP/virt_host_1 (for example, to the value myhost:*;).

Caution

Note that the dynamic change to the parameter is lost at the next system restart. If you want to set the parameter permanently, you have to set this in the profile file.

 

Call transaction SICF. Choose Virtual Host Create, enter a name (for example, virt_host1) and create services or aliases for existing services under this virtual host (see Creating Services).

As a test, create a service under virt_host1 called virtping, which uses the same handler as the service bc/ping under default_host, that is, the HTTP request handler CL_HTTP_EXT_PING.

This means that under the host name myhost on all ports to which the ICM responds (that is, 1080 and 8080), the HTTP service tree under the virtual host is the basis for searches for an appropriate URL path.

Therefore, entering http://myhost:1080/virtping would have the same effect, in this example, as http://saphost:8080/bc/ping.

Result

If a service is now called with the host name myhost and any port that is active in the ICM (1080 or 8080), the service tree under the virtual host virt_host1 will be used when searching for an appropriate URL path.<0}

In this example, entering http://myhost:1080/virtping would therefore have the same effect as entering http://saphost:8080/bc/ping.

 

The prerequisites for this are shown in the graphic below:

 

This graphic is explained in the accompanying text

Further Information

For an example of how virtual hosts can be used, see:

Virtual Hosts: Application Example

For detailed information about maintaining ICF profile parameters, see:

Maintaining the ICF Profile Parameters

 

 

 

 

 

 

End of Content Area