Configuring a web Preview Server

You can configure your web Preview Server and the proxy-config.xml file.

Before you begin

Important: This topic does not apply to WebSphere® Application Server traditional, Liberty, or Liberty Core. It applies to Web Preview Server only.

Procedure

  1. In the Servers view, double-click the web Preview Server to open the server editor. You can use the Overview and Security pages to configure your web Preview Server.
  2. In the General Information section of the Overview page, edit the server name, host name, and runtime environment.
  3. In the Communication Settings section, specify the default port number to use for the web Preview Server.
    Note: If the default port number is already in use, the web Preview Server automatically assigns another available port number.
  4. In the Publishing section, select one of the following settings:
    Option Description
    Never publish automatically The workbench never publishes files to the server.
    Automatically publish when resources change The workbench publishes when changes to a file that is associated with the server are saved and the full-time interval from the Publishing interval setting has passed. This is the default setting.
    Automatically publish after a build event The workbench publishes when changes to a file that requires a build and is associated with the server are saved, and the full-time interval from the Publishing interval setting has passed.
    Publishing interval (in seconds) The number of seconds before the workbench publishes the files on the server. However, if you make a subsequent change to the files before this time interval completes, publishing is delayed because the timer is reset. The workbench publishes to the server only after the full-time interval passes. If you set the publishing interval to 0 seconds, a file is published as soon as changes to a file are saved.
  5. In the Timeouts section, set the amount of time for requests to complete.
  6. The Ajax Proxy section contains a table that shows the access URLs with their corresponding resolved target URLs. The Ajax proxy section has a default proxy rule for wildcards that are listed in the Access URL column (proxy/http/*) which you can use to proxy any URL. For example, you can use this http://localhost:8080/proxy/http/google.com URL in the web browser to load the Google web page. This request that is mapped through the proxy has the same outcome as issuing a direct request to http://www.google.com.
    Tip: You can right-click on a row of the Ajax proxy URL table and copy the Access URL, for example proxy/us/en to paste into your JavaScript code.
  7. Click the Configure Proxy URLs link to edit the proxy-config.xml.
  8. In the Ajax Proxy Configuration editor, add proxy rules for mapping to remote domains. Select the Proxy Rules node and click Add.
  9. In the Add Item window, select one of the following items and edit its attributes in the editor:
    Option Description
    Mapping Maps incoming requests to a target URL, based on their context path.

    Specify a Context path attribute and an optional URL attribute. For example, you might set a context path of /ibmproducts to the URL http://www.ibm.com/products.

    If the incoming proxy URL is http://mywebsite.com/ibmproducts/us/en, the proxy forwards the request to http://www.ibm.com/products/us/en. The proxy resolves context path mappings before you apply the matching access policy. Two default proxy mappings, http/* and us/en, are provided to support rapid prototyping.

    Metadata Specifies general configuration properties of the proxy, for example, HTTP-related parameters. The proxy editor provides some common metadata options with default name and value pairs:
    forward-http-errors
    By default, the Ajax proxy forwards only HTTP status codes greater than or equal to 200 and less than 400. Status codes that fall outside the range automatically change to a 404 File Not Found error. You can forward HTTP codes greater than or equal to 400 with a message by setting the forward-http-errors parameter to true.
    unsigned_ssl_certificate_support
    Unsigned certificates are often used on protected REST services. When unsigned_ssl_certificate_support is enabled, the Ajax proxy accepts any SSL certificate. This option is useful for testing and debugging. Do not use this option in a production environment.
    basic-auth-support
    Set this option to true if the target service uses basic authentication. An HTTP status code of 401 (unauthorized) results in 403: Forbidden HTTP code unless the basic-auth-support attribute is enabled for that specific request.
    maxconnectionsperhost
    The maxconnectionperhost is a global value that specifies the maximum number of connections kept alive for any host or port combination. By default, the value is set to 2. Increase the value if your application accesses more than two remote sites for content.
    maxtotalconnections
    The maxtotalconnections is the maximum total of connections that are supported by the proxy. The default value is 5. The value that you choose must be a high enough to support the number of simultaneous connections you might receive. In practice, factor in how the web container is configured and how many simultaneous connections the container supports.
    socket-timeout
    The socket-timeout defines the default socket timeout in milliseconds for waiting for data after a connection is established. The default is a timeout value of 0, which is interpreted as an infinite timeout.
    retries
    The retries parameter defines the number of socket retries the Ajax proxy performs before giving up on establishing a connection. The default value is 2.
    connection-timeout
    The connection-timeout defines the time in milliseconds before a connection is established. If no value is specified, then the default value of 60000 is used. If 0 is used, then the value is interpreted to mean that no timeout is used.
    Policy Defines an access policy for a given URL pattern.
    1. In the ACF field, turn active content filtering on or off. Active content filtering removes potentially malicious active content from application content that is displayed in a browser.
    2. Specify the pattern in the URL attribute field. For each incoming request, the proxy applies the policy with the best URL match. If no matching policy is found, the proxy rejects the request. If a policy is found, the subelements of the policy element are applied to check whether to accept the request.
    3. Turn support for basic authentication challenges on or off.
    You can edit the following policy subelements:
    Action methods
    Specify at least one supported HTTP method. The Ajax proxy supports GET, POST, PUT, HEAD, or DELETE requests.
    Cookies
    Define a list of cookie names that identify the cookies that you want the proxy to forward to the target domain. To forward cookies, the proxy filters the value of the cookie header according to the defined cookie names.
    HTTP headers
    Define the list of header names that you want the proxy to forward to the target domain. The header names can include wildcard characters.
    Mime-types
    Specify the list of accepted mime types. The mime types refer to the response that the proxy receives from the target server. If at least one mime type is specified, the proxy accepts only responses with a Content-Type response header that matches one of the specified mime types. If no mime type is specified, the proxy accepts all responses.
    Users
    Specify a list of users or user groups. For example, if you specify AllAuthenticatedUsers, the proxy verifies that the request was sent by an authenticated user.
  10. The Ajax Proxy keystore section shows information for the keystore that is used by the Ajax proxy, such as the keystore path and type. You can add or remove SSL certificates from the keystore to use the Ajax proxy to retrieve information from URLs for which the target server uses untrusted SSL certificates. After you import the SSL certificate of a URL that points to a server with an untrusted certificate, you can use Ajax Proxy to access this URL without receiving an error message.
    1. Optional: If the keystore password was changed by using software that is acquired from another vendor, update the password in the Keystore password field.
    2. Add or remove SSL server certificates from the keystore that is specified in the Keystore path field.
      1. Click Manage Keystore Entries. The Manage Keystore window opens and shows a list of the current keystore entries, each identified by their alias.
      2. To remove a keystore entry, select the entry from the list of keystore entries, and then click Remove Entry.
      3. To add a keystore entry, click Add Entry. The Import Certificate window opens.
      4. In the Entry Alias field, specify an alias for the new keystore entry.
      5. Specify whether you want to import SSL certificates from a server or the local system.
        Import certificates from a server to the keystore
        Enter the URL of the server from which you want to import the SSL certificates.
        Import a local certificate to the keystore
        Click Browse Certificate to locate the SSL certificate on your local system that you want to import.
      6. Click OK to save your changes and close the Import Certificate window. In the Manage Keystore window, click OK save all of your changes to the keystore.
  11. In the Security page, configure the following settings.
    Section Description
    General Enable or disable the security for web applications; review the current projects that are deployed on the web Preview Server.
    Note: You must enable security for web applications that are deployed on the web Preview Server. You can configure the security in the WebContent/WEB-INF/web.xml file that is contained in the web project that you want to deploy to the server.
    Users and Groups Manage the users and groups that are registered on the web Preview Server.
    • Register new users on the server.
    • Remove users from the server.
    • Register new groups on the server.
    • Add or remove users from registered groups.
    • Remove groups from the server.
    Security Roles Manage the security roles that are registered on the web Preview Server.
    • Register security roles on the server.
    • Remove security roles from the server.
    • Map security roles to users.
    • Remove security roles from users.
    • Map security roles to groups.
    • Remove security roles from groups.
  12. Save your changes.
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: tconfigajaxtestserver.html