Preserving the Client IP address to Apache servers and ApplicationsWhen ZXTM load-balances a connection to an Apache server or Apache-based application, the connection appears to originate from the ZXTM machine. This can be a problem if the server wishes to perform access control based on the client's IP address, or if it wants to log the true source address of the request. Zeus' ZXTM applicances provide an IP Transparency feature that preserves the client's IP address, and this is also available with the ZXTM software, on appropriate Linux kernels. As an alternative, Zeus provide several modules for common server applications to work round this issue. This FAQ describes the Apache module. ZXTM automatically inserts a special 'X-Cluster-Client-Ip' header into each request, which identifies the true source address of the request. Zeus' Apache module inspects this header and corrects Apache's calculation of the source address. This change is transparent to Apache, and any applications running on or behind Apache. Obtaining and Installing the ModuleDownload the source file for the module:
Make sure that you download the correct source file for your version of Apache. Compile and install it as follows:
Configuring the ModuleThe installation step should copy the mod_zeus.so module, and add the following to your httpd.conf file:
Important Note: If you use a ClearModuleList directive in your Apache httpd.conf file, you will also need to add the hooks for Zeus back in along with the other modules. This can be achieved for the Zeus module by adding the following line:
Add the following two lines to your httpd.conf file:
The ZeusLoadBalancerIp configuration directive specifies the back-end addresses of the ZXTM machines. The Apache module will only trust the 'X-Cluster-Client-Ip' header in connections which originate from these IP addresses. This means that remote users cannot spoof their source addresses by inserting a false header and accessing the Apache servers directly. Restart your Apache servers, and monitor your servers' error logs. If you have misconfigured the ZeusLoadBalancerIp value, you will see messages like:
The ResultApache, and applications running on Apache will see the correct source IP address for each request. The access log module will log the correct address when you use %a or %h in your log format string. The Apache module will add an environment variable named 'ZEUS_LOAD_BALANCER_IP', which you can inspect in your application, or log using %{ZEUS_LOAD_BALANCER_IP}e. This variable identifies the back-end IP address of the ZXTM machine that submitted the request. LicensingZeus provide this module without warranty or any guarantees of fitness for purpose. This module is not covered under Zeus' standard terms of support, but Zeus welcomes suggestions for improvement and will make reasonable efforts to support customers who use it. You are free to distribute this module and create derivative works from it, provided that you include the following attribution statement in the module and any supporting documentation:
Comments:This public messageboard is not a forum for technical support. To report technical support problems, please contact our dedicated Support team using the instructions at the bottom of this page.
Comment from:
david boehme [Visitor]
· http://www.sherdog.com
How about IIS. We experience the same issue described above but on IIS6.0 where our logfiles show the load balancer IP address instead the client's IP address. We are trying to install an ISAPI Filer as documented at here: http://blogs.msdn.com/david.wang/archive/2005/09/28/HOWTO_ISAPI_Filter_which_Logs_original_Client_IP_for_Load_Balanced_IIS_Servers.aspx
but the logfiles still show the load balancer's IP. Any suggestions that can point us in the right direction would be greatly appreciated.
Comment from:
Owen Garrett [Zeus Dev Team]
David,
Take a look at IP Transparency with the ZXTM software, where we describe how to get IP Transparency without the webserver-specific modules described above.
Comment from:
Dick Davies [Visitor]
· http://number9.hellooperator.net
That's great.
Just a slight security concern: does ZXTM ensure that if the client sets its own 'X-Cluster-Client-Ip' header, it's stripped from the request before being sent to apache?
Comment from:
Crispin Flowerday [Zeus Dev Team]
Dick,
ZXTM will always overwrite the X-Cluster-Client-Ip header (assuming it is configured to put the header in). In addition, the module is configured to only allow these headers from known IP addresses (e.g. ZXTM's IP addresses).
Comment from:
Ivo Teel [Visitor]
I'm currently trying to make ZXTM overwrite the X-Cluster-Client-IP header if the request originates from one of my load balancers.
The following code works fine: $ip = request.getRemoteIP(); if(string.ipmaskmatch($ip, "XX.XX.XX.XX/24" ) ) { $head = http.getHeader("X-Fowarded-For"); http.setHeader("X-Cluster-Client-IP", $head); } I've verified this by looping through http.getResponseHeaderNames(), it sets the X-Cluster-Client-IP header to what i want. Unfortunately, ZXTM still overwrites X-Cluster-Client-IP after processing all ZXTM rules. Even if I overwrite the requesting IP with request.setRemoteIP(). Is there some undocumented option to not overwrite in certain cases? |
Recently...
Other Resources
|





