Oracle iPlanet Web Proxy Server 4.0.14 Administration Guide

Using Proxy Arrays

Proxy arrays for distributed caching enable multiple proxies to serve as a single cache. Each proxy in the array will contain different cached URLs that can be retrieved by a browser or downstream proxy server. Proxy arrays prevent the duplication of caches that often occurs with multiple proxy servers. Through hash-based routing, proxy arrays route requests to the correct cache in the proxy array.

Proxy arrays also enable incremental scalability. If you decide to add another proxy to your proxy array, each member’s cache is not invalidated. Only 1/n of the URLs in each member’s cache, where n is the number of proxies in your array, will be reassigned to other members.

Routing Through Proxy Arrays

For each request through a proxy array, a hash function assigns each proxy in the array a score that is based on the requested URL, the proxy’s name and the proxy’s load factor. The request is then routed to the proxy with the highest score.

Since requests for URLs can come from both clients and proxies, there are two types of routing through proxy arrays: client-to-proxy routing and proxy-to-proxy routing.

In client-to-proxy routing, the client uses the Proxy Auto Configuration (PAC) mechanism to determine which proxy to go through. However, instead of using the standard PAC file, the client uses a special PAC file that computes the hash algorithm to determine the appropriate route for the requested URL. Figure 12–4 shows client to proxy routing. In this fugure, each member of the proxy array loads and polls the master proxy for updates to the PAT file. Once the client has a PAC file, the client only needs to download this file again if the configuration changes. Generally, clients will download the PAC file at restart.

The proxy server can automatically generate the special PAC file from the Proxy Array Membership Table (PAT) specifications you determine using the administration interface.

Figure 12–4 Client to Proxy Routing

Diagram showing client to proxy routing.

In proxy-to-proxy routing, proxies use a PAT (Proxy Array Table) file to compute the hash algorithm instead of the PAC file used by clients. The PAT file is an ASCII file that contains information about a proxy array, including the proxies’ machine names, IP addresses, ports, load factors, cache sizes, and so on. For computing the hash algorithm at the server, using a PAT file is much more efficient than using a PAC file (which is a JavaScript file that has to be interpreted at run-time). However, most clients do not recognize the PAT file format, and therefore, must use a PAC file. Figure 12–5 shows proxy-to-proxy routing.

The PAT file is be created on the master proxy in the proxy array. The proxy administrator must determine which proxy will be the master proxy. The administrator can change the PAT file from this master proxy server. All other members of the proxy array can then manually or automatically poll the master proxy for these changes. You can configure each member to automatically generate a PAC file from these changes.

You can also chain proxy arrays together for hierarchical routing. If a proxy server routes an incoming request through an upstream proxy array, the upstream proxy array is then known as a parent array. In other words, if a client requests a document from Proxy X, and Proxy X does not have the document, it sends the request to Proxy Array Y instead of sending it directly to the remote server. So, Proxy Array Y is a parent array.

In Figure 12–5, Proxy Array 1 is a parent array to Proxy Array 2. A member of Proxy Array 2 loads and polls for updates to the parent array’s PAT file. Usually, the member polls the master proxy in the parent array. The hash algorithm for the requested URL is computed using the downloaded PAT file. The member in the Proxy Array 2 then retrieves the requested URL from whichever proxy in Proxy Array 1 has the highest score. In the figure, Proxy B has the highest score for the URL requested by the client.

Figure 12–5 Proxy-to-Proxy Routing

Diagram showing proxy-to-proxy routing.

The general steps to set up a proxy array are as follows.

From the master proxy, do the following steps:

  1. Create the proxy array.

    For more information on creating the member list, see Creating a Proxy Array Member List.

  2. Generate a PAC file from your PAT file.

    You only need to generate a PAC file if you are using client to proxy routing. For more information, see Generating a PAC File From a PAT File.

  3. Configure the master member of the array. For more information, see Configuring Proxy Array Members.

  4. Enable routing through a proxy array. For more information, see Enabling Routing Through a Proxy Array.

  5. Create a PAT mapping to map the URL /pat to the PAT file.

  6. Enable your proxy array.

    For more information, see Enabling or Disabling a Proxy Array.

