Example documentationOne Web Dispatcher, Two Systems: Configuration Example Locate this document in the navigation structure

 

You have several ways of configuring the Web Dispatcher for multiple systems.

  • You can use different ports and/or IP addresses for the different systems.

  • You can control the systems using various URL prefixes (at the start of the URL path).

  • You can use the modification handler. This is the most flexible way: Here you only have to open one port in the Web Dispatcher, and you can control the systems separately using rules, for example, host name aliases.

Features

In the example below there are two systems with system IDs ERP and CE1, which have the following properties:

  • ERP is an ABAP-only system, CE1 a Java-only system with usage type EP (SAP NetWeaver Portal). Since the system types do not overlap, there is no restriction for using servers of the same name.

  • The message server of the ERP system runs on host ms_erp, and has opened HTTP port 8082 to exchange data with the Web Dispatcher. With system CE1 the host and HTTP port of the message server are ms_ce1 and 8127.

  • The host on which the Web Dispatcher is running is called webdisp, and has IP address 1.2.3.4.

Control Using Ports/IP Addresses

You can assign the incoming requests to the connected systems by the port or IP address where they arrive in the Web Dispatcher.

Control Using Ports

You configure two HTTP ports in the Web Dispatcher:

icm/server_port_0 = PROT=HTTP, PORT=8888

icm/server_port_1 = PROT=HTTP, PORT=7777

In addition, you define the system assignments, as follows:

wdisp/system_0 = SID=ERP, MSHOST=ms_erp, MSPORT=8082, SRCSRV=*:8888

wdisp/system_1 = SID=CE1, MSHOST=ms_ce1, MSPORT=8127, SRCSRV=*:7777

Then all requests that enter through port 8888 go to the ERP system, and requests entering through port 7777 go to the CE1 system.

The following figure displays the assignment of requests at the entry ports.

This graphic is explained in the accompanying text.

Assignment Using Entry Port

Control Using IP Addresses

You can find an example of the control using IP addresses in SAP Web Dispatcher for Multiple Systems

Control Using URL Prefixes

You can also define a URL prefix for each system to separate the requests. It can be useful to use the parameter wdisp/system_conflict_resolution = 1 to define that the system selection is performed in a specific order.

An example of the most simple configuration looks like:

You define an HTTP port for the Web Dispatcher:

icm/server_port_0 = PROT=HTTP, PORT=8888

You can use the following parameter to define that ambiguity will be resolved by selecting the first matching system:

wdisp/system_conflict_resolution = 1

You specify the assignment to the systems:

wdisp/system_0 = SID=ERP, MSHOST=ms_erp, MSPORT=8082, SRCURL=/sap/

wdisp/system_1 = SID=CE1, MSHOST=ms_ce1, MSPORT=8127, SRCURL=/

Then all requests with a URL path starting with /sap/ go to the ABAP system ERP, and all other requests go to the EP system CE1.

Note Note

If the default setting wdisp/system_conflict_resolution = 0 were used in this example, the Web Dispatcher would terminate with an error message, since the system selection, for example, for the URL prefix /sap/webdynpro would not have been unique.

End of the note.

The following figure shows the assignment of requests using URL prefixes.

This graphic is explained in the accompanying text.

Assignment Using URL Prefixes

Control Using Modification Rules

The modification rules are the most powerful tool for distributing requests to systems. You apply a rule to the request, and depending on the result you set the pseudo header field ~webdisp_target_sid to the system you want the request to go to.

For example, you can set the header field dependent on the header field host. To do this, for each system you only need an alias of the Web Dispatcher host name; you do not need a separate IP address. The header field host contains the alias under which the request arrived.

If the Web Dispatcher has alias names wd_erp and wd_ce1, in addition to webdisp, you can define the following HTTP modification:

if %{HTTP_HOST} regimatch wd_erp*

SetHeader ~webdisp_target_sid ERP [break]

if %{HTTP_HOST} regimatch wd_ce1*

SetHeader ~webdisp_target_sid CE1 [break]

RegForbiddenUrl ^/(.*)

So you assign

  • requests with host header wd_erp to the ERP system (use regimatch wd_erp* so that the condition is also met with the fully qualified host name).

  • requests with host header wd_ce to the CE1 system (use regimatch wd_erp*, so that the condition is also met with the fully qualified host name).

Requests with a different host header are forbidden.

You then need a port in the Web Dispatcher:

icm/server_port_0 = PROT=HTTP, PORT=8888

The system assignments then only require the details of the SIDs and the associated message servers:

wdisp/system_0 = SID=ERP, MSHOST=ms_erp, MSPORT=8082

wdisp/system_1 = SID=CE1, MSHOST=ms_ce1, MSPORT=8127

Caution Caution

If there is no control settings in the action file, requests are not forwarded to a system.

End of the caution.

The following figure shows this assignment using the host header field and the action file.

This graphic is explained in the accompanying text.

Assignment Using Modification Rules

Example of Ambiguity in the System Selection

The most meaningful application of ambiguity in the system selection is to distribute requests to multiple identical systems.

Note Note

The following example is not a recommended system configuration. Rather, it illustrates overlapping configurations and the effect of parameter wdisp/system_conflict_resolution = 2.

End of the note.

The Web Dispatcher is running on host webdisp. Two HTTP ports are defined in the profile of the Web Dispatcher: 8888 and 7777. The following rules are defined in parameter wdisp/system_<xx> for forwarding incoming requests to the two systems:

  • Requests arriving in Web Dispatcher port 8888 are to go to system ERP.

  • Requests arriving in port 8888 or 7777, and whose URL path starts with the prefix /irj/ are to go to system CE1.

Note Note

Since this configuration contains ambiguity, it is only possbile if wdisp/system_conflict_resolution = 2. If wdisp/system_conflict_resolution = 1, the first matching entry is used (as explained above), with the default value, wdisp/system_conflict_resolution = 0, the Web Dispatcher will not start.

End of the note.

The profile contains the following parameters:

# SAP Web Dispatcher Port

icm/server_port_0 = PROT=HTTP,PORT=8888

icm/server_port_1 = PROT=HTTP,PORT=7777

...

wdisp/system_conflict_resolution = 2

...

# accessible systems and port mappings

wdisp/system_0 = SID=ERP, MSHOST=ms_erp,MSPORT=8082, SRCSRV=*:8888

wdisp/system_1 = SID=CE1, MSHOST=ms_ce1, MSPORT=8127, SRCURL=/irj/, SRCSRV=*:8888;*7777

The figure below shows this configuration permitting ambiguity.

This graphic is explained in the accompanying text.

Dispatching Using Multiple Systems

The table below shows an example of what the Web Dispatcher does with the various requests given this configuration.

Request URL

Possible systems

Activity of the Web Dispatcher

http://webdisp:7777/irj/sap/info

CE1

The Web Dispatcher selects an application server of system CE1, and forwards the request to this server.

http://webdisp:8888/irj/index.htm

ERP, CE1

The Web Dispatcher selects its server from all application servers in systems ERP and CE1, and forwards the request to this server.

http://webdisp:8888/sap/bc/abap/docu

ERP

The Web Dispatcher selects an application server of system ERP, and forwards the request to this server.

http://webdisp:7777/sap/public/ping

None

No system is defined for the URL. The Web Dispatcher returns the error Dispatching error.

http://webdisp:7777/sap/irj/index.htm

None

No system is defined for the URL. The Web Dispatcher returns the error Dispatching error.