I'm running Apache 2.2 on a linux box. Is there any reliable way of detecting if a visitor to my website is connecting from a VPN? I've heard of attempting to open a tcp connection on the remote ip address, which can sometimes identify the user as using a proxy. But could the same method work with VPN users?
Plain and simple - you can't. There are way too many types of VPN, way too many providers, and overall way too many variables here to be able to reliably tell if someone is using a VPN.