Modifying External Application Connection Using WLST

Managing REST Services 26-3 The basic steps for setting up a proxy server on Apache are: 1. Obtain access to an Apache server. Oracle recommends Apache 2.2.7 or a later version. 2. Make sure the server has the mod_substitute module installed. Note that Apache versions 2.2.7 and later include mod_substitute by default. It is also possible to use mod_sed or mod_line_edit, however these configurations are not supported by Oracle. 3. Open the httpd.conf or the virtual host config file, and add the following lines, substituting your server nameinformation where appropriate: ProxyRequests Off LoadModule substitute_module modulesmod_substitute.so SetOutputFilter SUBSTITUTE ProxyPass restapi http:myhost:8888restapi ProxyPassReverse restapi http:myhost:8888restapi Substitute s|myhost|yourhost|n ProxyPass rpolkrestapi http:myhost:8888restapi ProxyPassReverse rpolkrestapi http:myhost:8888restapi Substitute s|myhost:8888restapi|yourhostrpolkrestapi|n 4. Restart the Apache server. For example, on Linux, you could do this: sudo etcinit.dhttpd restart Note that on some configurations of Linux, proxying with Apache in this fashion requires you tell selinux to allow outbound connections from httpd. You can accomplish this by enabling the httpd_can_network_connect flag in selinuxs GUI or through the command line. Note: This section illustrates a simple example of setting up a proxy server on Apache. For more detailed information, refer to the Apache Server documentation available at http:httpd.apache.orgdocs . You can also use Oracle HTTP Server OHS for your proxy server. For more information, see Oracle Fusion Middleware Administrators Guide for Oracle HTTP Server. Note: Two servers are being proxied in this example scenario. Note that the following two calls are actually talking to these two different servers, but they appear to clients to be the same server host: http:myhostrestapiresourceIndex http:myhostrpolkrestapiresourceIndex Developer Tip: Set the UserDir permissions in httpd.conf to allow users to drop these files in their own public_html directory. For example, you might hit http:host~yournamesample.html to access your sample application, and then have the sample application make XHR calls to http:hostrestapiresourceIndex.