Using Oracle WebCache as REVERSE PROXY SERVER
Assumptions: Server rsdb.realsoft.com accepts URL at port 7778 and has Oracle Webcache installed
Server apps.palco.com accepts calls at 7780 and has a web application installed
Security measures prevents opening of the port 7780.
The application has the following URL host:7780/test/faces/index.jsp
It is required that Server rsdb.realsoft.com acts as (Reverse) Proxy, so that requests coming to the application transfers internally by webcache to apps.palco.com on port 7780 transparently.
A server that transfers requests to internal servers behind it is called a reversed proxy server. The picture below shows such configuration.
(note: in the end of the document, I will explain another topology where both the origin server and the webcache reside on the same server, this might be needed when you have numerous OC4J on the same machine and you want to give them same Host and IP)
(Note: you can configure HTTP server to act as reverse proxy, but in this article, webcache is used instead)
Terminology:
Origin Server: The website that serves the application (apps.palco.com)
Site : The site that is exposed to the users (rsdb.realsoft.com)
One needs to configure Oracle webcache using the WebCache Manager using the following steps
Configure the site
Configure the Origin Server
Configure the site origin server mapping
Details
1) login to the oracle webcache manager (http://rsdb.realsoft.com:9400)
2) either create or edit the site definition as shown below
Note: you could specify URL path Prefix equal to / only so that the site can respond to other URL that are not necessarily related to /test/faces applications
a. Now that the Site is defined, it is time to configure the Origin Server. In the Origin Server configuration screen, Add a new Origin Server and fill required information as shown below (in this example we defined apps.palco.com at port 7780 as our origin server)
3) Next, site-to-server mapping is required, click the site-to-server mapping link and select the first record in the table , and choose Insert Above and fill the information as shown below
4) Submit the changes and restart webcache
Another scenario is where there are two OC4J in the same server that already contains WEBCACHE. In this case, both the site and origin server are installed on the same machine
The summary of the configuration is given in the following snapshots
SITE
Origin Server
Site to Server mapping
(for some reason, if the mapping is not in the first row, it does not work)
RESTART