Entering content frameBackground documentation Virtual Hosts Locate the document in its SAP Library structure

SAP Web Application Server offers virtual host functionality based on commercial Web servers. The term virtual server is also sometimes used.

In other Web server systems, virtual hosts allow a host to be accessible via various combinations of host names and ports. The host names here must be aliases. The computer then acts differently depending on the method of access, for example, it takes different locations in the file system as the root.

Note

For detailed information on the concept underlying virtual hosts, see Virtual Hosts - Advantages.

In the SAP System, a virtual host has ist own tree of ICF services.

The procedure is explained by means of the following example.

Example

ICM Configuration

An SAP Web Application Server is running on the computer with the host name saphost and the IP address 1.2.3.4. The 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.

You define whethere there should 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".

Creating a Virtual Host

To create a new virtual host, take the following steps:

  1. Call transaction RZ11 and set the parameter is/HTTP/virt_host_1 z. B. to the value myhost:*; .
  2. 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.

  3. Call transaction SICF. Choose Virt. Choose Virtual Host ® Create Virtual Host, enter (for example) virt_host1, and create services or aliases to existing services under this virtual host. Creating a Service describes how this works.

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.

At this point, however, you can also assign different modes of behaviour to the various ping services under the various virtual hosts.

The prerequisites for this are shown in the graphic below:

This graphic is explained in the accompanying text

Specifying a Default Service for a Virtual Host

You can specify a default service for a virtual host.

This graphic is explained in the accompanying text

As with an internal alias (see Internal Aliases) 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.

 

 

 

 

 

 

Leaving content frame