From each of the non-master proxies, do the following steps:

  1. Configure the non-master member of the array.

    For more information, see Configuring Proxy Array Members

  2. Enable routing through a proxy array.

    For more information, see Enabling Routing Through a Proxy Array.

  3. Enable your proxy array.

    For more information, see Enabling or Disabling a Proxy Array.


    Note –

    If your proxy array is going to route through a parent array, you also need to enable the parent array and configure each member to route through a parent array for desired URLs. For more information, see Routing Through Parent Arrays.


Creating a Proxy Array Member List

You should create and update the proxy array member list from the master proxy of the array only. You only need to create the proxy array member list once, but you can modify it at any time. By creating the proxy array member list, you are generating the PAT file to be distributed to all of the proxies in the array and to any downstream proxies.


Note –

You should only make changes or additions to the proxy array member list through the master proxy in the array. All other members of the array can only read the member list.


ProcedureTo Create a Proxy Array Member List

  1. Access the Server Manager, and click the Caching tab

  2. Click the Configure Proxy Array link.

    The Configure Proxy Array page is displayed.

  3. In the Array name field, type the name of the array.

  4. In the Reload Configuration Every field, type the number of minutes between each polling for the PAT file.

  5. Click the Array Enabled checkbox.

  6. Click the Create button.

    The Create button changes to an OK button after the proxy array has been created.


    Note –

    Be sure to click OK before you begin to add members to the member list.


  7. Click OK.

  8. Click Restart Required.

    The Apply Changes page is displayed.

  9. For each member in the proxy array, provide the following and then click OK.

    The master member should be added first before adding the other members.

    • Name. The name of the proxy server you are adding to the member list

    • IP Address. The IP address of the proxy server you are adding to the member list

    • Port. This is the port on which the member polls for the PAT file.

    • Load Factor. An integer that reflects the relative load that should be routed through the member.

    • Status. The status of the member. This value can be either on or off. If you disable a proxy array member, the member’s requests will be re-routed through another member


    Note –

    Be sure to click OK after you type the information for each proxy array member you are adding.


  10. Click Restart Required.

    The Apply Changes page is displayed.

  11. Click the Restart Proxy Server button to apply the changes.

Editing Proxy Array Member List Information

At any time, you can change the information for the members in the proxy array member list. You can only edit the proxy array member list from the master proxy.


Note –

You should only make changes or additions to the proxy array member list through the master proxy in the array. If you modify this list from any other member of the array, all changes will be lost.


ProcedureTo Edit Member List Information

  1. Access the Server Manager, and click the Caching tab.

  2. Click the Configure Proxy Array link.

    The Configure Proxy Array page is displayed.

  3. In the Member List, select the radio button next to the member that you want to edit.

  4. Click the Edit button.

    The Configure Proxy Array Member page is displayed.

  5. Edit the appropriate information.

  6. Click OK.

  7. Click Restart Required.

    The Apply Changes page is displayed.

  8. Click the Restart Proxy Server button to apply the changes.


    Note –

    If you want your changes to take effect and to be distributed to the members of the proxy array, update the Configuration ID on the Configure Proxy Array page and click OK. To update the configuration ID, you can simply increase it by one.


Deleting Proxy Array Members

Deleting proxy array members removes them from the proxy array. You can only delete proxy array members from the master proxy.

ProcedureTo Delete Members of a Proxy Array

  1. Access the Server Manager, and click the Caching tab.

  2. Click the Configure Proxy Array link.

    The Configure Proxy Array page is displayed.

  3. In the Member List, select the radio button next to the member that you want to delete.

  4. Click the Delete button.


    Note –

    If you want your changes to take effect and to be distributed to the members of the proxy array, update the Configuration ID on the Configure Proxy Array page and click OK. To update the configuration ID, you can simply increase it by one.


  5. Click Restart Required.

    The Apply Changes page is displayed.

  6. Click the Restart Proxy Server button to apply the changes.

