|
Joined: May 2008
Posts: 753 Likes: 1
Old Hand
|
Old Hand
Joined: May 2008
Posts: 753 Likes: 1 |
I need to change REMOTE_ADDR in my scripts to HTTP_CF_CONNECTING_IP
how many scripts do I have to edit and which ones?
"No matter where you go, there you are." "If you can't do something smart, Do something right" "There are three kinds of people in the world, those who can count, and those who can't"
|
|
|
|
Joined: Apr 2007
Posts: 3,940 Likes: 1
Former Developer
|
Former Developer
Joined: Apr 2007
Posts: 3,940 Likes: 1 |
i googled that HTTP_CF_CONNECTING_IP and find nothing about it.. you sure you have that typed right? http://www.php.net/manual/en/reserved.variables.server.php <-- reference to $_SERVER variables used in php..
|
|
|
|
Joined: Jun 2006
Posts: 16,301 Likes: 116
|
Joined: Jun 2006
Posts: 16,301 Likes: 116 |
Not sure offhand, we had some issues previously with REMOTE_ADDR on some servers, I'd imagine you could surf through search results for them... I think it'd have the previous pages if you can find it
|
|
|
|
Joined: Apr 2007
Posts: 3,940 Likes: 1
Former Developer
|
Former Developer
Joined: Apr 2007
Posts: 3,940 Likes: 1 |
libs\captcha.inc.php':
libs\html.inc.php':
libs\includepoll.inc.php':
libs\mysql.inc.php':
libs\ubbthreads.inc.php':
libs\user.inc.php':
scripts\addpost.inc.php':
scripts\adduser.inc.php':
scripts\captcha.inc.php':
scripts\dopoll.inc.php':
scripts\profile_comment.inc.php':
scripts\shoutit.inc.php':
scripts\start_page.inc.php': just using grep shows these files, if you really NEED to
|
|
|
|
Joined: May 2008
Posts: 753 Likes: 1
Old Hand
|
Old Hand
Joined: May 2008
Posts: 753 Likes: 1 |
with this cloudflare thing I am trying out, all IPs show as being a cloudflare IP. HTTP_CF_CONNECTING_IP is a forwarded value that shows the correct IP.
because my site is on a shared virtual server, they can't/won't make global changes to the httpd.conf file as it will trash everyone elses stuff. they did make some changes so that my logs are showing up correctly, etc, but right now every user on my site is showing up from the same IP
"No matter where you go, there you are." "If you can't do something smart, Do something right" "There are three kinds of people in the world, those who can count, and those who can't"
|
|
|
|
Joined: Apr 2007
Posts: 3,940 Likes: 1
Former Developer
|
Former Developer
Joined: Apr 2007
Posts: 3,940 Likes: 1 |
well, with an editor like Ultraedit or similar, it's a very easy 1 click change... "replace in files" *.php, including subdirs.. see if it works... you can always revert back with the reverse replacement this assumes that it's a php accessible $_SERVER variable, which i don't find on php.net @ 1st glance..
|
|
|
|
Joined: May 2008
Posts: 753 Likes: 1
Old Hand
|
Old Hand
Joined: May 2008
Posts: 753 Likes: 1 |
thanx SD changing it in those files now has the correct IP showing up on posts and new registrations, etc.. and I'm not getting spammed with a million multiple login from same IP messages!
"No matter where you go, there you are." "If you can't do something smart, Do something right" "There are three kinds of people in the world, those who can count, and those who can't"
|
|
|
|
Joined: Apr 2007
Posts: 3,940 Likes: 1
Former Developer
|
Former Developer
Joined: Apr 2007
Posts: 3,940 Likes: 1 |
well, i must say i learned something today then
|
|
|
|
Joined: May 2008
Posts: 753 Likes: 1
Old Hand
|
Old Hand
Joined: May 2008
Posts: 753 Likes: 1 |
when someone trips a 404, or other error, I get an email like this..
Error 404 "Document Not Found" occurred for:
http://vannin.com/fiz
Responded with error template 'error_404.txt'.
The error was caused by a visitor from: cf-204-93-173-22.cloudflare.com This visitor has caused a 404 error 2 time(s).
The error time was: 2010-05-12 17:52:42
No referring URL was associated with this visit.
NOTE: This email message was generated by an automated script:
URL: http://vannin.com/guardian/ag-admin.pl
server: vannin.com
script: ag.pl
address: error@vannin.com
_____________________________________________________________________________
Environment Variables:
AG_ERROR_CODE: 404
AG_ERROR_COUNT: 2
AG_ERROR_URL: http://vannin.com/fiz
DOCUMENT_ROOT: /var/www/virtual/v/a/vannin.com/www
GATEWAY_INTERFACE: CGI/1.1
HTTP_ACCEPT: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP_ACCEPT_CHARSET: ISO-8859-1,utf-8;q=0.7,*;q=0.3
HTTP_ACCEPT_ENCODING: gzip
HTTP_ACCEPT_LANGUAGE: en-US,en;q=0.8
HTTP_CACHE_CONTROL: max-age=0
HTTP_CF_CONNECTING_IP: 173.162.162.82
HTTP_CF_IDENTIFY_BOT: 0
HTTP_CF_IPCOUNTRY: US
HTTP_CF_IPTYPE: CLEAN
HTTP_CF_USE_OB: 0
HTTP_CONNECTION: close
HTTP_COOKIE: 0wibiya32798_unique_user=1; __utmz=86733087.1273614104.110.5.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=http://vannin.com/; Error404=1; __utma=86733087.792751327.1263520286.1273659196.1273699890.113; __utmc=86733087; __utmb=86733087.8.10.1273699890; web_auth_cp=pmjzskvveiyykync
HTTP_FL_SERVER: 1n1f1
HTTP_HOST: vannin.com
HTTP_USER_AGENT: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.29 Safari/533.4
HTTP_X_FORWARDED_FOR: 173.162.162.82
PATH: /usr/local/bin:/usr/bin:/bin
QUERY_STRING: 404
REDIRECT_STATUS: 404
REDIRECT_URL: /fiz
REMOTE_ADDR: 204.93.173.22
REMOTE_HOST: cf-204-93-173-22.cloudflare.com
REMOTE_PORT: 37164
REQUEST_METHOD: GET
REQUEST_URI: /fiz
SCRIPT_FILENAME: /var/www/virtual/v/a/vannin.com/www/guardian/ag.pl
SCRIPT_NAME: /guardian/ag.pl
SCRIPT_URI: http://vannin.com/fiz
SCRIPT_URL: /fiz
SERVER_ADDR: 10.1.5.81
SERVER_ADMIN: root@localhost
SERVER_NAME: vannin.com
SERVER_PORT: 80
SERVER_PROTOCOL: HTTP/1.0
SERVER_SIGNATURE: <address>Apache/2.2.3 (Red Hat) Server at vannin.com Port 80</address>
SERVER_SOFTWARE: Apache/2.2.3 (Red Hat)
this one was before I changed REMOTE_ADDR in my scripts to HTTP_CF_CONNECTING_IP, and you can see where it thinks the visitor is from cloudflare. all the posts on my forums, all the new users, etc, were all showing from that IP address. by making that change, I am seeing their IP, and not the cloudflare IP
"No matter where you go, there you are." "If you can't do something smart, Do something right" "There are three kinds of people in the world, those who can count, and those who can't"
|
|
|
|
Joined: Mar 2007
Posts: 522
Addict
|
Addict
Joined: Mar 2007
Posts: 522 |
I wonder how many emails I'd get in a day!
Steve
UBB.classic from 2000-2003 UBB.threads from 2003-present!
|
|
|
|
Joined: May 2008
Posts: 753 Likes: 1
Old Hand
|
Old Hand
Joined: May 2008
Posts: 753 Likes: 1 |
I don't get that many actually... I have it set to ignore certain patterns, others it blocks the user completely if they are probing where they shouldn't be.. it makes it easy to keep track and fix broken links etc
"No matter where you go, there you are." "If you can't do something smart, Do something right" "There are three kinds of people in the world, those who can count, and those who can't"
|
|
|
|
Joined: Apr 2007
Posts: 3,940 Likes: 1
Former Developer
|
Former Developer
Joined: Apr 2007
Posts: 3,940 Likes: 1 |
|
|
|
|
Joined: May 2008
Posts: 753 Likes: 1
Old Hand
|
Old Hand
Joined: May 2008
Posts: 753 Likes: 1 |
well, i have everything from that filtered to it's own folder, same thing for all my honeypot notifications, like to keep the inbox somewhat clean.
"No matter where you go, there you are." "If you can't do something smart, Do something right" "There are three kinds of people in the world, those who can count, and those who can't"
|
|
|
2 members (ahmed047, Ruben),
323
guests, and
200
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|