Hi Zenato. You probably don’t need an iRule for this. You didn’t specify what kind of HTTP server you are using, but it is important to create/add a Virtual Host definition on each server in the pool. The big-ip Virtual Server represents 2 or more physical servers. So to keep the Hostname portion of the URL from changing, OHS and Weblogic allow you to add a Virtual Hostname to each server. Here are some links to get you started, your Web server Admin should know how to do this stuff.
http://docs.oracle.com/cd/E12839\_01/core.1111/e12035/webtier\_im.htm
http://docs.oracle.com/cd/E14571\_01/apirefs.1111/e13952/taskhelp/virtual\_hosts/VirtualHosts.html
If that does not work ( because your HTTP servers are old ), then you could try a big-ip STREAM profile, that will re-write the hostnames on the fly. You can check out the stream profile here:
There is an example of using the Stream Profile with WLS in this deployment guide:
If none of that works, then you will need to write an iRule, and search Devcentral Codeshare for an example of Host re-write.
Good Luck,
Chris.
Hi Chris, thank you for the response. I’m using apache-tomcat-6.0.35 http server. I use stream profile, it succeed but can only replace one IP address. in my problem i have 2 source address (10.251.227.1 & 10.251.227.2). in stream profile i can only modify from 10.251.227.1 to 10.251.227.231, but i can’t modify from 10.251.227.2 to 10.251.227.231.
Did you look at the example in the deployment guide as I suggested ? It shows the Stream profile replacing TWO ServerIP’s with the big-ip’s VirtualIP.
To create a new Stream profile
- On the Main tab, expand Local Traffic, and then click Profiles.
- On the Menu bar, select Other, and then click Stream. The Stream Profiles screen opens.
- Click the Create button. The New Stream Profile screen opens.
- In the Name box, type a name for this profile. In our example, we type wls-stream.
- In the Target row, click the Custom box, and then use the following syntax to type the target:
@@@@@@
In our example, we type:
@web0.weblogic10.example.com:7041@web.weblogic10.example.com@@web1.weblogic10.example.com:7041@web.weblogic10.example.com@
In this example, we are searching for the host name “web0” and “web1”, and replacing it with the host name of the virtual server “web” created by the template.
The second search and replace pattern (following the @@) is for our second WebLogic Server. 6. Click the Finished button.
However, I still highly recommend you fix the Apache server, so the Hostnames are redendered properly:
-Chris.
hi chris, i already found how to solve my issue. i used irules and stream profile like below : when HTTP_REQUEST { Disable the stream filter for all requests STREAM::disable } when HTTP_RESPONSE { Check if response type is text if {[HTTP::header value Content-Type] contains “text”}{ Replace IP addresses in response content with the string: 10.251.227.231 STREAM::expression “@10.251.227.1@10.251.227.231@ @10.251.227.2@10.251.227.231@” Enable the stream filter for this response only STREAM::enable } }