Configuring Proxy Array Members

You must configure each member in the proxy array once from the member itself. You cannot configure a member of the array from another member. You also need to configure the master proxy.

ProcedureTo Configure Each Member of the Proxy Array

  1. Access the Server Manager, and click the Caching tab.

  2. Click the Configure Proxy Array Member link.

    The Configure Proxy Array Member page is displayed.

  3. In the Proxy Array section, indicate whether the member needs to poll for the PAT file by selecting the appropriate radio button.

    • Non-Master Member. Select this option if the member you are configuring is not the master proxy. Any proxy array member that is not a master proxy must poll for the PAT file in order to retrieve it from the master proxy.

    • Master Member.Select this option if you are configuring the master proxy. If you are configuring the master proxy, the PAT file is local and does not need to be polled.

  4. In the Poll Host field, type the name of the master proxy to be polled for the PAT file.

  5. In the Port field, type the port at which the master proxy accepts HTTP requests.

  6. In the URL field, type the URL of the PAT file on the master proxy. If you have created a PAT mapping on the master proxy, to map the PAT file to the URL /pat, you should type /pat in the URL field.

  7. (Optional) In the Headers File field, type the full path name for a file with any special headers that must be sent with the HTTP request for the PAT file, such as authentication information.

  8. Click OK.

  9. Click Restart Required.

    The Apply Changes page is displayed.

  10. Click the Restart Proxy Server button to apply the changes.

Enabling Routing Through a Proxy Array

ProcedureTo Enable Routing Through a Proxy Array

  1. Access the Server Manager, and click the Routing tab.

  2. Click the Set Routing Preferences link.

    The Set Routing Preferences page is displayed.

  3. Select the resource from the drop-down list or click the Regular Expression button, type a regular expression, and click OK.

  4. Select the Route Through option.

  5. Select the checkboxes for proxy array or parent array.

    You can only enable proxy array routing if the proxy server you are configuring is a member of a proxy array. You can only enable parent routing if a parent array exists. Both routing options are independent of each other.

  6. If you choose to route through a proxy array and you want to redirect requests to another URL, select the redirect checkbox.

    Redirecting means that if a member of a proxy array receives a request that it should not service, it tells the client which proxy to contact for that request.

  7. Click OK.

  8. Click Restart Required.

    The Apply Changes page is displayed.

  9. Click the Restart Proxy Server button to apply the changes.

Enabling or Disabling a Proxy Array

If you are not routing through a proxy array, you should make sure that all clients use a special PAC file to route correctly before you disable the proxy array option. If you disable the parent array option, you should have valid alternative routing options set in the Set Routing Preferences page, such as explicit proxy or a direct connection.

ProcedureTo Enable or Disable a Proxy Array

  1. Access the Server Manager, and clcik the Preferences tab.

  2. Click the Configure System Preferences link.

    The Configure System Preferences page is displayed.

  3. Enable or Disable the proxy array.

    • To enable the proxy array, click the Yes option for the type of array or arrays you want to enable: a normal proxy array or a parent array.

    • To disable the proxy array, click No.

  4. Click OK.

  5. Click Restart Required.

    The Apply Changes page is displayed.

  6. Click the Restart Proxy Server button to apply the changes.

Redirecting Requests in a Proxy Array

If you choose to route through a proxy array, you need to designate whether you want to redirect requests to another URL. Redirecting means that if a member of a proxy array receives a request that it should not service, it tells the client which proxy to contact for that request.

Generating a PAC File From a PAT File

Because most clients do not recognize the PAT file format, the clients in client-to-proxy routing use the Proxy Auto Configuration (PAC) mechanism to receive information about which proxy to go through. However, instead of using the standard PAC file, the client uses a special PAC file derived from the PAT file. This special PAC file computes the hash algorithm to determine the appropriate route for the requested URL.

You can generate a PAC file from the PAT file manually or automatically . If you manually generate the PAC file from a specific member of the proxy array, that member will immediately regenerate the PAC file based on the information currently in the PAT file. If you configure a proxy array member to automatically generate a PAC file, the member will automatically regenerate the file after each time it detects a modified version of the PAT file.


