mod_zeus

Discussion in 'Apache Migration/Compatibility' started by shahidbashir, May 16, 2011.

  1. shahidbashir

    shahidbashir New Member

  2. NiteWave

    NiteWave Administrator

  3. shahidbashir

    shahidbashir New Member

    I have changed as you asked and restarted the litespeed service but i am still watching the same IP of loadbalancer in my access_logs
  4. NiteWave

    NiteWave Administrator

    which load balancer you're running?
  5. webizen

    webizen New Member

    You can define log format (admin console->configuration->server->log) as follows: %

    the first field (defined as %{X-Cluster-Client-Ip}i) in your access log should show client IP.
  6. shahidbashir

    shahidbashir New Member

    I have added

    %{X-Cluster-Client-Ip}i %h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"

    in the log parameter but still no luck . still receiving the IP of loadbalancer .


    Thanks.
  7. webizen

    webizen New Member

    make sure your load balancer sends out request header like "X-Cluster-Client-IP: xxx.xxx.xxx.xxx" to lsws, where xxx.xxx.xxx.xxx is the client source IP address.
  8. shahidbashir

    shahidbashir New Member

  9. shahidbashir

    shahidbashir New Member

    Hello ,

    I can see in logs that it is showing the ip of my machine on private network 192.168.3.45 . but not showing the global ip of my request . i have seen that
    key=HTTP_X_CLUSTER_CLIENT_IP contains the correct IP that i want but when i use the log format that you sent
    %{X_CLUSTER_CLIENT_IP}i %h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"


    it give me my private network ip . please advise on that

    Thanks,
    Shahid.
  10. shahidbashir

    shahidbashir New Member

    i am seeing the required rest header in the following format

    key=HTTP_X_CLUSTER_CLIENT_IP || value =xx.xx.xx.xx


    Thanks.
  11. webizen

    webizen New Member

    The request header format needs to be "x-cluster-client-ip: xx.xx.xx.xx". The reason of private IP shown in log is likely because Zeus load balancer sends the private IP in the x-cluster-client-ip request header.

    BTW, what exactly is the below format?

  12. shahidbashir

    shahidbashir New Member

    infact i can see that HTTP_X_CLUSTER_CLIENT_IP contains the correct IP that I want in logs . and same is configured in log_format but it is not showing up in the logs as expected .

    the ip that is showing up in logs is in HTTP_X_FORWARDED_FOR . i exchanged it in log_format as well , just to see . but same happens .


    Thanks,
    Shahid.
  13. webizen

    webizen New Member

    Are you talking about $_SERVER['HTTP_X_CLUSTER_CLIENT_IP'] variable?
    If so, "%{x-cluster-client-ip}i" should be used in lsws server logformat definition (as pointed out before) to get the correct IP recorded in log file.

Share This Page