This article is a mirror article of machine translation, please click here to jump to the original article.

View: 27999|Reply: 4

[Solved] Discuz spider logging visiting ip logging error solution

[Copy link]
Posted on 8/15/2017 2:36:06 PM | | | |

Today, I want to install a plugin that records spider visits, so I can analyze my website

dz application center download address: http://addon.discuz.com/?@k_spider.plugin

After the installation was completed, I didn't take too much care, and then, in the afternoon, I went to check the spider access records



I found that they were all IP addresses starting with 100.166, and then Baidu searched for IP and found that they were all reserved addresses

It should be that the spider IP was not obtained correctly because the Alibaba Cloud load balancing used by the website was used.



Client Real IP Obtain the client's real IP through the X-Forwarded-For header field


Then, find the plugin directory address: /source/plugin/k_spider

Edit spider.class.php file and find 20 lines



Modified to


Spider recording plugin, it's normal!




Previous:SQL statements count how many columns a table has
Next:Win10 collects privacy as the capital of Microsoft's show data
 Landlord| Posted on 8/15/2017 2:37:33 PM |
For WEB servers, there are two main ways to obtain IP
1. The address to establish a TCP connection with the server Remote Address
2. Via the X-Forwarded-For field of the Http Header

The corresponding PHP variables are as follows

$_SERVER['REMOTE_ADDR'] // IP that establishes a TCP connection with the service
$_SERVER['HTTP_X_FORWARDED_FOR'] // Get the http request header X-Forwarded-For data

Remote Address
The IP that establishes a TCP connection to the server
It cannot be forged and is very suitable as the user's real IP
However, after an HTTP request passes through a seven-layer proxy, it is no longer a user IP, usually an SLB IP
X-Forwarded-For
Pass to the server via Http Header
It can be forged, the data obtained may be inaccurate, and it may also cause problems such as XSS and SQL injection
X-Forwarded-For: The format is as follows > X-Forwarded-For: client, proxy1, proxy2

Posted on 8/15/2017 4:30:42 PM |
This phenomenon is caused by load balancing, and this problem does not occur without load balancing?
 Landlord| Posted on 8/15/2017 5:13:56 PM |
Summer Posted on 2017-8-15 16:30
This phenomenon is caused by load balancing, and this problem does not occur without load balancing?

Yes, there will be no such problem without it

In fact, speaking of which, the plugin author is not strictly written, which should be inconsiderate
Posted on 7/22/2021 4:35:08 PM |
Learn a little
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com