Layer 7 Load Directing with WebMux
Layer 7 load directing allows you to send clients to servers based on regular expression pattern matching comparison to the Cookie MIME header, the Host MIME header, and/or URI of the HTTP request. When configuring Layer 7 Load directing, you can set up multiple farms using the same farm IP and port as long as the match patterns for each farm is unique. Each farm will have its own set of servers as the destination for the matching pattern. This step by step guide will show you how to create a Layer 7 Host MIME header Load Directing farm on the WebMux. The same steps apply for the other types of Layer 7 Load Directing options. Just be sure to put the regular expression match patterns in the appropriate fields.
In this example, we will be using the following information:
- There will be one IP and port that will accept requests for two different sites. This will be done utilizing two farms that will both be accepting incoming connections to 192.168.15.100 on port 80.
- Each farm will have one of the two site names in the Host MIME header match pattern field.
- The two different sites will be www.site1.com and www.site2.com.
- We will have servers at 192.168.11.11 and 192.168.11.12 serving www.site1.com.
- We will have servers at 192.168.11.13 and 192.168.11.14 serving www.site2.com.
- We will have a server at 192.168.11.15 that will be serving both www.site1.com and www.site2.com.
The first farm we will create will be directing traffic for www.site1.com. Under the “Farm Management” menu, click on “Add Farm”. Fill in the fields: label (for visual reference on the main screen), IP address, port number, and importantly the hostname of the site to be sent to the servers of this farm in the “host MIME header perl regex” field. Since these are HTTP servers, we will select “HTTP – hypertext transfer protocol” for the Service selection. You can choose the scheduling method appropriate for your situation. In our example, we will choose “weighted round robin”. The settings should look like the figure below. Click the Submit button.
The main screen will now show the new farm entry:
Click on the radio button to the left of the “WRR farm” line and click on the Add Server to add the real server at 192.168.11.11 to this farm.
Click the Submit button and repeat the steps to add servers 192.168.11.12 and 192.168.11.15 to the farm. The main screen will now look like this:
Now, we will create the farm configuration that will be directing traffic for www.site2.com. We will be using the same farm IP and port, scheduling method, and service as the farm for www.site1.com. However, be sure to use the Site 2 for the label, and www.site2.com for the “host MIME header perl regex” field. The screen should look like the figure below. Click the Submit button.
The main screen should now show as follows:
Click on the radio button the left of the “Site 2” farm and click on the “Add Server” link on the left menu to add the real servers. Follow the same steps as you did for the Site 1 farm to add servers. For the “Site 2” farm, we will be adding real servers at 192.168.11.13, 192.168.11.14, and 192.168.11.15.
After completing the “Add Server” steps, your main screen will now show:
Be sure to click on the “Save” link to save your farm/server configuration.
So, in conclusion, we have www.site1.com and www.site2.com resolving to IP 192.168.15.100. Because of the Layer 7 Load Directing match pattern we entered in the “host MIME header perl regex” field, only the Site 1 farm will receive traffic for www.site1.com and only the Site 2 farm will receive traffic for www.site2.com. The server at 192.168.11.15 is service for both sites, hence its addition to both farms. This is not necessary, but only an example to show that you can add the same servers to both farms if you require a server to handle both sites.