Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Why does every visitor to my website have the same IP address?Why does every visitor to my website have the same IP address?
Previous
 
Next
New Post
5/11/2009 2:37 PM
 

I have dnn installed on a hosting cloud with a company named MOSSO (a division of Rackspace)  Pretty, all is well, except that the site log show the same IP address for everyone that logs in.  After some brief investigation, I found that the IP address that is shown is actually the IP of the load balancer they use.  They offer a work around for this below:

Here it is:

Your script is calling for the "REMOTE_ADDR" and receives the IP of a server in front of one of our back-end servers. The web facing server is then passing the scripts output without giving the expected REMOTE_ADDR of the visitor. In order for your scripts to recognize that they are on a cluster and log the correct IP of your visitors, you will need to replace and add the code below. But my question is "where" to implement in the DNN framework.  Basically I want to apply this fix so that the "UserHostAddress" field in the sitelog shows the correct user IP address and stops recording the web host (load balancer) address.
 

For ASP:
Locate any lines of code that are similar to this snipper of code,
Request.ServerVariables("REMOTE_ADDR")
And replace it with this snipper of code,
Request.ServerVariables("HTTP_X_CLUSTER_CLIENT_IP")

For sites using SSL on ASP and PHP:
If you have SSL enabled for you domain you will need to replace "REMOTE_ADDR"  with "HTTP_X_FORWARDED_FOR" in your code.
 
New Post
5/11/2009 5:06 PM
 

The questions is: How do we apply this fix to DNN?  Right now, the default IP gathering mechanism that DNN uses (which inserts the IP address of the user into the site log table)  does not appear to work on hosting clouds. The default DNN mechanism only picks up the IP address of the load balancer and not the actual client IP address.  The fix above works....but how do you apply it to DNN?    That is the big question....does anyone know?

 
New Post
5/11/2009 7:08 PM
 

According to item #5 on this page, the variable you want to replace "REMOTE_ADDR" with is actually "HTTP_X_FORWARDED_FOR" (perhaps either will work?)
 
Anyway, the DNN reference you're looking for is contained in file "default.aspx.vb" in your site's root folder.  Open the file and do a search for "addsitelog".  The specific reference you need to change is the passed stored procedure parameter "Request.UserHostAddress". 
 
Hope that helps-
-mamlin


esmamlin atxgeek.me
 
New Post
5/11/2009 7:30 PM
 

I submitted a modification that will fix this exact issue into the project tracker quite a few months back. I've since expanded the mod to handle every instance of Request.UserHostAddress. I'd be happy to help get this included in the next release if anyone from the core would like some assistance.... 

 

 
New Post
5/12/2009 9:47 AM
 

Thank you for the tip.  I went into default.aspx.vb and found the addsitelog area.  I then replaced "Request.UserHostAddress" with ("Request.ServerVariables("HTTP_X_CLUSTER_CLIENT_IP") and it worked.  I tried using HTTP_X_FORWARED_FOR but that did not work.  I also think DNN Corp needs to take a look at Oliver's code below and consider using it as a fix.  Cloud hosting  seems to be a growing phenomena and I think his code takes that into account when IP tracking is relied up.  My company uses IP tracking as a security mechanism to limit the number of IP's clients are allowed to use at login....so we really need the client machine IP's at login to make our security application operate.  Thank you for your help. I will post this fix on my website.
 

Thank again,
Bill Shoap
Work Smart Data Systems
www.worksmartdatasystems.com

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Why does every visitor to my website have the same IP address?Why does every visitor to my website have the same IP address?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out