.htaccess files with access control and apps like the anti-spam module from Automatic / WordPress wil not work unless the correct IP address is displayed.
Download the module from CloudFlare.com
The correct filname is available here:
This is the download command:
Then install the module:
sudo dpkg -i mod_cloudflare-xenial-amd64.latest.deb
Finish it up by restarting Apache:
sudo service apache2 restart
Your .htaccess file that limits access to the admin panel should now work correct.
So should other parts of Apache and WordPress that relies on a correct IP address.