Note –

If you are not using the proxy array feature for your proxy server, use the Create/Edit Autoconfiguration File page to generate your PAC file. For more information see Chapter 17, Using the Client Autoconfiguration File.


ProcedureTo manually generate a PAC file from a PAT file

The PAC file can be generated only from the master proxy.

  1. Access the Server Manager of the master proxy, and click the Caching tab.

  2. Click the Configure Proxy Array link.

    The Configure Proxy Array page is displayed.

  3. Click the Generate PAC button.

    The PAC Generation page is displayed.

  4. If you want to use custom logic in your PAC file, type the name of the file containing the customized logic you would like to include in the generation of your PAC file in the Custom logic file field.

    This logic is inserted before the proxy array selection logic in the FindProxyForURL function. This function is typically used for local requests which need not go through the proxy array.

    If you have already provided the custom logic file when configuring the proxy array member, this field will be populated with that information. You may edit the custom logic file name here.

  5. In the Default Route field, type the route a client should take if the proxies in the array are not available.

    If you have already provided the default route when configuring a proxy array member, this field will be populated with that information. You may edit the default route here.

  6. Click OK.

  7. Click Restart Required.

    The Apply Changes page is displayed.

  8. Click the Restart Proxy Server button to apply the changes.

ProcedureTo Automatically Generate a PAC File

  1. Access the Server Manager, and click the Caching tab.

  2. Click the Configure Proxy Array Member link.

    The Configure Proxy Array Member page is displayed.

  3. Select the Auto-generate PAC File checkbox.

  4. If you want to use custom logic in your PAC file, type the name of the file containing the customized logic you would like to include in the generation of your PAC file in the Custom Logic File field

    This logic is inserted before the proxy array selection logic in the FindProxyFor URL function.

    If you have already provided and saved the custom logic file when configuring the proxy array, this field will be populated with that information. You may edit the custom logic file name here.

  5. In the Default Route field, type the route a client should take if the proxies in the array are not available.

    If you have already provided the default route when configuring the proxy array, this field will be populated with that information. You may edit the default route.

  6. Click OK.

  7. Click Restart Required.

    The Apply Changes page is displayed.

  8. Click the Restart Proxy Server button to apply the changes.

Routing Through Parent Arrays

You can configure your proxy or proxy array member to route through an upstream parent array instead of going directly to a remote server.

ProcedureTo Route Through a Parent Array

  1. Enable the parent array.

    For more information, see Enabling or Disabling a Proxy Array.

  2. Enable routing through the parent array.

    For more information, see Enabling Routing Through a Proxy Array.

  3. Access the Server Manager, and click the Caching tab.

  4. Click the Configure Proxy Array Member link.

    The Configure Proxy Array Member page is displayed.

  5. In the Poll Host field in the Parent Array section of the page, type the host name of the proxy in the parent array to be polled for the PAT file.

    This proxy is usually the master proxy of the parent array.

  6. In the Port field in the Parent Array section of the page, type the port number of the proxy in the parent array that you will poll for the PAT file.

  7. In the URL field, type the URL of the PAT file on the master proxy.

    If you have created a PAT mapping on your master proxy, type the mapping into this URL field.

  8. (Optional) In the Headers File field in the Parent Array section of the form, type the full path name for a file with any special headers that must be sent with the HTTP request for the PAT file, such as authentication information.

    This field is optional.

  9. Click OK.

  10. Click Restart Required.

    The Apply Changes page is displayed.

  11. Click the Restart Proxy Server button to apply the changes.

Viewing Parent Array Information

If your proxy array is routing through a parent array, you need information about the members of the parent array. This information is sent from the parent array in the form of a PAT file.

ProcedureTo View Parent Array Information

  1. Access the Server Manager, and click the Caching tab.

  2. Click the View Parent Array Configuration link.

    The View Parent Array Configuration page is displayed.

  3. View the information.