Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cloudflare IP corrected
#1
Hi, everyone this is my first post..

Recently I decide to switch to THT reworked 1.3.5 from other billing system

I just try it in my other reseller server but I found a problem

Because I using cloudflare CDN and cloudflare act as a reserve proxy, So THT only log the cloudflare IP

Not the true IP of visitor.. I know there is a apache mod for cloudflare

But since I install in a reseller I can't install it

So I would like to ask is there anyone know how to modify so THT will log the true IP

Thanks
Reply
#2
Hello.

Open the file that creates the logs (not sure which) and replace $_SERVER["REMOTE_ADDR"] with $_SERVER["HTTP_CF_CONNECTING_IP"]

If you're not sure which file, just run a sed -i 's/$_SERVER["REMOTE_ADDR"]/$_SERVER["HTTP_CF_CONNECTING_IP"]/g' *

-- but considering that you are on a reseller, chances are you won't be able to do this in SSH.
Remote Servers - Shared, Reseller & KVM Hosting Services
Reply
#3
(08-17-2012, 05:01 PM)Liam D. Wrote: Hello.

Open the file that creates the logs (not sure which) and replace $_SERVER["REMOTE_ADDR"] with $_SERVER["HTTP_CF_CONNECTING_IP"]

If you're not sure which file, just run a sed -i 's/$_SERVER["REMOTE_ADDR"]/$_SERVER["HTTP_CF_CONNECTING_IP"]/g' *

-- but considering that you are on a reseller, chances are you won't be able to do this in SSH.

Hmm, I nearly forgot THT is opensource(previously I am using a closesource billing software)

Thanks anyway I had replaces it and now it log the real IP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)