When setting REMOTE_ADDR in Apache, use useragent_ip instead of client_ip.

Closes GH-1284.