Recently I walked into a very interesting situation with this blog. As many of you may know that this blog is hosted on Linux server and runs with MySQL and PHP. Self-hosted WordPress is the platform for this blog.
Recently I started to notice that after some updates on platform, all the comments on the blog posts have exactly the same IP Address. This started to create a major problem for me. As most of you know malicious attacks and spamming is a common problem everywhere. This blog also receives lots of spam messages and it is very important that spams are filtered out so I can respond to all the valid comments.
However, now all the comments contain the same IP address and that also of the my server’s IP address, it was very difficult for the spam catcher plugin to catch all the spams. After reading through quite a many spam comments, I decided to fix this problem for good.
Here is the solution I applied.
I went to php.config which is in the root folder of public_html and added following lines in the code.
if($_SERVER['HTTP_X_REAL_IP']){ $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_REAL_IP'];}
Once I applied to above mentioned line, everything was back to normal. All the comments in the WordPress, started to show the IP address of the original individuals.
Well, that’s it. A very simple solution to a complicated problem.
Reference:Â Pinal Dave (https://blog.sqlauthority.com)
2 Comments. Leave new
Nice information
Thanks a lot for the info, i thought it was DNS issues. The support of my hosting recommended this article to solve my problem.